flux icon indicating copy to clipboard operation
flux copied to clipboard

Add clang-format

Open DeveloperPaul123 opened this issue 2 years ago • 9 comments

This clang-format was created using LLVM's tool to "detect" the format from existing code. From my testing, it's quite close.

DeveloperPaul123 avatar Aug 01 '23 16:08 DeveloperPaul123

Hi @DeveloperPaul123!

Please could you submit these changes as two separate PRs? The .gitignore update looks good and I'll commit it right away, but I want to try out the clang-format file first before deciding whether to add it (I've found that clang-format destroys my hand-crafted nice formatting as often as it fixes things...)

tcbrindle avatar Aug 01 '23 16:08 tcbrindle

@tcbrindle Seems reasonable! Done in #111

DeveloperPaul123 avatar Aug 01 '23 16:08 DeveloperPaul123

@tcbrindle Seems reasonable! Done in #111

...and merged!

tcbrindle avatar Aug 01 '23 16:08 tcbrindle

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.67%. Comparing base (983f1cb) to head (c3d4a15). Report is 335 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #110   +/-   ##
=======================================
  Coverage   97.67%   97.67%           
=======================================
  Files          66       66           
  Lines        2236     2236           
=======================================
  Hits         2184     2184           
  Misses         52       52           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 01 '23 16:08 codecov[bot]

@tcbrindle Any comments on the clang-format? Or any formatting changes you'd like to see in the config file?

DeveloperPaul123 avatar Aug 15 '23 18:08 DeveloperPaul123

I do like the idea of having a project-wide clang format config to keep everything consistent, and to make life easier for new contributors.

The only problem is that I'm very fussy when it comes to how I like my code formatted!

I still need to have a play with all the clang-format options until I find the combination I like.

tcbrindle avatar Aug 17 '23 11:08 tcbrindle

I completely understand. If you have examples of styling that you want to keep that clang-format is breaking, feel free to post them here and I can try to update the clang format file.

DeveloperPaul123 avatar Aug 17 '23 12:08 DeveloperPaul123

While contributing on #192, at least half of the reviews were about formatting. This creates work for both the contributors and the maintainer(s) that could be automated. I understand your desire of keeping your code formatted exactly as you like, but I think this is a case where consistency and automation beat preference. I'm willing to update this PR if needed. Would you consider merging it @tcbrindle?

Guekka avatar Jul 19 '24 12:07 Guekka

I honestly forgot this was still open. I'm also happy to address any concerns to get this merged in.

DeveloperPaul123 avatar Jul 19 '24 12:07 DeveloperPaul123

I've finally added a .clang-format config for the project in PR #199. Thanks @DeveloperPaul123 for the initial work on this and @Guekka for reminding me that I should actually do it :)

tcbrindle avatar Aug 15 '24 11:08 tcbrindle

No problem 👍

DeveloperPaul123 avatar Aug 15 '24 11:08 DeveloperPaul123