feat(clang-tidy): add --fix opt-in flag for auto-applying fixes in place#206
feat(clang-tidy): add --fix opt-in flag for auto-applying fixes in place#206
Conversation
Agent-Logs-Url: https://github.com/cpp-linter/cpp-linter-hooks/sessions/c28acf77-7f8c-44a2-9082-569253e178c9 Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #206 +/- ##
==========================================
+ Coverage 96.64% 96.70% +0.05%
==========================================
Files 4 4
Lines 179 182 +3
==========================================
+ Hits 173 176 +3
Misses 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance
Comparing Footnotes
|
|
@copilot enable autofix_prs to pre-commit.ci by default |
|



The clang-tidy hook only reported issues; unlike clang-format it never modified files. This adds an opt-in
--fixflag that passes-fixto clang-tidy.Changes
clang_tidy.py--fixparser argument; appends-fixto the clang-tidy invocation when setunsafe_parallelguard to cover-fixand-fix-errors(parallel runs risk concurrent writes to shared headers)clang_tidy_args + source_filesinstead of rawother_args, so injected flags are always forwardedtests/test_clang_tidy.py— three new unit tests:--fixappends-fixto the command--fixforces serial execution even with--jobs > 1-fix-errorsin args also forces serial executionREADME.md— documents--fix, notes-fix-errorsas a clang-tidy native alternative, and warns that parallelism is automatically disabled when either flag is activeUsage