FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

build: use generic names for linting tasks by seishun · Pull Request #15272 · nodejs/node · GitHub

/ node Public

build: use generic names for linting tasks - #15272

Closed
seishun wants to merge 1 commit into
nodejs:masterfrom
seishun:eslint
Closed

build: use generic names for linting tasks#15272
seishun wants to merge 1 commit into
nodejs:masterfrom
seishun:eslint

Conversation

seishun commented Sep 8, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

"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), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

build

nodejs-github-bot added build Issues and PRs related to build files or the CI. tools Issues and PRs related to the tools directory. windows Issues and PRs related to the Windows platform. labels Sep 8, 2017

Trott left a comment
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

<deleted, I meant to request changes, not approve, sorry>

Trott previously requested changes Sep 8, 2017

Trott left a comment
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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....

seishun commented Sep 9, 2017

Copy link
Copy Markdown
Contributor Author

@Trott I'd like to eventually get rid of "jslint" in the codebase though. Would you be less opposed if make jslint displayed an error telling the user to use make eslint instead?

Having make eslint and make jslint be aliases of each other could be confusing. Someone might erroneously think that the latter runs JSLint, while the former runs ESLint.

Trott commented Sep 9, 2017

Copy link
Copy Markdown
Member

@seishun How about we leave the underlying tool out of the naming entirely? Maybe something like this?:

Given that:

  • make test tests (nearly) everything.
  • make test-addons and similar variants only test addons, etc.
  • make lint lints everything.

Perhaps instead of make jslint and make cpplint, we should reformat like the test-* stuff?:

  • make lint-js will do what make jslint currently does.
  • make lint-cpp will do what make cpplint currently does.

We can have a period of time where jslint is an undocumented alias for lint-js. After a period of time, jslint emits a warning pointing at the new name but is still an effective alias. At some point after that, it emits the warning and does nothing else. And maybe it stays that way forever or maybe we remove the alias at some point after that.

seishun commented Sep 10, 2017

Copy link
Copy Markdown
Contributor Author

@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.

We can have a period of time where jslint is an undocumented alias for lint-js. After a period of time, jslint emits a warning pointing at the new name but is still an effective alias.

What harm is there in introducing a warning right away?

mscdex commented Sep 10, 2017

Copy link
Copy Markdown
Contributor

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).

gibfahn commented Sep 10, 2017

Copy link
Copy Markdown
Member
  • make lint-js will do what make jslint currently does.
  • make lint-cpp will do what make cpplint currently does.

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 jslint in our codebase.

Trott commented Sep 10, 2017

Copy link
Copy Markdown
Member

What harm is there in introducing a warning right away?

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...
¯\(ツ)

Copy link
Copy Markdown
Member

"jslint" is the name of a different tool, which can cause confusion.

Has it actually ever though? Has anyone tried to run the jslint tool on Node files because their make jslint failed?

Copy link
Copy Markdown
Contributor

@benjamingr That's what the PR description seems to describe.

I'm in favor of what @Trott is suggesting here. Make js and css postfixes. It fits the style, and it removes all ambiguity.

Copy link
Copy Markdown
Member

@benjamingr when I set up my repo to open my first Node.js PRs I was very confused about the name.

I like make lint-js a lot as it does not comply to any library and I think that is a good way to make the live of newcomers a tad easier.

Copy link
Copy Markdown
Contributor

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).

Copy link
Copy Markdown
Contributor

I am inclined to what @mscdex has said.

Trott commented Sep 11, 2017

Copy link
Copy Markdown
Member

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).

@mscdex @thefourtheye Given the reason, would lint-js and lint-cpp be acceptable? That would be analogous to test-addons etc.

mscdex commented Sep 11, 2017

Copy link
Copy Markdown
Contributor

@Trott Those names themselves are fine, but I just don't see a need to change anything.

Copy link
Copy Markdown
Contributor

