Skip to content
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: enforce linebreak after ternary operators #10213

Closed
wants to merge 1 commit into from

Conversation

targos
Copy link
Member

@targos targos commented Dec 10, 2016

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Description of change

This is to be consistent with the other operators and helps
understanding the context when the code is grepped.

This is to be consistent with the other operators and helps
understanding the context when the code is grepped.
@nodejs-github-bot nodejs-github-bot added dont-land-on-v7.x repl Issues and PRs related to the REPL subsystem. stream Issues and PRs related to the stream subsystem. tools Issues and PRs related to the tools directory. url Issues and PRs related to the legacy built-in url module. labels Dec 10, 2016
Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

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

LGTM. eslint doesn't enforce four space indent after a linebreak?

@targos
Copy link
Member Author

targos commented Dec 10, 2016

eslint doesn't enforce four space indent after a linebreak?

I'm not sure. The indent rule has a lot options, some of them being off by default. Maybe @not-an-aardvark can answer?

@targos targos added tools Issues and PRs related to the tools directory. and removed tools Issues and PRs related to the tools directory. repl Issues and PRs related to the REPL subsystem. stream Issues and PRs related to the stream subsystem. url Issues and PRs related to the legacy built-in url module. labels Dec 10, 2016
Copy link
Contributor

@thefourtheye thefourtheye left a comment

Choose a reason for hiding this comment

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

LGTM if CI is happy.

@not-an-aardvark
Copy link
Contributor

eslint doesn't enforce four space indent after a linebreak?

Correct, this is currently ignored by the indent rule because everyone appears to have a different idea of the correct behavior.

@targos
Copy link
Member Author

targos commented Dec 11, 2016

@lpinca
Copy link
Member

lpinca commented Dec 12, 2016

I find this a lot less readable but it's only my personal preference, not a problem.

@Fishrock123
Copy link
Contributor

I actually find this significantly harder to read... 😕 👎

@Fishrock123
Copy link
Contributor

I guess it's consistent with how we do && and || though...

jasnell pushed a commit that referenced this pull request Dec 23, 2016
This is to be consistent with the other operators and helps
understanding the context when the code is grepped.

PR-URL: #10213
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Teddy Katz <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@jasnell
Copy link
Member

jasnell commented Dec 23, 2016

Landed in 966e5cf.

@jasnell jasnell closed this Dec 23, 2016
thefourtheye added a commit that referenced this pull request Dec 23, 2016
test-whatwg-url-parsing file violates the linter rule changes in
#10213. This patch makes the linter
happy.

PR-URL: #10421

Reviewed-By: Anna Henningsen <[email protected]>
@targos targos deleted the ternary-linebreak branch December 27, 2016 17:56
evanlucas pushed a commit that referenced this pull request Jan 3, 2017
This is to be consistent with the other operators and helps
understanding the context when the code is grepped.

PR-URL: #10213
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Teddy Katz <[email protected]>
Reviewed-By: James M Snell <[email protected]>
evanlucas pushed a commit that referenced this pull request Jan 3, 2017
test-whatwg-url-parsing file violates the linter rule changes in
#10213. This patch makes the linter
happy.

PR-URL: #10421

Reviewed-By: Anna Henningsen <[email protected]>
evanlucas pushed a commit that referenced this pull request Jan 4, 2017
This is to be consistent with the other operators and helps
understanding the context when the code is grepped.

PR-URL: #10213
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Teddy Katz <[email protected]>
Reviewed-By: James M Snell <[email protected]>
evanlucas pushed a commit that referenced this pull request Jan 4, 2017
test-whatwg-url-parsing file violates the linter rule changes in
#10213. This patch makes the linter
happy.

PR-URL: #10421

Reviewed-By: Anna Henningsen <[email protected]>
@MylesBorins
Copy link
Contributor

MylesBorins commented Jan 23, 2017

This does not land cleanly in LTS. Added dont-land label. Please feel free to manually backport

edit: if it does land it may need to come with #10421 on v6.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants