Skip to content

Commit

Permalink
Update C++ linter settings to speed up cppcheck (#1403)
Browse files Browse the repository at this point in the history
We were previously testing a bunch of invalid preprocessor configurations, which we can now exclude. Installing all the build tools is unnecessary since the linter step runs inside its own Docker container.
  • Loading branch information
yut23 authored Nov 30, 2023
1 parent f104eff commit cebf6af
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/c-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,16 @@ jobs:
if [[ -n "${AMREX_HOME}" ]]; then exit 1; fi
cd ../..
- name: Install dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get -qq -y install curl clang-tidy cmake jq clang cppcheck clang-format bear g++>=9.3.0
- name: Run cpp linter
uses: AMReX-Astro/cpp-linter-action@main
with:
build_path: 'unit_test/test_react'
make_options: '-j 2 USE_OMP=FALSE USE_MPI=FALSE USE_CUDA=FALSE DEBUG=TRUE'
ignore_files: 'amrex'
ignore_files: 'amrex|util/gcem'
header_filter: '(/conductivity/|/constants/|/EOS/|/integration/|/interfaces/|/networks/|/neutrinos/|/nse_solver/|/opacity/|/rates/|/screening/|/util/|^\./).*\.H$'
config_file: ${GITHUB_WORKSPACE}/.clang-tidy
# not sure why cppcheck tests _MSC_VER, since it's only referenced from gcem
cppcheck_options: '-U_OPENMP -UAMREX_USE_GPU -UAMREX_USE_CUDA -UAMREX_USE_HIP -U_MSC_VER'

- name: Archive clang tidy report
uses: actions/upload-artifact@v1
Expand Down

0 comments on commit cebf6af

Please sign in to comment.