-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add clang-format checks to CI #17194
base: master
Are you sure you want to change the base?
Conversation
I'm not sure this is a good thing. There is already a style guide that's followed. Is the purpose of this to make it work with IDEs? I don't think most of the developers use one, so changing the code style for IDEs would probably hamper development more than it would help. What would help development is refactoring some of the HUGE files into smaller chunks. |
No, there is already a format, but it's not being followed, I have had several unwanted formatting changes on previous PRs
This is not changing anything, just taking the already existing formatting rules and enforcing them on PRs. I am sorry if the description made it sound different.
Of course, but automatic formatting enforcement is usually the baseline to make contributions easier :) |
I think you’re missing the point. clang format file is not used by most (all) developers, so it’s not being followed or kept up-to-date. It needs to be either removed completely, or updated with current code style. It is not a ground truth to be enforced. That being said, I’m not sure if current code style is described anywhere, except for @TurboGit comments on PRs. That should be the first step - formulating it somewhere. |
https://github.com/darktable-org/darktable/wiki/Developer's-guide |
Yes, I thought the code style would resemble more closely the current clang file. I guess I'll ask some help to @TurboGit to bring the file up to date then :) |
That does not describe it fully. For example Pascal asks for function parameters to be one per line. |
I just realized that I used another account to reply to comments (that is, @fcs-ts is me 😅). I took a look at the |
@pitbuster : In the style there is at least 3 very important rules to me:
The rest can be discussed on the way. You're free to gather and document the style guide. This https://github.com/darktable-org/darktable/wiki/Developer's-guide#coding-style has not been touched since long time. Maybe you can take it over and update the style? |
@TurboGit I updated the section with your feedback (and also fixed the language hints for codeblocks, so we get highlighting in the wiki :D). Next, I'll try to see how far are the current |
I tweaked the rules a little bit to be closer to the points mentioned in the discussion. I also formatted |
This pull request has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please verify it has no conflicts with the master branch and rebase if needed. Mention it now if you need help or give permission to other people to finish your work. |
@TurboGit I know this will be some effort, but having consistent format should ease contributions: I was bitten by this, because the project has some formatting rules, which IDEs or language servers will pick, but are not enforced, so a lot of unwanted changes that people have to revert.
I see two options for landing this:
Also, probably the formatting rules themselves will cause a bit of discussion, but they can be changed as we reach consensus :)