cpp-linter 1.11.3__tar.gz → 1.12.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/.github/workflows/analyze-workflows.yml +2 -2
  2. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/.github/workflows/labeler.yml +1 -1
  3. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/.github/workflows/release-drafter.yml +1 -1
  4. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/.github/workflows/release.yml +5 -5
  5. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/.github/workflows/tests.yml +10 -10
  6. cpp_linter-1.12.0/.github/zizmor.yml +8 -0
  7. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/.pre-commit-config.yaml +3 -3
  8. {cpp_linter-1.11.3/cpp_linter.egg-info → cpp_linter-1.12.0}/PKG-INFO +1 -1
  9. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter/__init__.py +4 -0
  10. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter/_version.py +3 -3
  11. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter/clang_tools/clang_format.py +1 -0
  12. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter/clang_tools/clang_tidy.py +21 -12
  13. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter/cli.py +27 -1
  14. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter/common_fs/__init__.py +2 -2
  15. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter/git/__init__.py +30 -12
  16. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter/rest_api/__init__.py +17 -1
  17. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter/rest_api/github_api.py +10 -3
  18. {cpp_linter-1.11.3 → cpp_linter-1.12.0/cpp_linter.egg-info}/PKG-INFO +1 -1
  19. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter.egg-info/SOURCES.txt +2 -0
  20. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cspell.config.yml +4 -0
  21. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/conf.py +1 -0
  22. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/expected-result_0.json +20 -20
  23. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/expected-result_1.json +20 -20
  24. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/expected-result_2.json +20 -20
  25. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d/expected-result_0.json +1 -1
  26. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d/expected-result_1.json +1 -1
  27. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d/expected-result_2.json +1 -1
  28. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/libvips/libvips/fe82be345a5b654a76835a7aea5a804bd9ebff0a/expected-result_0.json +36950 -36950
  29. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/libvips/libvips/fe82be345a5b654a76835a7aea5a804bd9ebff0a/expected-result_1.json +36950 -36950
  30. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/libvips/libvips/fe82be345a5b654a76835a7aea5a804bd9ebff0a/expected-result_2.json +36950 -36950
  31. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/shenxianpeng/test-repo/662ad4cf90084063ea9c089b8de4aff0b8959d0e/expected-result_0.json +1 -1
  32. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/shenxianpeng/test-repo/662ad4cf90084063ea9c089b8de4aff0b8959d0e/expected-result_1.json +1 -1
  33. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/shenxianpeng/test-repo/662ad4cf90084063ea9c089b8de4aff0b8959d0e/expected-result_2.json +1 -1
  34. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/test_tools_output.py +42 -2
  35. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/test_cli_args.py +11 -3
  36. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/test_misc.py +17 -1
  37. cpp_linter-1.12.0/tests/test_parse_clang_tidy_stdout.py +55 -0
  38. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/uv.lock +11 -10
  39. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/.gitattributes +0 -0
  40. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/.github/FUNDING.yml +0 -0
  41. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/.github/dependabot.yml +0 -0
  42. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/.github/release-drafter.yml +0 -0
  43. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/.github/workflows/codeql.yml +0 -0
  44. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/.github/workflows/docs.yml +0 -0
  45. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/.github/workflows/pre-commit.yml +0 -0
  46. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/.github/workflows/stale.yml +0 -0
  47. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/.gitignore +0 -0
  48. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/.readthedocs.yaml +0 -0
  49. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/CONTRIBUTING.rst +0 -0
  50. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/LICENSE +0 -0
  51. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/README.rst +0 -0
  52. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/codecov.yml +0 -0
  53. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter/clang_tools/__init__.py +0 -0
  54. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter/clang_tools/patcher.py +0 -0
  55. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter/common_fs/file_filter.py +0 -0
  56. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter/git/git_str.py +0 -0
  57. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter/loggers.py +0 -0
  58. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter.egg-info/dependency_links.txt +0 -0
  59. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter.egg-info/entry_points.txt +0 -0
  60. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter.egg-info/not-zip-safe +0 -0
  61. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter.egg-info/requires.txt +0 -0
  62. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/cpp_linter.egg-info/top_level.txt +0 -0
  63. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/API-Reference/cpp_linter.clang_tools.clang_format.rst +0 -0
  64. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/API-Reference/cpp_linter.clang_tools.clang_tidy.rst +0 -0
  65. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/API-Reference/cpp_linter.clang_tools.patcher.rst +0 -0
  66. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/API-Reference/cpp_linter.clang_tools.rst +0 -0
  67. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/API-Reference/cpp_linter.cli.rst +0 -0
  68. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/API-Reference/cpp_linter.common_fs.file_filter.rst +0 -0
  69. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/API-Reference/cpp_linter.common_fs.rst +0 -0
  70. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/API-Reference/cpp_linter.git.git_str.rst +0 -0
  71. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/API-Reference/cpp_linter.git.rst +0 -0
  72. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/API-Reference/cpp_linter.loggers.rst +0 -0
  73. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/API-Reference/cpp_linter.rest_api.github_api.rst +0 -0
  74. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/API-Reference/cpp_linter.rest_api.rst +0 -0
  75. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/API-Reference/cpp_linter.rst +0 -0
  76. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/_static/extra_css.css +0 -0
  77. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/_static/favicon.ico +0 -0
  78. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/_static/logo.png +0 -0
  79. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/building_docs.rst +0 -0
  80. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/contributing.rst +0 -0
  81. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/index.rst +0 -0
  82. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/permissions.rst +0 -0
  83. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/docs/pr_review_caveats.rst +0 -0
  84. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/noxfile.py +0 -0
  85. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/pyproject.toml +0 -0
  86. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/setup.cfg +0 -0
  87. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/setup.py +0 -0
  88. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/.clang-format +0 -0
  89. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/.clang-tidy +0 -0
  90. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/opl/opl.c +0 -0
  91. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/opl/opl_sdl.c +0 -0
  92. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/pcsound/pcsound.c +0 -0
  93. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/pcsound/pcsound_sdl.c +0 -0
  94. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/src/i_musicpack.c +0 -0
  95. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/src/i_sdlmusic.c +0 -0
  96. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/src/i_sdlsound.c +0 -0
  97. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/src/i_sound.c +0 -0
  98. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/src/net_sdl.c +0 -0
  99. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/patch.diff +0 -0
  100. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d/cache/src/hexen/info.c +0 -0
  101. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d/cache/src/hexen/p_enemy.c +0 -0
  102. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d/cache/src/hexen/p_local.h +0 -0
  103. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d/patch.diff +0 -0
  104. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/cpp-linter/cpp-linter/950ff0b690e1903797c303c5fc8d9f3b52f1d3c5/cache/tests/demo/demo.cpp +0 -0
  105. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/cpp-linter/cpp-linter/950ff0b690e1903797c303c5fc8d9f3b52f1d3c5/cache/tests/demo/demo.hpp +0 -0
  106. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/cpp-linter/cpp-linter/950ff0b690e1903797c303c5fc8d9f3b52f1d3c5/patch.diff +0 -0
  107. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/cpp-linter/cpp-linter/test_git_lib.patch +0 -0
  108. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/libvips/libvips/.clang-format +0 -0
  109. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/libvips/libvips/.clang-tidy +0 -0
  110. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/libvips/libvips/fe82be345a5b654a76835a7aea5a804bd9ebff0a/patch.diff +0 -0
  111. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/shenxianpeng/test-repo/.clang-format +0 -0
  112. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/shenxianpeng/test-repo/.clang-tidy +0 -0
  113. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/shenxianpeng/test-repo/662ad4cf90084063ea9c089b8de4aff0b8959d0e/cache/p_enemy.c +0 -0
  114. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/shenxianpeng/test-repo/662ad4cf90084063ea9c089b8de4aff0b8959d0e/patch.diff +0 -0
  115. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/capture_tools_output/test_database_path.py +0 -0
  116. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/comments/pr_22.json +0 -0
  117. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/comments/pr_comments_pg1.json +0 -0
  118. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/comments/pr_comments_pg2.json +0 -0
  119. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/comments/push_8d68756375e0483c7ac2b4d6bbbece420dbbb495.json +0 -0
  120. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/comments/push_comments_8d68756375e0483c7ac2b4d6bbbece420dbbb495.json +0 -0
  121. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/comments/test_comments.py +0 -0
  122. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/demo/.clang-format +0 -0
  123. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/demo/.clang-tidy +0 -0
  124. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/demo/compile_flags.txt +0 -0
  125. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/demo/demo.cpp +0 -0
  126. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/demo/demo.hpp +0 -0
  127. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/ignored_paths/.gitmodules +0 -0
  128. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/ignored_paths/test_ignored_paths.py +0 -0
  129. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/list_changes/patch.diff +0 -0
  130. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/list_changes/pull_request_files_pg1.json +0 -0
  131. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/list_changes/pull_request_files_pg2.json +0 -0
  132. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/list_changes/push_files_pg1.json +0 -0
  133. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/list_changes/push_files_pg2.json +0 -0
  134. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/list_changes/test_get_file_changes.py +0 -0
  135. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/reviews/.clang-format +0 -0
  136. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/reviews/.clang-tidy +0 -0
  137. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/reviews/pr_27.diff +0 -0
  138. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/reviews/pr_27.json +0 -0
  139. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/reviews/pr_review_comments.json +0 -0
  140. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/reviews/pr_reviews.json +0 -0
  141. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/reviews/test_pr_review.py +0 -0
  142. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/test_comment_length.py +0 -0
  143. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/test_git_str.py +0 -0
  144. {cpp_linter-1.11.3 → cpp_linter-1.12.0}/tests/test_rate_limits.py +0 -0
