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

docs/coding_conventions_c.md VS clang-format #8664

Closed
mtei opened this issue Apr 3, 2020 · 4 comments · Fixed by #8717
Closed

docs/coding_conventions_c.md VS clang-format #8664

mtei opened this issue Apr 3, 2020 · 4 comments · Fixed by #8717
Labels

Comments

@mtei
Copy link
Contributor

mtei commented Apr 3, 2020

In docs/coding_conventions_c.md it says the following:

* Do not put whitespace between `#` and `if`.

However, the .clang-format is set up as follows:

IndentPPDirectives: AfterHash

If you follow docs/coding_conventions_c.md, the .clang-format setting should look like this:

IndentPPDirectives: BeforeHash 

And I prefer the provision in docs/coding_conventions_c.md.

@mtei mtei added the question label Apr 3, 2020
@fauxpark
Copy link
Member

fauxpark commented Apr 3, 2020

The issue with BeforeHash is that since it's a relatively recent addition to clang-format, it may not be recognised for some users as most platforms don't provide the latest versions. We've gone with AfterHash for the time being so that there is at least some structure to them.

See #6316.

@mtei
Copy link
Contributor Author

mtei commented Apr 3, 2020

I understand. Thank you.

@mtei mtei closed this as completed Apr 3, 2020
@vomindoraan
Copy link
Contributor

Would it make sense to update the coding conventions to match .clang-format, for the time being? This may help prevent further confusion until we are ready to fully transition to BeforeHash.

@fauxpark
Copy link
Member

fauxpark commented Apr 4, 2020

Yeah, a bit of explanation on the current situation is probably called for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants