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

lib: change "comma-dangle" rule #19133

Closed
wants to merge 1 commit into from

Conversation

daynin
Copy link
Contributor

@daynin daynin commented Mar 4, 2018

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

lib, doc

- change the rule
- fix all linting issues
- close nodejs#19131
@nodejs-github-bot nodejs-github-bot added the tools Issues and PRs related to the tools directory. label Mar 4, 2018
Copy link
Member

@devsnek devsnek left a comment

Choose a reason for hiding this comment

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

1384 changed files is an unacceptable amount of churn for one pr, i'm -1 on this

@daynin
Copy link
Contributor Author

daynin commented Mar 4, 2018

@devsnek but how can we do this gradually? One PR for one file?

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

-1. This is so much churn. And no, please don't do this as multiple PRs.

@gibfahn
Copy link
Member

gibfahn commented Mar 5, 2018

@devsnek but how can we do this gradually? One PR for one file?

What is the benefit to enforcing one rule here? The only benefit I am aware of with the dangling comma is that it reduces the size of diffs. Making this many changes in order to reduce diff size seems counter-productive.

it can create misunderstandings in code review process.

Could you go into more detail please? AFAIK you're free to use either style in the codebase. I prefer trailing commas, but that's not something I'd request changes for in a PR review.

@apapirovski
Copy link
Member

I was going to suggest just adding this rule for lib but it looks like we recently went away from having separate lint configs on per directory basis. As per my comment on the original issue, I think doing this on an ongoing basis and being hopeful that eventually we get to the point where this rule can be enabled, is probably the most reasonable outcome.

@gibfahn
Copy link
Member

gibfahn commented Mar 5, 2018

I think doing this on an ongoing basis

Do you mean that people raising PRs (for some other reason) to a section of code could add commas at the same time? If so then agreed.

@BridgeAR
Copy link
Member

BridgeAR commented Mar 5, 2018

@apapirovski

I was going to suggest just adding this rule for lib but it looks like we recently went away from having separate lint configs on per directory basis.

If that is the case, then it is a regression. We still have the .eslintrc.yaml files in the directories that should be there for exactly that. I did not check if they still work or not.

@apapirovski
Copy link
Member

apapirovski commented Mar 5, 2018

@BridgeAR Seems my editor (Atom) recently decided to start ignoring these hidden files... ugh. I guess I have to hunt down what changed.

Do you mean that people raising PRs (for some other reason) to a section of code could add commas at the same time? If so then agreed.

@gibfahn Yeah, exactly.

@BridgeAR
Copy link
Member

BridgeAR commented Mar 5, 2018

@apapirovski it is very likely #18566.

@BridgeAR
Copy link
Member

BridgeAR commented Mar 5, 2018

I am going to close this due to the mentioned concerns.

@daynin thanks a lot for your contribution anyway!

@BridgeAR BridgeAR closed this Mar 5, 2018
@daynin
Copy link
Contributor Author

daynin commented Mar 5, 2018

@BridgeAR ok. And I'll close this issue too #19131

@daynin daynin deleted the change-comma-dangle-rule branch March 5, 2018 18:28
@gibfahn
Copy link
Member

gibfahn commented Mar 5, 2018

Thanks for taking the trouble @daynin, and for the PRs to node! The effort is appreciated and the discussion is useful even if the decision is not to change things.

@BridgeAR
Copy link
Member

BridgeAR commented Mar 7, 2018

@apapirovski I just checked if the .eslintrc.yaml in e.g. ./lib is still used and for me it does seem to be the case.

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.

Change "comma-dangle" rule
7 participants