@@ -12,11 +12,11 @@ jobs:
12
12
  analyze-ci:
13
13
  runs-on: ubuntu-latest
14
14
  steps:
15
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
15
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16
16
  with:
17
17
  persist-credentials: false
18
18
  - name: Set up Python
19
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
19
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
20
20
  with:
21
21
  python-version: '3.x'
22
22
  - name: Run zizmor
@@ -12,6 +12,6 @@ jobs:
12
12
  contents: read
13
13
  pull-requests: write
14
14
  steps:
15
- - uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
15
+ - uses: release-drafter/release-drafter@6db134d15f3909ccc9eefd369f02bd1e9cffdf97 # v6.2.0
16
16
  env:
17
17
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -16,6 +16,6 @@ jobs:
16
16
  contents: write
17
17
  pull-requests: read
18
18
  steps:
19
- - uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
19
+ - uses: release-drafter/release-drafter@6db134d15f3909ccc9eefd369f02bd1e9cffdf97 # v6.2.0
20
20
  env:
21
21
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -20,19 +20,19 @@ jobs:
20
20
  build:
21
21
  runs-on: ubuntu-latest
22
22
  steps:
23
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24
24
  # use fetch --all for setuptools_scm to work
25
25
  with:
26
26
  fetch-depth: 0
27
27
  persist-credentials: false
