GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tools: lint for function argument alignment by Trott · Pull Request #6390 · nodejs/node

Conversation

@Trott

@Trott Trott commented Apr 26, 2016

Copy link
Copy Markdown
Member
Checklist
  • tests and code linting passes
  • the commit message follows commit guidelines
Affected core subsystem(s)

tools test

Description of change

In function calls that span multiple lines, apply a custom lint rule to
enforce argument alignment.

With this rule, the following code will be flagged as an error by the
linter because the arguments on the second line start in a different
column than on the first line:

myFunction(a, b,
  c, d);

The following code will not be flagged as an error by the linter:

myFunction(a, b,
           c, d);

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Trott Trott added test Issues and PRs related to Node.js core tests and test infrastructure. tools Issues and PRs related to the tools directory. labels Apr 26, 2016
@Trott Trott mentioned this pull request Apr 26, 2016
tools: lint for function argument alignment #6268
Closed
2 tasks done
@JacksonTian
JacksonTian force-pushed the master branch from bf3ffc2 to 92a02d5 Compare April 26, 2016 06:58
@jasnell

jasnell commented Apr 26, 2016

Copy link
Copy Markdown
Member

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Trott added 2 commits April 26, 2016 17:15
@Trott
test,tools: adjust function argument alignment
0c69eb9
In preparation for a lint rule enforcing function argument alignment,
adjust function arguments to be aligned.
@Trott
tools: lint for function argument alignment
4b0c0d8
In function calls that span multiple lines, apply a custom lint rule to
enforce argument alignment.

With this rule, the following code will be flagged as an error by the
linter because the arguments on the second line start in a different
column than on the first line:

    myFunction(a, b,
      c, d);

The following code will not be flagged as an error by the linter:

    myFunction(a, b,
               c, d);
@Trott
Trott force-pushed the align-again branch from 16562e3 to 4b0c0d8 Compare April 27, 2016 00:16
@Trott

Trott commented Apr 27, 2016

Copy link
Copy Markdown
Member Author

CI: https://ci.nodejs.org/job/node-test-pull-request/2404/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jbergstroem

jbergstroem commented Apr 27, 2016

Copy link
Copy Markdown
Member

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Apr 28, 2016

Copy link
Copy Markdown
Member Author

Only CI failure is the current problematic tick processor test on OS X. Unrelated.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Apr 28, 2016

Copy link
Copy Markdown
Member Author

/bump @nodejs/collaborators I'd like to land this, but I definitely would like a few more opinions before doing so.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mscdex

mscdex commented Apr 28, 2016

Copy link
Copy Markdown
Contributor

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

1 similar comment
@imran-iq

imran-iq commented Apr 28, 2016

