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

src: formatting of C++ files #45933

Closed
VoltrexKeyva opened this issue Dec 21, 2022 · 3 comments
Closed

src: formatting of C++ files #45933

VoltrexKeyva opened this issue Dec 21, 2022 · 3 comments
Labels
lib / src Issues and PRs related to general changes in the lib or src directory.

Comments

@VoltrexKeyva
Copy link
Member

The Node.js project has a .clang-format file to keep the C++ files in a consistent format, but it seems to be mostly unused as most of the C++ files in the src/ directory does not seem to have these formatting rules applied to them, is there a specific reason for this?

Are there any formatting rules specific to the Node.js C++ codebase styling rules that tools like clang-format can't already follow?

@VoltrexKeyva VoltrexKeyva added the lib / src Issues and PRs related to general changes in the lib or src directory. label Dec 21, 2022
@bnoordhuis
Copy link
Member

clang-format is run on diffs. New code is formatted, old code is untouched, that's the basic idea. #16122 (comment) is why.

@addaleax
Copy link
Member

Are there any formatting rules specific to the Node.js C++ codebase styling rules that tools like clang-format can't already follow?

I think https://github.com/nodejs/node/blob/main/doc/contributing/cpp-style-guide.md does have some rules that the formatter doesn't currently enforce, and maybe some that it can't do based on formatting alone.

@VoltrexKeyva
Copy link
Member Author

I see, I suppose it's understandable mainly because of the extreme amount of merge conflicts it can cause.

And about the formatting rules I was generally talking about rules that doesn't need to be manually applied/reviewed (such as naming conventions), which clang-format can already cover all of them AFAIK.

But closing due to the first reason.

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.
Projects
None yet
Development

No branches or pull requests

3 participants