28
28
  - name: Set up Python
29
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
29
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
30
30
  with:
31
31
  python-version: '3.x'
32
32
  - name: Build distributions
33
33
  run: pipx run build -o dist
34
34
  - name: Upload builds as artifacts
35
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
35
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
36
36
  with:
37
37
  path: dist
38
38
  name: wheels
@@ -45,13 +45,13 @@ jobs:
45
45
  id-token: write
46
46
  steps:
47
47
  - name: Download distributions
48
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
48
+ uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
49
49
  with:
50
50
  name: wheels
51
51
  path: dist
52
52
  - name: Set up Python
53
53
  if: ${{ !startsWith(github.ref, 'refs/tags/') }}
54
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
54
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
55
55
  with:
56
56
  python-version: '3.x'
57
57
  - name: Check distributions
@@ -36,11 +36,11 @@ jobs:
36
36
 
37
37
  runs-on: ${{ matrix.os }}
38
38
  steps:
39
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
39
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
40
40
  with:
41
41
  persist-credentials: false
42
42
 
43
- - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
43
+ - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
44
44
  with:
45
45
  python-version: 3.x
46
46
 
@@ -60,7 +60,7 @@ jobs:
60
60
  # sudo cmake --install build
61
61
 
62
62
  - name: Install uv
63
- uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
63
+ uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
64
64
  with:
