-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #419 from DrylandEcology/feature_clangtidy
Update SOILWAT2 code base to pass clang-tidy checks - excluded checks, see ".clang-tidy" and ".clang-tidy_swtest" - requires clang-tidy v17 or later - make targets: "tidy-bin" and "tidy-test" - script: "tools/run_tidy.sh"
- Loading branch information
Showing
74 changed files
with
6,186 additions
and
3,697 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
# Checks + accepted suppressions for SOILWAT2 | ||
Checks: > | ||
clang-diagnostic-*, | ||
clang-analyzer-*, | ||
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling, | ||
bugprone-*, | ||
-bugprone-easily-swappable-parameters, | ||
cert-*, | ||
concurrency-*, | ||
-concurrency-mt-unsafe, | ||
cppcoreguidelines-*, | ||
-cppcoreguidelines-avoid-magic-numbers, | ||
-cppcoreguidelines-init-variables, | ||
-cppcoreguidelines-macro-to-enum, | ||
misc-*, | ||
-misc-include-cleaner, | ||
mpi-*, | ||
performance-*, | ||
portability-*, | ||
readability-*, | ||
-readability-function-cognitive-complexity, | ||
-readability-identifier-length, | ||
-readability-magic-numbers | ||
WarningsAsErrors: '*' | ||
HeaderFilterRegex: '' | ||
FormatStyle: none | ||
SystemHeaders: false | ||
CheckOptions: | ||
- key: readability-braces-around-statements.ShortStatementLines | ||
value: '2' | ||
- key: readability-uppercase-literal-suffix.NewSuffixes | ||
value: 'L;LL;LU;LLU' | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
# Checks + accepted suppressions for SOILWAT2 tests | ||
Checks: > | ||
clang-diagnostic-*, | ||
clang-analyzer-*, | ||
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling, | ||
bugprone-*, | ||
-bugprone-easily-swappable-parameters, | ||
cert-*, | ||
concurrency-*, | ||
-concurrency-mt-unsafe, | ||
cppcoreguidelines-*, | ||
-cppcoreguidelines-avoid-c-arrays, | ||
-cppcoreguidelines-avoid-goto, | ||
-cppcoreguidelines-avoid-magic-numbers, | ||
-cppcoreguidelines-init-variables, | ||
-cppcoreguidelines-macro-to-enum, | ||
-cppcoreguidelines-no-malloc, | ||
-cppcoreguidelines-owning-memory, | ||
-cppcoreguidelines-pro-bounds-array-to-pointer-decay, | ||
-cppcoreguidelines-pro-bounds-constant-array-index, | ||
-cppcoreguidelines-pro-bounds-pointer-arithmetic, | ||
-cppcoreguidelines-pro-type-cstyle-cast, | ||
-cppcoreguidelines-pro-type-vararg, | ||
misc-*, | ||
-misc-include-cleaner, | ||
mpi-*, | ||
performance-*, | ||
portability-*, | ||
readability-*, | ||
-readability-function-cognitive-complexity, | ||
-readability-identifier-length, | ||
-readability-magic-numbers | ||
WarningsAsErrors: '*' | ||
HeaderFilterRegex: '' | ||
FormatStyle: none | ||
SystemHeaders: false | ||
CheckOptions: | ||
- key: readability-braces-around-statements.ShortStatementLines | ||
value: '2' | ||
- key: readability-uppercase-literal-suffix.NewSuffixes | ||
value: 'L;LL;LU;LLU' | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: clang-tidy check | ||
|
||
# ubuntu-24.04 comes with clang v18 as default | ||
# ubuntu-latest as of 2024-Aug-01 points to ubuntu-22.04 with clang v14 | ||
|
||
on: | ||
push: | ||
branches: [master, main, release/**] | ||
pull_request: | ||
branches: [master, main, release/**] | ||
|
||
jobs: | ||
formatting-check: | ||
name: Tidy Check | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- name: Checkout repository and submodules | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install netCDF-C and udunits2 | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install libnetcdf-dev libudunits2-dev | ||
- name: Run | ||
run: ./tools/run_tidy.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.