clang-format-action icon indicating copy to clipboard operation
clang-format-action copied to clipboard

Adds `format-filepath` to customize the filepath of `.clang-format`

Open jr1221 opened this issue 1 year ago • 6 comments

See title.

This allows any file with valid clang format contents to be specified as the filepath.

In my organization this allows a submodule common across multiple C repositories to contain the clang-format, so an update of the submodule updates the styling across the org.

Closes #156

jr1221 avatar Aug 04 '24 15:08 jr1221

Should be ready. I needed to rename the format file not .clang-format so clang doesn't automatically find it and use it implicitly. Please let me know if anything else is needed. Thanks for making a great action!

jr1221 avatar Aug 06 '24 00:08 jr1221

Wow big oversight on my part. The syntax I am using for clang-format style=file: was added in clang 14. I guess there is not much that could be done here short of making the use of the file option conditional and adding a note in the documentation?

I pushed a fix to the CI for the clang 14+ failures.

jr1221 avatar Aug 06 '24 02:08 jr1221

Hey guys, how is this change progressing? This is something we are looking forward to. It would be great if we could get these changes integrated.

emik-dev avatar Sep 20 '24 12:09 emik-dev

Hey - is this PR still being worked on?

mrousavy avatar Nov 04 '24 11:11 mrousavy

Clang format before v14 does not have the filepath setting. Therefore in order to have passing CI behavior and correct operation on lower versions, I must re-arrange the way we test the format filepath setting. Ill work on that in the next week or two.

jr1221 avatar Nov 07 '24 16:11 jr1221

@jidicula I may be backwards here, however I am very confused as to how the current CI detects the test/format_files/.clang_format? I was under the impression the root of the github workspace is used, and clang-format traverses up to find the file? Or does the test suite only make use of the fallback style?

jr1221 avatar Dec 21 '24 02:12 jr1221