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

Consistent trailing newlines #9402

Closed
silverwind opened this issue Nov 1, 2016 · 4 comments
Closed

Consistent trailing newlines #9402

silverwind opened this issue Nov 1, 2016 · 4 comments
Labels
lib / src Issues and PRs related to general changes in the lib or src directory. tools Issues and PRs related to the tools directory.

Comments

@silverwind
Copy link
Contributor

To avoid discussions and diffs like https://github.com/nodejs/node/pull/9379/files#r85787597, we could enable EditorConfig's option to enforce a final newline:

insert_final_newline = true

For js files, this could additionally be enforced through the eol-last linter rule. If we decide to do it, we need to assert which files we want to include in .editorconfig. I think anything except deps and likely test assets should be good.

cc: @thefourtheye @addaleax @cjihrig @princejwesley @lpinca

@silverwind silverwind added tools Issues and PRs related to the tools directory. lib / src Issues and PRs related to general changes in the lib or src directory. labels Nov 1, 2016
@cjihrig
Copy link
Contributor

cjihrig commented Nov 1, 2016

SGTM. I think we'd want to include test/ too, but it would probably come down to how many files needed to change.

@silverwind
Copy link
Contributor Author

Yes, test and test assets should be included. If necessary we can change tests.

@silverwind
Copy link
Contributor Author

Suprisingly, we're already pretty consistent (or I'm doing something wrong):

$ find . -type f -not -path "./deps/*" -not -path "./out/*" -not -path "./tools/eslint/*" -not -path "./tools/gyp/*" -not -path "./tools/icu/*" -not -path "./tools/msvs/*" -not -path "*/node_modules/*" -iregex '.*\.\(js\|cc\|h\|d\|man\|manifest|\rc\|md\|mardown\|eslintrc\|py\|txt\|sh\|pl\|json\|pem\|key\|crt\|ini\|cnf\|html\|css\)$' | xargs sed -i -e '$a\'
$ git diff --name-only
benchmark/README.md
doc/api_assets/sh_javascript.min.js
test/fixtures/elipses.txt
test/fixtures/fixture.ini
test/fixtures/invalid.json
test/fixtures/keys/agent1-pfx.pem
test/fixtures/msca.pem
test/fixtures/test-error-first-line-offset.js
test/fixtures/url-tests.json
test/fixtures/x1024.txt

@silverwind
Copy link
Contributor Author

Filed #9410.

silverwind added a commit that referenced this issue Nov 4, 2016
PR-URL: #9410
Fixes: #9402
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
evanlucas pushed a commit that referenced this issue Nov 7, 2016
PR-URL: #9410
Fixes: #9402
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
evanlucas pushed a commit that referenced this issue Nov 7, 2016
PR-URL: #9410
Fixes: #9402
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
silverwind added a commit to silverwind/node that referenced this issue Nov 22, 2016
PR-URL: nodejs#9410
Fixes: nodejs#9402
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
silverwind added a commit to silverwind/node that referenced this issue Nov 22, 2016
PR-URL: nodejs#9410
Fixes: nodejs#9402
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
MylesBorins pushed a commit that referenced this issue Dec 21, 2016
PR-URL: #9410
Fixes: #9402
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
MylesBorins pushed a commit that referenced this issue Dec 21, 2016
PR-URL: #9410
Fixes: #9402
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
MylesBorins pushed a commit that referenced this issue Dec 21, 2016
PR-URL: #9410
Fixes: #9402
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
MylesBorins pushed a commit that referenced this issue Dec 21, 2016
PR-URL: #9410
Fixes: #9402
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
MylesBorins pushed a commit that referenced this issue Dec 21, 2016
PR-URL: #9410
Fixes: #9402
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib / src Issues and PRs related to general changes in the lib or src directory. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

No branches or pull requests

2 participants