65
65
  enable-cache: true
66
66
  cache-dependency-glob: "uv.lock"
@@ -112,7 +112,7 @@ jobs:
112
112
  run: uvx nox -s test-all -- -m "${PYTEST_ARGS}"
113
113
 
114
114
  - name: Upload coverage data
115
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
115
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
116
116
  with:
117
117
  name: coverage-data-${{ runner.os }}-${{ matrix.version }}
118
118
  path: .coverage*
@@ -122,23 +122,23 @@ jobs:
122
122
  needs: [test]
123
123
  runs-on: ubuntu-latest
124
124
  steps:
125
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
125
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
126
126
  with:
127
127
  persist-credentials: false
128
128
 
129
129
  - name: Download all artifacts
130
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
130
+ uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
131
131
  with:
132
132
  pattern: coverage-data-*
133
133
  merge-multiple: true
134
134
 
135
135
  - name: Setup python
136
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
136
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
137
137
  with:
138
138
  python-version: '3.x'
139
139
 
140
140
  - name: Install uv
141
- uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
141
+ uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
142
142
  with:
143
143
  enable-cache: true
144
144
  cache-dependency-glob: "uv.lock"
@@ -147,12 +147,12 @@ jobs:
147
147
  run: uvx nox -s coverage
148
148
 
149
149
  - name: Upload comprehensive coverage HTML report
150
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
150
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
151
151
  with:
152
152
  name: coverage-report
153
153
  path: htmlcov/
154
154
 
155
- - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
155
+ - uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
156
156
  env:
157
157
  CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
158
158
  with:
