Exclude the external directory with a .clang-format file.
(I copied this trick from https://stackoverflow.com/a/57272592/1739415) The GitHub clang-format workflow was already ignoring the `external` directory because of the setting in the `clang-format.yml` file, but that doesn't help other people running `clang-format` by hand (which the CONTRIBUTING.md file instructs developers to do). Without this change, I'd see a bunch of changes appear in the `external/spdlog` every time I ran clang-format by hand. I figure it's better to configure this via files that clang knows about so both the GitHub workflow *and* developers have a closer to identical experience.
This commit is contained in:
committed by
borgmanJeremy
parent
f482596c03
commit
5a9ca6bd11
1
.github/workflows/clang-format.yml
vendored
1
.github/workflows/clang-format.yml
vendored
@@ -18,7 +18,6 @@ jobs:
|
|||||||
- uses: DoozyX/clang-format-lint-action@v0.9
|
- uses: DoozyX/clang-format-lint-action@v0.9
|
||||||
with:
|
with:
|
||||||
source: './src'
|
source: './src'
|
||||||
exclude: './external'
|
|
||||||
extensions: 'h,cpp'
|
extensions: 'h,cpp'
|
||||||
clangFormatVersion: 11
|
clangFormatVersion: 11
|
||||||
style: file
|
style: file
|
||||||
|
|||||||
2
external/.clang-format
vendored
Normal file
2
external/.clang-format
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
DisableFormat: true
|
||||||
|
SortIncludes: false
|
||||||
Reference in New Issue
Block a user