Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Checks: '
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-modernize-use-nodiscard,
-readability-braces-around-statements,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-magic-numbers,
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/linux-eic-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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' }}
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/calorimetry/CalorimeterHitDigi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void CalorimeterHitDigi::init() {
std::map<std::string, readout_enum> 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));
}
Expand Down
Loading