@@ -0,0 +1,8 @@
1
+ rules:
2
+ unpinned-uses:
3
+ config:
4
+ policies:
5
+ actions/*: ref-pin
6
+ github/*: ref-pin
7
+ dependabot/*: ref-pin
8
+ cpp-linter/*: any
@@ -20,14 +20,14 @@ repos:
20
20
  args: ["--fix=lf"]
21
21
  - repo: https://github.com/astral-sh/ruff-pre-commit
22
22
  # Ruff version.
23
- rev: v0.13.3
23
+ rev: v0.14.10
24
24
  hooks:
25
25
  # Run the linter.
26
26
  - id: ruff-check
27
27
  # Run the formatter.
28
28
  - id: ruff-format
29
29
  - repo: https://github.com/pre-commit/mirrors-mypy
30
- rev: 'v1.18.2'
30
+ rev: 'v1.19.1'
31
31
  hooks:
32
32
  - id: mypy
33
33
  additional_dependencies:
@@ -38,6 +38,6 @@ repos:
38
38
  - requests-mock
39
39
  - '.'
40
40
  - repo: https://github.com/streetsidesoftware/cspell-cli
41
- rev: v9.2.0
41
+ rev: v9.4.0
42
42
  hooks:
43
43
  - id: cspell
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cpp-linter
3
- Version: 1.11.3
3
+ Version: 1.12.0
4
4
  Summary: Run clang-format and clang-tidy on a batch of files.
5
5
  Author-email: Brendan Doherty <2bndy5@gmail.com>, Xianpeng Shen <xianpeng.shen@gmail.com>
6
6
  License-Expression: MIT
@@ -50,6 +50,8 @@ def main():
50
50
  files = rest_api_client.get_list_of_changed_files(
51
51
  file_filter=global_file_filter,
52
52
  lines_changed_only=args.lines_changed_only,
53
+ diff_base=args.diff_base,
54
+ ignore_index=args.ignore_index,
53
55
  )
54
56
  rest_api_client.verify_files_are_present(files)
55
57
  else:
@@ -61,6 +63,8 @@ def main():
61
63
  git_changes = rest_api_client.get_list_of_changed_files(
62
64
  file_filter=global_file_filter,
63
65
  lines_changed_only=0, # prevent filtering out unchanged files
66
+ diff_base=args.diff_base,
67
+ ignore_index=args.ignore_index,
64
68
  )
65
69
  # merge info from git changes into list of all files
66
70
  for git_file in git_changes:
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '1.11.3'
32
- __version_tuple__ = version_tuple = (1, 11, 3)
31
+ __version__ = version = '1.12.0'
32
+ __version_tuple__ = version_tuple = (1, 12, 0)
33
33
 
34
- __commit_id__ = commit_id = 'gf416f75ac'
34
+ __commit_id__ = commit_id = 'gb3c28b66d'
@@ -187,6 +187,7 @@ def run_clang_format(
187
187
  file_obj.range_of_changed_lines(lines_changed_only, get_ranges=True),
188
188
  )
189
189
  for span in ranges:
190
+ # line range (start and end) is inclusive
190
191
  cmds.append(f"--lines={span[0]}:{span[1]}")
191
192
  cmds.append(PurePath(file_obj.name).as_posix())
192
193
  logger.info('Running "%s"', " ".join(cmds))
@@ -92,7 +92,10 @@ class TidyNotification:
92
92
  check_name_parts = self.diagnostic.split("-", maxsplit=2)
93
93
  assert len(check_name_parts) > 2, "diagnostic name malformed"
94
94
  return link + "clang-analyzer/{}.html)".format(check_name_parts[2])
95
- return link + "{}/{}.html)".format(*self.diagnostic.split("-", maxsplit=1))
95
+ diag_split = self.diagnostic.split("-", maxsplit=1)
96
+ if len(diag_split) < 2 or not all(diag_split):
97
+ return self.diagnostic
98
+ return link + "{}/{}.html)".format(*diag_split)
96
99
 
97
100
  def __repr__(self) -> str:
98
101
  return (
@@ -248,7 +251,8 @@ def run_clang_tidy(
248
251
  extra_args = extra_args[0].split()
249
252
  for extra_arg in extra_args:
250
253
  arg = extra_arg.strip('"')
251
- cmds.append(f"--extra-arg={arg}")
254
+ if arg: # avoid adding empty arg values
255
+ cmds.append(f"--extra-arg={arg}")
252
256
  if tidy_review:
253
257
  # clang-tidy overwrites the file contents when applying fixes.
254
258
  # create a cache of original contents
@@ -289,16 +293,21 @@ def parse_tidy_output(
289
293
  note_match = re.match(NOTE_HEADER, line)
290
294
  fixed_match = re.match(FIXED_NOTE, line)
291
295
  if note_match is not None:
292
- notification = TidyNotification(
293
- cast(
294
- Tuple[str, Union[int, str], Union[int, str], str, str, str],
295
- note_match.groups(),
296
- ),
297
- database,
298
- )
299
- tidy_notes.append(notification)
300
- # begin capturing subsequent lines as part of notification details
301
- found_fix = False
296
+ # Sometimes clang-tidy uses square brackets to enclose additional context
297
+ # about the diagnostic rationale. For example: '[with auto = typename ...]'
298
+ # We need to ignore such cases as they do not start a diagnostic report.
299
+ diagnostic_name = note_match.group(6)
300
+ if " " not in diagnostic_name and "-" in diagnostic_name:
301
+ notification = TidyNotification(
302
+ cast(
303
+ Tuple[str, Union[int, str], Union[int, str], str, str, str],
304
+ note_match.groups(),
305
+ ),
306
+ database,
307
+ )
308
+ tidy_notes.append(notification)
309
+ # begin capturing subsequent lines as part of notification details
310
+ found_fix = False
302
311
  elif fixed_match is not None and notification is not None:
303
312
  notification.applied_fixes.add(int(fixed_match.group(1)))
304
313
  # suspend capturing subsequent lines as they are not needed
@@ -2,7 +2,7 @@
2
2
 
3
3
  import argparse
4
4
  from collections import UserDict
5
- from typing import Optional, List, Dict, Any, Sequence
5
+ from typing import Optional, List, Dict, Any, Sequence, Union
6
6
 
7
7
 
8
8
  class Args(UserDict):
@@ -13,6 +13,10 @@ class Args(UserDict):
13
13
  verbosity: bool = False
14
14
  #: See :std:option:`--database`.
15
15
  database: str = ""
16
+ #: See :std:option:`--diff-base`.
17
+ diff_base: Optional[Union[int, str]] = None
18
+ #: See :std:option:`--ignore-index`.
19
+ ignore_index: bool = False
16
20
  #: See :std:option:`--style`.
17
21
  style: str = "llvm"
18
22
  #: See :std:option:`--tidy-checks`.
@@ -108,6 +112,28 @@ tree.
108
112
  path. Otherwise, cpp-linter will have difficulty
109
113
  parsing clang-tidy output.""",
110
114
  )
115
+ _parser_args[("-b", "--diff-base")] = dict(
116
+ default=None,
117
+ type=lambda input: int(input) if input.isdigit() else str(input),
118
+ help="""The specific commit or git revision to use
119
+ as the base for any git diffs. For example, may be ``HEAD~5``
120
+ for the last five commits, or a branch name for the history
121
+ diff since the common ancestor. If given as an integer, n, it
122
+ will be treated as ``HEAD~n``. When not set, diff behavior
123
+ depends on the presence of staged files. This option only
124
+ applies to contexts in which GitHub CI is not present/used.
125
+
126
+ Defaults to ``%(default)s``""",
127
+ )
128
+ _parser_args[("--ignore-index",)] = dict(
129
+ default=False,
130
+ action="store_true",
131
+ help="""Enabling this switch will ignore
132
+ any staged files in the index when producing a diff.
133
+ Useful when used with :std:option:`--diff-base`.
134
+
135
+ Defaults to ``%(default)s``""",
136
+ )
111
137
  _parser_args[("-s", "--style")] = dict(
112
138
  default="llvm",
113
139
  help="""The style rules to use.
@@ -67,10 +67,10 @@ class FileObj:
67
67
  if not i:
68
68
  result.append([n])
69
69
  elif n - 1 != numbers[i - 1]:
70
- result[-1].append(numbers[i - 1] + 1)
70
+ result[-1].append(numbers[i - 1])
71
71
  result.append([n])
72
72
  if i == len(numbers) - 1:
73
- result[-1].append(n + 1)
73
+ result[-1].append(n)
74
74
  return result
75
75
 
76
76
  def range_of_changed_lines(
@@ -26,8 +26,8 @@ from ..loggers import logger
26
26
  from .git_str import parse_diff as legacy_parse_diff
27
27
 
28
28
 
29
- def get_sha(repo: Repository, parent: Optional[int] = None) -> GitObject:
30
- """Uses ``git`` to fetch the full SHA hash of the current commit.
29
+ def get_sha(repo: Repository, parent: Optional[Union[int, str]] = None) -> GitObject:
30
+ """Uses ``git`` to fetch the full SHA hash of a commit.
31
31
 
32
32
  .. note::
33
33
  This function is only used in local development environments, not in a
@@ -36,10 +36,15 @@ def get_sha(repo: Repository, parent: Optional[int] = None) -> GitObject:
36
36
  :param repo: The object representing the git repository.
37
37
  :param parent: This parameter's default value will fetch the SHA of the last commit.
38
38
  Set this parameter to the number of parent commits from the current tree's HEAD
39
- to get the desired commit's SHA hash instead.
40
- :returns: A `str` representing the commit's SHA hash.
39
+ or a valid git revision to get the desired commit's SHA hash instead.
40
+ :returns: A `pygit2.Object` representing the resolved commit.
41
41
  """
42
- return repo.revparse_single("HEAD" + (f"~{parent}" if parent is not None else ""))
42
+ head = "HEAD"
43
+ if isinstance(parent, str):
44
+ head = parent
45
+ if isinstance(parent, int):
46
+ head += f"~{parent}"
47
+ return repo.revparse_single(head)
43
48
 
44
49
 
45
50
  STAGED_STATUS = (
@@ -49,11 +54,18 @@ STAGED_STATUS = (
49
54
  )
50
55
 
51
56
 
52
- def get_diff(parents: int = 1) -> Diff:
57
+ def get_diff(
58
+ parents: Optional[Union[int, str]] = None, ignore_index: bool = False
59
+ ) -> Diff:
53
60
  """Retrieve the diff info about a specified commit.
54
61
 
55
- :param parents: The number of parent commits related to the current commit.
56
- :returns: A `str` of the fetched diff.
62
+ :param parents: The commit or ref to use as the base of the diff.
63
+ If set to None, and there are staged changes to be used, then it will be HEAD and
64
+ the diff will consist of just the staged changes. If there are no staged changes or
65
+ the index is ignored, it will be HEAD~1.
66
+ :param ignore_index: Setting this flag to ``true`` will ignore any staged files
67
+ in the index when producing a diff.
68
+ :returns: A `pygit2.Diff` object representing the fetched diff.
57
69
  """
58
70
  repo = Repository(".")
59
71
  head = get_sha(repo)
@@ -64,12 +76,18 @@ def get_diff(parents: int = 1) -> Diff:
64
76
  has_staged_files = True
65
77
  break
66
78
 
67
- if has_staged_files:
79
+ use_index = not ignore_index and has_staged_files
80
+
81
+ if not use_index and parents is None:
82
+ parents = 1
83
+
84
+ base = get_sha(repo, parents)
85
+
86
+ if use_index:
68
87
  index = repo.index
69
- diff_obj = index.diff_to_tree(cast(Commit, head).tree)
70
- diff_name = f"HEAD...{head.short_id}"
88
+ diff_obj = index.diff_to_tree(cast(Commit, base).tree)
89
+ diff_name = f"HEAD...{base.short_id}"
71
90
  else:
72
- base = get_sha(repo, parents) # only concerned with latest commit's diff
73
91
  diff_obj = repo.diff(base, head)
74
92
  diff_name = f"{head.short_id}...{base.short_id}"
75
93
 
@@ -6,7 +6,7 @@ from abc import ABC
6
6
  from pathlib import PurePath
7
7
  import sys
8
8
  import time
9
- from typing import Optional, Dict, List, Any, cast, NamedTuple
9
+ from typing import Optional, Dict, List, Any, cast, NamedTuple, Union
10
10
  import requests
11
11
  from ..common_fs import FileObj
12
12
  from ..common_fs.file_filter import FileFilter
@@ -161,11 +161,27 @@ class RestApiClient(ABC):
161
161
  self,
162
162
  file_filter: FileFilter,
163
163
  lines_changed_only: int,
164
+ diff_base: Optional[Union[int, str]] = None,
165
+ ignore_index: bool = False,
164
166
  ) -> List[FileObj]:
165
167
  """Fetch a list of the event's changed files.
166
168
 
167
169
  :param file_filter: A `FileFilter` obj to filter files.
168
170
  :param lines_changed_only: A value that dictates what file changes to focus on.
171
+ :param diff_base: The commit or ref to use as the base of the diff.
172
+
173
+ .. csv-table::
174
+ :header-rows: 1
175
+
176
+ "Parameter Value", "Git index state", "Scope of diff"
177
+ "`None` (the default)", "No staged changes", "``HEAD~1..HEAD``"
178
+ "`None` (the default)", "Has staged changes", "``HEAD..index``"
179
+ "`int` (eg ``2``) or `str` (eg ``HEAD~2``)", "No staged changes", "``HEAD~2..HEAD``"
180
+ "`int` (eg ``2``) or `str` (eg ``HEAD~2``)", "Has staged changes", "``HEAD~2..index``"
181
+
182
+ Use ``ignore_index`` parameter to exclude the staged changes in the local index.
183
+ :param ignore_index: Setting this flag to `True` will ignore any staged changes
184
+ in the index when producing a diff.
169
185
  """
170
186
  raise NotImplementedError("must be implemented in the derivative")
171
187
 
@@ -15,7 +15,7 @@ from os import environ
15
15
  from pathlib import Path
16
16
  import urllib.parse
17
17
  import sys
18
- from typing import Dict, List, Any, cast, Optional
18
+ from typing import Dict, List, Any, cast, Optional, Union
19
19
 
20
20
  from ..common_fs import FileObj, CACHE_PATH
21
21
  from ..common_fs.file_filter import FileFilter
@@ -57,7 +57,10 @@ class GithubApiClient(RestApiClient):
57
57
  #: The HEAD commit's SHA
58
58
  self.sha = environ.get("GITHUB_SHA", "")
59
59
  #: A flag that describes if debug logs are enabled.
60
- self.debug_enabled = environ.get("ACTIONS_STEP_DEBUG", "") == "true"
60
+ self.debug_enabled = (
61
+ environ.get("ACTIONS_STEP_DEBUG", "") == "true"
62
+ or environ.get("ACTIONS_RUNNER_DEBUG", "") == "true"
63
+ )
61
64
 
62
65
  #: The pull request number for the event (if applicable).
63
66
  self.pull_request = -1
@@ -89,6 +92,8 @@ class GithubApiClient(RestApiClient):
89
92
  self,
90
93
  file_filter: FileFilter,
91
94
  lines_changed_only: int,
95
+ diff_base: Optional[Union[int, str]] = None,
96
+ ignore_index: bool = False,
92
97
  ) -> List[FileObj]:
93
98
  if environ.get("CI", "false") == "true":
94
99
  files_link = f"{self.api_url}/repos/{self.repo}/"
@@ -111,7 +116,9 @@ class GithubApiClient(RestApiClient):
111
116
  files_link, lines_changed_only, file_filter
112
117
  )
113
118
  return parse_diff(response.text, file_filter, lines_changed_only)
114
- return parse_diff(get_diff(), file_filter, lines_changed_only)
119
+ return parse_diff(
120
+ get_diff(diff_base, ignore_index), file_filter, lines_changed_only
121
+ )
115
122
 
116
123
  def _get_changed_files_paginated(
117
124
  self, url: Optional[str], lines_changed_only: int, file_filter: FileFilter
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cpp-linter
3
- Version: 1.11.3
3
+ Version: 1.12.0
4
4
  Summary: Run clang-format and clang-tidy on a batch of files.
5
5
  Author-email: Brendan Doherty <2bndy5@gmail.com>, Xianpeng Shen <xianpeng.shen@gmail.com>
6
6
  License-Expression: MIT
@@ -14,6 +14,7 @@ uv.lock
14
14
  .github/FUNDING.yml
15
15
  .github/dependabot.yml
16
16
  .github/release-drafter.yml
17
+ .github/zizmor.yml
17
18
  .github/workflows/analyze-workflows.yml
18
19
  .github/workflows/codeql.yml
19
20
  .github/workflows/docs.yml
@@ -70,6 +71,7 @@ tests/test_cli_args.py
70
71
  tests/test_comment_length.py
71
72
  tests/test_git_str.py
72
73
  tests/test_misc.py
74
+ tests/test_parse_clang_tidy_stdout.py
73
75
  tests/test_rate_limits.py
74
76
  tests/capture_tools_output/test_database_path.py
75
77
  tests/capture_tools_output/test_tools_output.py
@@ -14,6 +14,7 @@ words:
14
14
  - consts
15
15
  - cppcoreguidelines
16
16
  - cstdio
17
+ - declval
17
18
  - docutils
18
19
  - endgroup
19
20
  - Fixit
@@ -49,9 +50,12 @@ words:
49
50
  - tofile
50
51
  - tomli
51
52
  - undoc
53
+ - urllib
52
54
  - vararg
53
55
  - venv
54
56
  - viewcode
57
+ - virtualenv
58
+ - zizmor
55
59
  ignorePaths:
56
60
  - .env/**
57
61
  - .venv/**
@@ -238,6 +238,7 @@ REQUIRED_VERSIONS = {
238
238
  "1.8.1": ["jobs"],
239
239
  "1.9.0": ["ignore_tidy", "ignore_format"],
240
240
  "1.10.0": ["passive_reviews"],
241
+ "1.12.0": ["diff_base", "ignore_index"],
241
242
  }
242
243
  SUBCOMMAND_VERSIONS = {"version": "1.11.0"}
243
244