Skip to content

Resolve clang-tidy-fix issues, separate header guard check/fix#363

Merged
greenc-FNAL merged 3 commits intomainfrom
maintenance/clang-tidy-fix-fixes
Feb 27, 2026
Merged

Resolve clang-tidy-fix issues, separate header guard check/fix#363
greenc-FNAL merged 3 commits intomainfrom
maintenance/clang-tidy-fix-fixes

Conversation

@greenc-FNAL
Copy link
Contributor

@greenc-FNAL greenc-FNAL commented Feb 25, 2026

Add Python script to check and fix header guards according
to the project's naming convention (X_Y_HEADER_EXT format).

Add GitHub Actions workflows for automated header guard
checking and fixing via bot commands. The check workflow
runs on PRs with header file changes and reports violations.
The fix workflow can be triggered via bot comment to
automatically correct guards.

Improve clang-tidy workflow to reuse existing fixes from
previous runs when possible, avoiding redundant analysis.
Add artifact downloading from both check and fix workflows
to apply cached fixes. Separate fix generation from
application for better control.

Update handle-fix-commit action to guard PR-specific steps
with pull request number checks, preventing failures when
running outside PR context.

Remove CreateClangTidyTargets.cmake module as clang-tidy
integration now uses CMAKE_CXX_CLANG_TIDY directly. Update
CMakeLists.txt to report clang-tidy availability without
creating custom targets.

Disable llvm-header-guard check in .clang-tidy since the
new script enforces project-specific conventions.

Upgrade actions/upload-artifact from v5 to v6 in
handle-fix-commit action.

@codecov
Copy link

codecov bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main     #363      +/-   ##
==========================================
- Coverage   85.32%   85.20%   -0.13%     
==========================================
  Files         122      122              
  Lines        2433     2433              
  Branches      389      389              
==========================================
- Hits         2076     2073       -3     
- Misses        232      233       +1     
- Partials      125      127       +2     
Flag Coverage Δ
unittests 85.20% <ø> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fe15eb2...2b99cb9. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@greenc-FNAL
Copy link
Contributor Author

@phlexbot python-fix

@github-actions
Copy link
Contributor

Automatic ruff fixes pushed (commit c71766a).
⚠️ Note: Some issues may require manual review and fixing.

@greenc-FNAL greenc-FNAL changed the title clang-tidy-* workflow improvements [WIP] clang-tidy-* workflow improvements Feb 25, 2026
@greenc-FNAL greenc-FNAL force-pushed the maintenance/clang-tidy-fix-fixes branch 2 times, most recently from 1bd3a37 to 9374e8b Compare February 26, 2026 21:00
@greenc-FNAL
Copy link
Contributor Author

@phlexbot python-fix

@github-actions
Copy link
Contributor

Automatic ruff fixes pushed (commit e98ff12).
⚠️ Note: Some issues may require manual review and fixing.

@greenc-FNAL
Copy link
Contributor Author

Review the full CodeQL report for details.

@greenc-FNAL greenc-FNAL force-pushed the maintenance/clang-tidy-fix-fixes branch 2 times, most recently from 26856de to 095002b Compare February 26, 2026 21:15
@greenc-FNAL greenc-FNAL changed the title [WIP] clang-tidy-* workflow improvements Resolve clang-tidy-fix issues, separate header guard check/fix Feb 26, 2026
@greenc-FNAL greenc-FNAL force-pushed the maintenance/clang-tidy-fix-fixes branch from 095002b to 5b3fbcc Compare February 26, 2026 21:37
Add Python script to check and fix header guards according
to the project's naming convention (`X_Y_HEADER_EXT` format).

Add GitHub Actions workflows for automated header guard
checking and fixing via bot commands. The check workflow
runs on PRs with header file changes and reports violations.
The fix workflow can be triggered via bot comment to
automatically correct guards.

Improve clang-tidy workflow to reuse existing fixes from
previous runs when possible, avoiding redundant analysis.
Add artifact downloading from both check and fix workflows
to apply cached fixes. Separate fix generation from
application for better control.

Update `handle-fix-commit` action to guard PR-specific steps
with pull request number checks, preventing failures when
running outside PR context.

Remove `CreateClangTidyTargets.cmake` module as clang-tidy
integration now uses `CMAKE_CXX_CLANG_TIDY` directly. Update
`CMakeLists.txt` to report clang-tidy availability without
creating custom targets.

Disable `llvm-header-guard` check in `.clang-tidy` since the
new script enforces project-specific conventions.

Upgrade `actions/upload-artifact` from v5 to v6 in
`handle-fix-commit` action.
@greenc-FNAL greenc-FNAL force-pushed the maintenance/clang-tidy-fix-fixes branch from b5acb2a to 2b99cb9 Compare February 27, 2026 15:33
@greenc-FNAL greenc-FNAL merged commit f1dd203 into main Feb 27, 2026
57 checks passed
@knoepfel knoepfel deleted the maintenance/clang-tidy-fix-fixes branch February 27, 2026 15:53
greenc-FNAL added a commit that referenced this pull request Feb 27, 2026
- `&& github.event.pull_request.number` was added in #363 to prevent
  attempts to comment on a non-PR.
- However, it failed to take account of when the pull request came from
  elsewhere (e.g. in the case of an issue comment).
- It was anyway unnecessary because the external comment action handles
  all cases correctly, including when there is no PR to comment upon.
greenc-FNAL added a commit that referenced this pull request Feb 27, 2026
- `&& github.event.pull_request.number` was added in #363 to prevent
  attempts to comment on a non-PR.
- However, it failed to take account of when the pull request came from
  elsewhere (e.g. in the case of an issue comment).
- It was anyway unnecessary because the external comment action handles
  all cases correctly, including when there is no PR to comment upon.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants