From 5a9ca6bd111d15ab083828262169eec951ede775 Mon Sep 17 00:00:00 2001 From: Jeremy Fleischman Date: Thu, 11 Feb 2021 13:41:14 -0800 Subject: [PATCH] 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. --- .github/workflows/clang-format.yml | 1 - external/.clang-format | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 external/.clang-format diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 1ae33975..3e1fe9e2 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -18,7 +18,6 @@ jobs: - uses: DoozyX/clang-format-lint-action@v0.9 with: source: './src' - exclude: './external' extensions: 'h,cpp' clangFormatVersion: 11 style: file diff --git a/external/.clang-format b/external/.clang-format new file mode 100644 index 00000000..9d159247 --- /dev/null +++ b/external/.clang-format @@ -0,0 +1,2 @@ +DisableFormat: true +SortIncludes: false