-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tools: improve js linter #5638
tools: improve js linter #5638
Conversation
We currently do |
@mscdex btw, it's on my agenda to – at some stage – get tap output from the linter so we can post feedback to github. It acts differently than the test suite since lint only reports errors and we'd have an "error count"; but it's still better than no output at all. This may or may not affect your current work but I thought I'd just bring it up. You can find my work and playing around here: jbergstroem#1 |
@mscdex the problem with switching what command the linter should run is that we need to merge that commit to all branches and have it sit there for a while before we can switch in CI; otherwise it would call a command that wouldn't exist. My plan to address this was introducing placeholders and let them sit around for a while. I obviously forgot about it. |
@jbergstroem Does the tap output have to all be in one single group of results (e.g. only one TAP header in the output file) or does it not matter? |
@mscdex I recall globbing files ("collect |
61174ff
to
d4be90c
Compare
Ok, I've updated it to allow output to file and selecting the formatter. |
d4be90c
to
6c4e3e1
Compare
Nice work, seems to run slightly faster too: Before: |
Is that faster or slower? |
3s faster, but a lot more cpu intensive. |
6c4e3e1
to
4f6c8ad
Compare
I am getting ~7s improvement on my machine with the current list of files we lint. I also just bumped up the max load per worker and that seemed to decrease times a tad more. It will use more cpu time if you have multiple cores though. |
I again just want to make the note that we can't land this as-is seeing how we rely on
|
4f6c8ad
to
b7c5f6d
Compare
LGTM although there are a few conflicts. @jbergstroem What needs to happen before this can land? |
@bnoordhuis I suggest we do the first path; create placeholders in Makefile and make sure we get that commit into all branches we want to cover in CI, then land this. |
I don't think the |
b7c5f6d
to
72994e6
Compare
@Trott That message is from @jbergstroem What would that kind of initial change look like? I'd like to get the placeholders in sooner than later. |
@mscdex I'll do a PR. |
@mscdex Ah, yes, you are correct, of course. The errors are showing up just fine in the |
const secs = padString(elapsed % 60, 2, '0'); | ||
const passed = padString(successes, 6, ' '); | ||
const failed = padString(failures, 6, ' '); | ||
var pct = Math.ceil(((totalPaths - paths.length) / totalPaths) * 100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Percent complete
@mscdex could you comment-document the new jslint proxy tool more? I just want to make sure this isn't something we have to fight with much in the future. :) |
72994e6
to
e13cad2
Compare
@Fishrock123 more comments added |
By "update" I just meant look at merging; sorry. I've changed targets in ci now -- this might imply that old jobs that hasn't been rebased as of late will likely fail; so lets try and keep track of that. Failed lint jobs aren't common, so it should be pretty easy to spot. LGTM. |
Actually; hold off passing |
e13cad2
to
3d3ef39
Compare
This commit switches from the eslint command-line tool to a custom tool that uses eslint programmatically in order to perform linting in parallel and to display linting results incrementally instead of buffering them until the end. Fixes: nodejs#5596 PR-URL: nodejs#5638 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
3d3ef39
to
81fd458
Compare
(Still LGTM after you added |
FYI: Went from spending >50sec to <30sec in our CI on linting as a result of this PR 🎉 |
This commit switches from the eslint command-line tool to a custom tool that uses eslint programmatically in order to perform linting in parallel and to display linting results incrementally instead of buffering them until the end. Fixes: #5596 PR-URL: #5638 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
This commit switches from the eslint command-line tool to a custom tool that uses eslint programmatically in order to perform linting in parallel and to display linting results incrementally instead of buffering them until the end. Fixes: #5596 PR-URL: #5638 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
@mscdex do you think we should backport this to v4? |
@thealphanerd AFAIK it should work as long as a2ca347 is also applied. |
This commit switches from the eslint command-line tool to a custom tool that uses eslint programmatically in order to perform linting in parallel and to display linting results incrementally instead of buffering them until the end. Fixes: #5596 PR-URL: #5638 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
This commit switches from the eslint command-line tool to a custom tool that uses eslint programmatically in order to perform linting in parallel and to display linting results incrementally instead of buffering them until the end. Fixes: #5596 PR-URL: #5638 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
I'm going to mark this as do not land for lts right now @mscdex feel free to prepare a backport of this change if you think it would be beneficial |
Pull Request check-list
Please make sure to review and check all of these items:
make -j8 test
(UNIX) orvcbuild test nosign
(Windows) pass withthis change (including linting)?
test (or a benchmark) included?
existing APIs, or introduces new ones)?
Affected core subsystem(s)
tools
Description of change
This commit switches from the
eslint
command-line tool to a custom tool that useseslint
programmatically in order to perform linting in parallel and to display linting results incrementally instead of buffering them until the end. There is also now a progress indicator similar to that ofmake test
.Additionally, there is a new
lint-ci
rule that disables the progress indicator. I guess the command used on the linter Jenkins node will need to be changed internally as I couldn't find where it's configured to use what command.Fixes: #5596