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:
Jeremy Fleischman
2021-02-11 13:41:14 -08:00
committed by borgmanJeremy
parent f482596c03
commit 5a9ca6bd11
2 changed files with 2 additions and 1 deletions

View File

@@ -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
View File

@@ -0,0 +1,2 @@
DisableFormat: true
SortIncludes: false