-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
doc: link to code style guide #12636
Comments
I think in general we try to document our coding style in lint rules. I don't know how easy it would be to lint for this. |
Yeah I was thinking about that (linting for header include) |
Still maybe we should have a style-guide to save new devs one "code" -> "lint" -> "fix" cycle |
The problem is that you then have to keep the style guide up to date with the linter. And I'm pretty sure the average dev would rather run the linter for each project than read the style guide, especially when you can just pass |
So I've been reading cpplint.py, and was reminded nodejs/node-v0.x-archive#8487 that it actualy linting acording to https://google.github.io/styleguide/cppguide.html, so may be a link, and some rules of thumb? |
Ref: #11753 |
This should remain open? If so, maybe label |
@refack I would like to work on this |
@refack no problem. Is there other beginners-friendly issue on which I can work? |
Hi, @Divya063! Take a look at http://nodetodo.org/getting-started/ for one way to get a good first task to work on in Node.js core. |
@Trott Thanks |
Ideally, most of these things would be enforced via linter rules. This is a first step into having a style guide that goes beyond what the linter currently enforces. PR-URL: nodejs/node#16090 Fixes: nodejs/node#12636 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Ideally, most of these things would be enforced via linter rules. This is a first step into having a style guide that goes beyond what the linter currently enforces. PR-URL: #16090 Fixes: #12636 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
IMHO we should add a link to the Google Style Guide according to which me are linting C++
and add some Best Practices
After #12540 I thought we should add something like:
When editing C++
If you add a new macro or use a new external function, make sure you include the header file explicitly in the file you are editing. This makes sure your change is independent of previous changes, and makes it easier to backport
The text was updated successfully, but these errors were encountered: