-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Agree on formatting style, and then create .clang-format config file to enforce it #1442
Comments
I started some work here: #1443 First thing to decide on: tabs vs spaces :) |
I think we will not be able to get a single |
Second thing: I think we should come up with a |
Why is that desirable? Such a small project could surely have a uniform style.
I did that already, using https://github.com/mikr/whatstyle. The result is the first commit here. |
Which is why |
When doing this I think some oddballs in os/* should be taken out. Maybe that whole folder. |
There is code mainly worked on by people deeply rooted in their own platform style. I wouldn't mind having the Windows code Windows style and the openbsd code openbsd style. OTOH we should expect their contributors to be able to adapt to our common style also. |
So let's see, that makes:
All that for a project with a mere 45 source files? It is possible to have different It seems the choices are:
I vote for 2 personally. I don't care what the style is. Being able to auto-apply style makes contributing to the project easier, and it makes code reviews easier. |
Optione 3 is something that hasn't been on the table and looks interesting. |
Perhaps we should consider how many differences there actually are? If few, then moving files around may be more disruptive than (for example) just standardizing on tabs vs spaces.
Subversion does, so surely git does too. |
I wouldn't be so sure - need to check. |
I would be opposed to option 3, if clang-format cannot do better then I would rather put "// clang-format off" into the odd-ball files, if we want to keep them odd-ball.
And again I think this exercise needs to be redone ignoring the current oddballs, or all os/* files. I don't think e.g. the haiku files should have a "vote" in our .clang-format specification. |
OK can do. What are the current oddballs? Other can haiku what shall I exclude? |
To not hurt any feelings you could exclude all os/* :) But I think the |
@tormodvolden ok see new commits, and commit messages. |
We should agree on a formatting style.
Some files indent with tabs, some with spaces. Some put braces one way, some another.
Once we agree on a style, we can then autoformat using the clang-format tool. There are even tools that examine a codebase and generate a preliminary clang-format config file based on the predominant style.
The text was updated successfully, but these errors were encountered: