Merge pull request #501 from dtolnay/tidy

Run clang-tidy in CI
This commit is contained in:
David Tolnay 2020-11-23 17:57:12 -08:00 committed by GitHub
commit 74c8ae4280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 0 deletions

18
.clang-tidy Normal file
View File

@ -0,0 +1,18 @@
Checks:
clang-analyzer-*,
clang-diagnostic-*,
cppcoreguidelines-*,
modernize-*,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-type-const-cast,
-cppcoreguidelines-pro-type-member-init,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-special-member-functions,
-modernize-use-default-member-init,
-modernize-use-equals-default,
-modernize-use-override,
-modernize-use-trailing-return-type,
HeaderFilterRegex: cxx\.h

View File

@ -94,3 +94,13 @@ jobs:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@clippy
- run: cargo clippy --workspace --tests -- -Dclippy::all
clang-tidy:
name: Clang Tidy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install clang-tidy
run: sudo apt-get install clang-tidy-10
- name: Run clang-tidy
run: clang-tidy-10 src/cxx.cc --warnings-as-errors=*

1
compile_flags.txt Normal file
View File

@ -0,0 +1 @@
-std=c++11