diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index 679269ebe3..ed8c0bd8a3 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -274,12 +274,12 @@ jobs: git diff ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.base.sha }} | clang-tidy-diff -p 1 -path build -quiet -export-fixes clang_tidy_fixes.yaml -extra-arg='-std=c++20' -clang-tidy-binary run-clang-tidy - name: Run clang-tidy on all files uses: eic/run-cvmfs-osg-eic-shell@main - if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} + if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} with: organization: "${{ env.organization }}" platform-release: "${{ env.platform }}:${{ env.release }}" run: | - run-clang-tidy -p build -export-fixes clang_tidy_fixes.yaml -extra-arg='-std=c++20' + run-clang-tidy -p build -fix -format -export-fixes clang_tidy_fixes.yaml -extra-arg='-std=c++20' - name: Upload clang-tidy fixes as artifact uses: actions/upload-artifact@v7 with: @@ -294,6 +294,27 @@ jobs: clang_tidy_fixes: clang_tidy_fixes.yaml request_changes: true suggestions_per_comment: 10 + - name: Create/Update clang-tidy Pull Request + id: create-clang-tidy-pull-request + uses: peter-evans/create-pull-request@v8 + if: ${{ github.event_name == 'schedule' || ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && startsWith(github.ref, 'refs/heads/')) }} + with: + token: ${{ secrets.EIC_EICRECON_PULL_REQUESTS_READ_WRITE }} + commit-message: "fix: clang-tidy [skip ci]" + branch: clang-tidy-${{ github.ref_name }} + base: ${{ github.ref_name }} + delete-branch: false + add-paths: | + src/** + author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" + title: "fix: clang-tidy for `${{ github.ref_name }}`" + body: | + This PR applies clang-tidy fixes generated by + ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}. + + Auto-generated by [create-pull-request][1] + + [1]: https://github.com/peter-evans/create-pull-request - name: Run include-what-you-use (iwyu) on changed files uses: eic/run-cvmfs-osg-eic-shell@main if: ${{ github.event_name == 'pull_request' }} diff --git a/src/algorithms/calorimetry/CalorimeterHitDigi.cc b/src/algorithms/calorimetry/CalorimeterHitDigi.cc index 94c51e248c..2fdb8a57ad 100644 --- a/src/algorithms/calorimetry/CalorimeterHitDigi.cc +++ b/src/algorithms/calorimetry/CalorimeterHitDigi.cc @@ -127,7 +127,7 @@ void CalorimeterHitDigi::init() { std::map readoutTypes{{"simple", kSimpleReadout}, {"poisson_photon", kPoissonPhotonReadout}, {"sipm", kSipmReadout}}; - if (not readoutTypes.count(m_cfg.readoutType)) { + if (not readoutTypes.contains(m_cfg.readoutType)) { error("Invalid readoutType \"{}\"", m_cfg.readoutType); throw std::runtime_error(fmt::format("Invalid readoutType \"{}\"", m_cfg.readoutType)); }