-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
build: use generic names for linting tasks #15272
Conversation
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.
<deleted, I meant to request changes, not approve, sorry>
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.
An explanation: jslint isn't supposed to be referring to the underlying tool and was never (as far as I know) intended that way. It's intend to be referring to the action. So jslint is correct. Running make jslint executes linting for js files.
It's unfortunate that jslint is readily identifiable as an existing tool.
I'm pretty sure this change has been proposed before and was rejected. However, (if I'm not misremembering all that) the fact that it has come up at least twice now suggests that the name is genuinely bothersome to some people, so maybe it is worth changing?
Except for the fact that now everyone has to know to run make eslint
all of a sudden when they've been running make jslint
forever. And tutorials are now wrong. And so on
I'm definitely -1 on getting rid of make jslint entirely. But if you wanted to add a make eslint
alias that just runs make jslint
, I wouldn't stop it. It does seem to be not very future-proof. One day we'll switch to another underlying tool and need to change the command again....
@Trott I'd like to eventually get rid of "jslint" in the codebase though. Would you be less opposed if Having |
@seishun How about we leave the underlying tool out of the naming entirely? Maybe something like this?: Given that:
Perhaps instead of
We can have a period of time where |
@Trott I'm open to that, although I'm not totally comfortable with inventing a generic term for linting JS. Let's see what other @nodejs/collaborators think.
What harm is there in introducing a warning right away? |
I think keeping 'jslint' is best, especially if we decide to switch to another tool in the future (so we don't have to change the name everywhere again at that point). |
I'd rather we do this, it's not tool specific and it fits the rest of the makefile. I've also been confused by the use of |
Mostly people complaining. :-D There will undoubtedly be those who feel that the current task name should work indefinitely. If you're up for having that conversation sooner rather than later, then go for it. My inclination is usually to make the smallest changes reasonable, one at a time. But that isn't always the best thing to do, so... |
Has it actually ever though? Has anyone tried to run the |
@benjamingr That's what the PR description seems to describe. I'm in favor of what @Trott is suggesting here. Make |
@benjamingr when I set up my repo to open my first Node.js PRs I was very confused about the name. I like |
I was also confused by the name at one point, although I wouldn't say my confusion actually caused any issues (since I never needed to know what the file was doing anyway). |
I am inclined to what @mscdex has said. |
@mscdex @thefourtheye Given the reason, would |
@Trott Those names themselves are fine, but I just don't see a need to change anything. |
I am rather for keeping it. Let alone to avoid the churn and bikeshedding. Also don't feel there is a need. |
I'm also in favor of keeping the existing names. |
As suggested by @Trott, replaced This makes it more consistent with other task names such as One thing I'm not sure about is vcbuild.bat output when running lint tasks. I wonder if "running eslint"/"running cpplint" would be preferable to "running lint-js"/"running lint-cpp". |
vcbuild.bat
Outdated
if not defined cpplint goto jslint | ||
call :run-cpplint src\*.c src\*.cc src\*.h test\addons\*.cc test\addons\*.h test\cctest\*.cc test\cctest\*.h test\gc\binding.cc tools\icu\*.cc tools\icu\*.h | ||
:lint-cpp | ||
if not defined lint-cpp goto lint-js |
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.
working env vars are named with _
so lint_cpp
vcbuild.bat
Outdated
if defined enable_static goto exit | ||
if defined jslint_ci goto jslint-ci | ||
if not defined jslint goto exit | ||
if defined lint-js_ci goto lint-js-ci |
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.
lint_js_ci
vcbuild.bat
Outdated
if defined jslint_ci goto jslint-ci | ||
if not defined jslint goto exit | ||
if defined lint-js_ci goto lint-js-ci | ||
if not defined lint-js goto exit |
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.
lint_js
vcbuild.bat
Outdated
if not exist tools\eslint\bin\eslint.js goto no-lint | ||
echo running jslint | ||
echo running lint-js | ||
%config%\node tools\eslint\bin\eslint.js --cache --rule "linebreak-style: 0" --rulesdir=tools\eslint-rules --ext=.js,.md benchmark doc lib test tools |
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.
To have a the output be similar to lint-cpp
, I'd do:
set lint_js_cmd=%config%\node tools\eslint\bin\eslint.js --cache --rule "linebreak-style: 0" --rulesdir=tools\eslint-rules --ext=.js,.md benchmark doc lib test tools
echo %lint_js_cmd%
%lint_js_cmd%
And similarly with `lint-js-ci`
So for running lint-cpp 'src\*.c src\*.cc src\*.h test\addons\*.cc test\addons\*.h test\cctest\*.cc test\cctest\*.h test\gc\binding.cc tools\icu\*.cc tools\icu\*.h'
"C:\bin\dev\python27\python.exe" tools/lint-cpp.py src\async-wrap.cc src\backtrace_posix.cc src\backtrace_win32 ... Which IMHO is nice and useful |
Sorry, I messed up. The filename is actually |
I am a bit surprised that there are a couple of persons saying that there is no need for changing something when there were four people mentioning that they were confused about the name. Does anyone of you @mscdex @cjihrig @thefourtheye @eljefedelrodeodeljefe have a strong opinion about this? I do not see any negative side as I do not see the churn as a real negative point here. |
No strong opinion, but ideally I would want the understanding that churn and bikeshedding is distraction from doing valuable things. Not only the authors' but also those of multiple reviewers. And hence should be discouraged. See, I learned to be conservative about the codebase since it's a very serious business running it in production. Just think of this: what is the consequence in closing this now. Nothing really. Go ahead as you deem it pls. |
So what is the conclusion here? |
AFAICT we have three +1 and two -0. Unless someone wants to explicitly -1, this could land. |
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.
+1 from me too
I think there was enough time to express a clear -1 and this has not happened, so it should be fine to land this. @seishun it needs a rebase though. |
"jslint" is the name of a tool that actually is not used, which can cause confusion. PR-URL: #15272 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]>
Running CI one last time since there was a rebase: https://ci.nodejs.org/job/node-test-pull-request/10217/ |
Landed in b2eb987 |
"jslint" is the name of a tool that actually is not used, which can cause confusion. PR-URL: #15272 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]>
"jslint" is the name of a tool that actually is not used, which can cause confusion. PR-URL: #15272 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]>
"jslint" is the name of a tool that actually is not used, which can cause confusion. PR-URL: nodejs/node#15272 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]>
Should this be backported to If it is backported I think it would make sense to remove the warning when calling |
"jslint" is the name of a tool that actually is not used, which can cause confusion. Backport-PR-URL: #16297 PR-URL: #15272 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]>
"jslint" is the name of a tool that actually is not used, which can cause confusion. Backport-PR-URL: #16297 PR-URL: #15272 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]>
"jslint" is the name of a tool that actually is not used, which can cause confusion. Backport-PR-URL: #16297 PR-URL: #15272 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]>
"jslint" is the name of a tool that actually is not used, which can cause confusion.
(I installed the jslint extension in VSCode and it took me a while to figure out why it's not working)
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
build