I am rather for keeping it. Let alone to avoid the churn and bikeshedding. Also don't feel there is a need.

cjihrig commented Sep 11, 2017

Copy link
Copy Markdown
Contributor

I'm also in favor of keeping the existing names.

seishun changed the title build: replace references to jslint with eslint build: use generic names for linting tasks Sep 11, 2017

seishun commented Sep 11, 2017
edited
Loading

Copy link
Copy Markdown
Contributor Author

As suggested by @Trott, replaced eslint with lint-js and cpplint with lint-cpp. The old names still work, but print warnings.

This makes it more consistent with other task names such as test-addons and prevents confusion, so why not?

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".

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

working env vars are named with _ so lint_cpp

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lint_js_ci

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lint_js

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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`

refack commented Sep 11, 2017

Copy link
Copy Markdown
Contributor

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".

So for lint-cpp the invocation trough call :run-python tools/lint-cpp.py %cppfilelist% will also output the actual CLI invocation of python, so the output is:

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
(tl;dr keep echo prompt as is, fix lint-js per my comments)

seishun commented Sep 11, 2017

Copy link
Copy Markdown
Contributor Author

Which IMHO is nice and useful

Sorry, I messed up. The filename is actually cpplint.py, and it shouldn't be renamed because it's actually the name of the tool.

Trott dismissed their stale review September 11, 2017 22:30

comments addressed

BridgeAR commented Sep 13, 2017
edited
Loading

Copy link
Copy Markdown
Member

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.
Especially when the old name is kept as a fallback as is it is right now. The confusion can lead to some unnecessary overhead for new people.

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.

Copy link
Copy Markdown
Contributor

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.

refack commented Sep 14, 2017

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Member

So what is the conclusion here?

refack commented Sep 19, 2017

Copy link
Copy Markdown
Contributor

AFAICT we have three +1 and two -0. Unless someone wants to explicitly -1, this could land.

aqrln left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

+1 from me too

Copy link
Copy Markdown
Member

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 <me@silverwind.io>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>

seishun commented Sep 23, 2017

Copy link
Copy Markdown
Contributor Author

Running CI one last time since there was a rebase: https://ci.nodejs.org/job/node-test-pull-request/10217/

Copy link
Copy Markdown
Member

Landed in b2eb987

BridgeAR closed this Sep 24, 2017
BridgeAR pushed a commit that referenced this pull request Sep 24, 2017
"jslint" is the name of a tool that actually is not used, which can
cause confusion.

PR-URL: #15272
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
jasnell pushed a commit that referenced this pull request Sep 25, 2017
"jslint" is the name of a tool that actually is not used, which can
cause confusion.

PR-URL: #15272
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
addaleax pushed a commit to addaleax/ayo that referenced this pull request Sep 30, 2017
"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 <me@silverwind.io>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
seishun deleted the eslint branch October 3, 2017 12:25
seishun restored the eslint branch October 3, 2017 12:25

Copy link
Copy Markdown
Contributor

Should this be backported to v6.x-staging? If yes please follow the guide and raise a backport PR, if not let me know or add the dont-land-on label.

If it is backported I think it would make sense to remove the warning when calling make jslint, as that could be considered a behavior change in CI systems.

MylesBorins pushed a commit that referenced this pull request Oct 19, 2017
"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 <me@silverwind.io>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
MylesBorins mentioned this pull request Oct 19, 2017
MylesBorins pushed a commit that referenced this pull request Oct 25, 2017
"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 <me@silverwind.io>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
MylesBorins pushed a commit that referenced this pull request Oct 26, 2017
"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 <me@silverwind.io>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
MylesBorins mentioned this pull request Nov 3, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issues and PRs related to build files or the CI. tools Issues and PRs related to the tools directory. windows Issues and PRs related to the Windows platform.

Projects

None yet

Development

Successfully merging this pull request may close these issues.


Back | FazBrowse Home | New Git URL