Copy link
Copy Markdown
Contributor

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bnoordhuis
bnoordhuis reviewed Apr 28, 2016
View reviewed changes
Comment thread tools/eslint-rules/align-function-arguments.js
// For now, don't bother trying to validate potentially complicating things
// like closures. Different people will have very different ideas and it's
// probably best to implement configuration options.
if (args.some((node) => { return ignoreTypes.indexOf(node.type) !== -1; })) {

@bnoordhuis bnoordhuis Apr 28, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

if (args.some((node) => ignoreTypes.includes(node.type))) {?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Trott Trott Apr 28, 2016

Copy link
Copy Markdown
Member Author

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.

At least for the moment, that will break on CI. For faster results, the VM that runs the linter uses the system Node.js (currently 5.x) and doesn't compile from source. 5.x does not have Array.prototype.includes().

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Trott Trott Apr 28, 2016

Copy link
Copy Markdown
Member Author

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.

Although I could get rid of the braces and return keyword... is "no braces for arrow functions where they can be omitted" a style we want to standardize on? ESLint has a built-in rule for that.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@bnoordhuis bnoordhuis Apr 28, 2016

Copy link
Copy Markdown
Member

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.

I prefer the short form because why many words when can terse, right? @jbergstroem Are there any downsides to upgrading the node that runs the linter to v6?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bnoordhuis

bnoordhuis commented Apr 28, 2016

Copy link
Copy Markdown
Member

LGTM with a suggestion.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rmg

rmg commented Apr 28, 2016

Copy link
Copy Markdown
Contributor

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Trott added a commit to Trott/io.js that referenced this pull request Apr 28, 2016
@Trott
test,tools: adjust function argument alignment
8f56958
In preparation for a lint rule enforcing function argument alignment,
adjust function arguments to be aligned.

PR-URL: nodejs#6390
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Imran Iqbal <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ryan Graham <[email protected]>
Trott added a commit to Trott/io.js that referenced this pull request Apr 28, 2016
@Trott
tools: lint for function argument alignment
ded3aea
In function calls that span multiple lines, apply a custom lint rule to
enforce argument alignment.

With this rule, the following code will be flagged as an error by the
linter because the arguments on the second line start in a different
column than on the first line:

    myFunction(a, b,
      c, d);

The following code will not be flagged as an error by the linter:

    myFunction(a, b,
               c, d);

PR-URL: nodejs#6390
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Imran Iqbal <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ryan Graham <[email protected]>
@Trott

Trott commented Apr 28, 2016

Copy link
Copy Markdown
Member Author

Landed in 8f56958 and ded3aea

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott Trott closed this Apr 28, 2016
Trott added a commit to Trott/io.js that referenced this pull request Apr 28, 2016
@Trott
tools: enforce arrow function brace usage linting
8f7b96d
If braces are not required for an arrow function body, omit them.

Refs: nodejs#6390 (diff)
@Trott Trott mentioned this pull request Apr 28, 2016
tools: enforce arrow function brace usage linting #6455
Closed
2 tasks done
Fishrock123 pushed a commit that referenced this pull request May 4, 2016
@Trott @Fishrock123
test,tools: adjust function argument alignment
6d1606e
In preparation for a lint rule enforcing function argument alignment,
adjust function arguments to be aligned.

PR-URL: #6390
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Imran Iqbal <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ryan Graham <[email protected]>
Fishrock123 pushed a commit that referenced this pull request May 4, 2016
@Trott @Fishrock123
tools: lint for function argument alignment
3f608b1
In function calls that span multiple lines, apply a custom lint rule to
enforce argument alignment.

With this rule, the following code will be flagged as an error by the
linter because the arguments on the second line start in a different
column than on the first line:

    myFunction(a, b,
      c, d);

The following code will not be flagged as an error by the linter:

    myFunction(a, b,
               c, d);

PR-URL: #6390
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Imran Iqbal <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ryan Graham <[email protected]>
This was referenced May 4, 2016
Propose v6.1.0 wrong base please ignore #6556
Closed
Propose v6.1.0 (Openssl update) #6557
Merged
@MylesBorins MylesBorins added the dont-land-on-v4.x label Jun 1, 2016
@MylesBorins

MylesBorins commented Jun 1, 2016

Copy link
Copy Markdown
Contributor

@Trott you know the drill 📦

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott Trott mentioned this pull request Jun 2, 2016
Backport #6390 #7100
Closed
2 tasks done
@Trott

Trott commented Jun 2, 2016

Copy link
Copy Markdown
Member Author

@thealphanerd #7100

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Trott added a commit to Trott/io.js that referenced this pull request Jun 4, 2016
@Trott
test,tools: adjust function argument alignment
69ca75d
In preparation for a lint rule enforcing function argument alignment,
adjust function arguments to be aligned.

PR-URL: nodejs#7100
Refs: nodejs#6390
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Imran Iqbal <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ryan Graham <[email protected]>
Trott added a commit to Trott/io.js that referenced this pull request Jun 4, 2016
@Trott
tools: lint for function argument alignment
6c46eee
In function calls that span multiple lines, apply a custom lint rule to
enforce argument alignment.

With this rule, the following code will be flagged as an error by the
linter because the arguments on the second line start in a different
column than on the first line:

    myFunction(a, b,
      c, d);

The following code will not be flagged as an error by the linter:

    myFunction(a, b,
               c, d);

PR-URL: nodejs#7100
Refs: nodejs#6390
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Imran Iqbal <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ryan Graham <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jun 6, 2016
@Trott Myles Borins
test,tools: adjust function argument alignment
5b3ac93
In preparation for a lint rule enforcing function argument alignment,
adjust function arguments to be aligned.

PR-URL: #7100
Refs: #6390
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Imran Iqbal <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ryan Graham <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jun 6, 2016
@Trott Myles Borins
tools: lint for function argument alignment
2447b57
In function calls that span multiple lines, apply a custom lint rule to
enforce argument alignment.

With this rule, the following code will be flagged as an error by the
linter because the arguments on the second line start in a different
column than on the first line:

    myFunction(a, b,
      c, d);

The following code will not be flagged as an error by the linter:

    myFunction(a, b,
               c, d);

PR-URL: #7100
Refs: #6390
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Imran Iqbal <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ryan Graham <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jun 24, 2016
@Trott Myles Borins
test,tools: adjust function argument alignment
7e739ae
In preparation for a lint rule enforcing function argument alignment,
adjust function arguments to be aligned.

PR-URL: #7100
Refs: #6390
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Imran Iqbal <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ryan Graham <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jun 24, 2016
@Trott Myles Borins
tools: lint for function argument alignment
216486c
In function calls that span multiple lines, apply a custom lint rule to
enforce argument alignment.

With this rule, the following code will be flagged as an error by the
linter because the arguments on the second line start in a different
column than on the first line:

    myFunction(a, b,
      c, d);

The following code will not be flagged as an error by the linter:

    myFunction(a, b,
               c, d);

PR-URL: #7100
Refs: #6390
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Imran Iqbal <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ryan Graham <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jun 24, 2016
@Trott Myles Borins
test,tools: adjust function argument alignment
5e0c06f
In preparation for a lint rule enforcing function argument alignment,
adjust function arguments to be aligned.

PR-URL: #7100
Refs: #6390
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Imran Iqbal <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ryan Graham <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jun 24, 2016
@Trott Myles Borins
tools: lint for function argument alignment
7fdfde4
In function calls that span multiple lines, apply a custom lint rule to
enforce argument alignment.

With this rule, the following code will be flagged as an error by the
linter because the arguments on the second line start in a different
column than on the first line:

    myFunction(a, b,
      c, d);

The following code will not be flagged as an error by the linter:

    myFunction(a, b,
               c, d);

PR-URL: #7100
Refs: #6390
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Imran Iqbal <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ryan Graham <[email protected]>
@Trott
Trott deleted the align-again branch January 13, 2022 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

test Issues and PRs related to Node.js core tests and test infrastructure. tools Issues and PRs related to the tools directory.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@Trott @jasnell @jbergstroem @mscdex @imran-iq @bnoordhuis @rmg @MylesBorins
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.