cpp-linter 1.12.0__tar.gz → 1.13.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.
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/.gitattributes +1 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/.github/workflows/analyze-workflows.yml +2 -2
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/.github/workflows/labeler.yml +3 -5
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/.github/workflows/release-drafter.yml +1 -5
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/.github/workflows/release.yml +6 -6
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/.github/workflows/tests.yml +15 -12
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/.pre-commit-config.yaml +3 -3
- {cpp_linter-1.12.0/cpp_linter.egg-info → cpp_linter-1.13.0}/PKG-INFO +6 -4
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/README.rst +4 -1
- cpp_linter-1.13.0/cpp_linter/_version.py +24 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter/clang_tools/__init__.py +12 -12
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter/clang_tools/clang_format.py +8 -7
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter/clang_tools/clang_tidy.py +11 -11
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter/clang_tools/patcher.py +9 -9
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter/cli.py +18 -9
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter/common_fs/__init__.py +19 -19
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter/common_fs/file_filter.py +11 -12
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter/git/__init__.py +22 -26
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter/git/git_str.py +7 -7
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter/rest_api/__init__.py +21 -21
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter/rest_api/github_api.py +44 -28
- {cpp_linter-1.12.0 → cpp_linter-1.13.0/cpp_linter.egg-info}/PKG-INFO +6 -4
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter.egg-info/SOURCES.txt +4 -1
- cpp_linter-1.13.0/cpp_linter.egg-info/scm_file_list.json +139 -0
- cpp_linter-1.13.0/cpp_linter.egg-info/scm_version.json +8 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/conf.py +2 -1
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/pyproject.toml +1 -2
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/test_database_path.py +1 -2
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/test_tools_output.py +16 -14
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/comments/test_comments.py +13 -0
- cpp_linter-1.13.0/tests/demo/.clang-tidy +185 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/ignored_paths/test_ignored_paths.py +3 -4
- cpp_linter-1.13.0/tests/reviews/.clang-format +3 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/test_cli_args.py +14 -3
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/test_misc.py +2 -2
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/test_rate_limits.py +1 -2
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/uv.lock +55 -473
- cpp_linter-1.12.0/.github/release-drafter.yml +0 -1
- cpp_linter-1.12.0/cpp_linter/_version.py +0 -34
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/.github/FUNDING.yml +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/.github/dependabot.yml +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/.github/workflows/codeql.yml +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/.github/workflows/docs.yml +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/.github/workflows/pre-commit.yml +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/.github/workflows/stale.yml +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/.github/zizmor.yml +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/.gitignore +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/.readthedocs.yaml +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/CONTRIBUTING.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/LICENSE +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/codecov.yml +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter/__init__.py +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter/loggers.py +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter.egg-info/dependency_links.txt +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter.egg-info/entry_points.txt +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter.egg-info/not-zip-safe +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter.egg-info/requires.txt +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cpp_linter.egg-info/top_level.txt +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/cspell.config.yml +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/API-Reference/cpp_linter.clang_tools.clang_format.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/API-Reference/cpp_linter.clang_tools.clang_tidy.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/API-Reference/cpp_linter.clang_tools.patcher.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/API-Reference/cpp_linter.clang_tools.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/API-Reference/cpp_linter.cli.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/API-Reference/cpp_linter.common_fs.file_filter.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/API-Reference/cpp_linter.common_fs.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/API-Reference/cpp_linter.git.git_str.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/API-Reference/cpp_linter.git.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/API-Reference/cpp_linter.loggers.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/API-Reference/cpp_linter.rest_api.github_api.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/API-Reference/cpp_linter.rest_api.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/API-Reference/cpp_linter.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/_static/extra_css.css +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/_static/favicon.ico +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/_static/logo.png +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/building_docs.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/contributing.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/index.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/permissions.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/docs/pr_review_caveats.rst +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/noxfile.py +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/setup.cfg +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/setup.py +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/.clang-format +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/.clang-tidy +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/opl/opl.c +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/opl/opl_sdl.c +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/pcsound/pcsound.c +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/pcsound/pcsound_sdl.c +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/src/i_musicpack.c +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/src/i_sdlmusic.c +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/src/i_sdlsound.c +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/src/i_sound.c +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/cache/src/net_sdl.c +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/expected-result_0.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/expected-result_1.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/expected-result_2.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83/patch.diff +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d/cache/src/hexen/info.c +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d/cache/src/hexen/p_enemy.c +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d/cache/src/hexen/p_local.h +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d/expected-result_0.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d/expected-result_1.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d/expected-result_2.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d/patch.diff +0 -0
- {cpp_linter-1.12.0/tests/capture_tools_output/shenxianpeng/test-repo → cpp_linter-1.13.0/tests/capture_tools_output/cpp-linter/cpp-linter}/.clang-format +0 -0
- {cpp_linter-1.12.0/tests/demo → cpp_linter-1.13.0/tests/capture_tools_output/cpp-linter/cpp-linter}/.clang-tidy +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/cpp-linter/cpp-linter/950ff0b690e1903797c303c5fc8d9f3b52f1d3c5/cache/tests/demo/demo.cpp +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/cpp-linter/cpp-linter/950ff0b690e1903797c303c5fc8d9f3b52f1d3c5/cache/tests/demo/demo.hpp +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/cpp-linter/cpp-linter/950ff0b690e1903797c303c5fc8d9f3b52f1d3c5/patch.diff +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/cpp-linter/cpp-linter/test_git_lib.patch +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/libvips/libvips/.clang-format +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/libvips/libvips/.clang-tidy +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/libvips/libvips/fe82be345a5b654a76835a7aea5a804bd9ebff0a/expected-result_0.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/libvips/libvips/fe82be345a5b654a76835a7aea5a804bd9ebff0a/expected-result_1.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/libvips/libvips/fe82be345a5b654a76835a7aea5a804bd9ebff0a/expected-result_2.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/libvips/libvips/fe82be345a5b654a76835a7aea5a804bd9ebff0a/patch.diff +0 -0
- {cpp_linter-1.12.0/tests/demo → cpp_linter-1.13.0/tests/capture_tools_output/shenxianpeng/test-repo}/.clang-format +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/shenxianpeng/test-repo/.clang-tidy +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/shenxianpeng/test-repo/662ad4cf90084063ea9c089b8de4aff0b8959d0e/cache/p_enemy.c +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/shenxianpeng/test-repo/662ad4cf90084063ea9c089b8de4aff0b8959d0e/expected-result_0.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/shenxianpeng/test-repo/662ad4cf90084063ea9c089b8de4aff0b8959d0e/expected-result_1.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/shenxianpeng/test-repo/662ad4cf90084063ea9c089b8de4aff0b8959d0e/expected-result_2.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/capture_tools_output/shenxianpeng/test-repo/662ad4cf90084063ea9c089b8de4aff0b8959d0e/patch.diff +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/comments/pr_22.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/comments/pr_comments_pg1.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/comments/pr_comments_pg2.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/comments/push_8d68756375e0483c7ac2b4d6bbbece420dbbb495.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/comments/push_comments_8d68756375e0483c7ac2b4d6bbbece420dbbb495.json +0 -0
- {cpp_linter-1.12.0/tests/reviews → cpp_linter-1.13.0/tests/demo}/.clang-format +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/demo/compile_flags.txt +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/demo/demo.cpp +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/demo/demo.hpp +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/ignored_paths/.gitmodules +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/list_changes/patch.diff +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/list_changes/pull_request_files_pg1.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/list_changes/pull_request_files_pg2.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/list_changes/push_files_pg1.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/list_changes/push_files_pg2.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/list_changes/test_get_file_changes.py +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/reviews/.clang-tidy +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/reviews/pr_27.diff +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/reviews/pr_27.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/reviews/pr_review_comments.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/reviews/pr_reviews.json +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/reviews/test_pr_review.py +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/test_comment_length.py +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/test_git_str.py +0 -0
- {cpp_linter-1.12.0 → cpp_linter-1.13.0}/tests/test_parse_clang_tidy_stdout.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@
|
|
15
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
16
16
|
with:
|
|
17
17
|
persist-credentials: false
|
|
18
18
|
- name: Set up Python
|
|
19
|
-
uses: actions/setup-python@
|
|
19
|
+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
20
20
|
with:
|
|
21
21
|
python-version: '3.x'
|
|
22
22
|
- name: Run zizmor
|
|
@@ -4,14 +4,12 @@ on:
|
|
|
4
4
|
pull_request:
|
|
5
5
|
types: [opened, reopened, synchronize]
|
|
6
6
|
|
|
7
|
+
permissions: {}
|
|
8
|
+
|
|
7
9
|
jobs:
|
|
8
10
|
# Auto label PRs during a PR event
|
|
9
11
|
auto-label:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
12
|
permissions:
|
|
12
13
|
contents: read
|
|
13
14
|
pull-requests: write
|
|
14
|
-
|
|
15
|
-
- uses: release-drafter/release-drafter@6db134d15f3909ccc9eefd369f02bd1e9cffdf97 # v6.2.0
|
|
16
|
-
env:
|
|
17
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
15
|
+
uses: cpp-linter/.github/.github/workflows/pr-labeler.yml@main
|
|
@@ -11,11 +11,7 @@ permissions: {}
|
|
|
11
11
|
jobs:
|
|
12
12
|
# Draft your next Release notes as Pull Requests are merged into the default branch
|
|
13
13
|
draft-release:
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
14
|
permissions:
|
|
16
15
|
contents: write
|
|
17
16
|
pull-requests: read
|
|
18
|
-
|
|
19
|
-
- uses: release-drafter/release-drafter@6db134d15f3909ccc9eefd369f02bd1e9cffdf97 # v6.2.0
|
|
20
|
-
env:
|
|
21
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
17
|
+
uses: cpp-linter/.github/.github/workflows/release-drafter.yml@main
|
|
@@ -20,19 +20,19 @@ jobs:
|
|
|
20
20
|
build:
|
|
21
21
|
runs-on: ubuntu-latest
|
|
22
22
|
steps:
|
|
23
|
-
- uses: actions/checkout@
|
|
23
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
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@
|
|
29
|
+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.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@
|
|
35
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
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@
|
|
48
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
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@
|
|
54
|
+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
55
55
|
with:
|
|
56
56
|
python-version: '3.x'
|
|
57
57
|
- name: Check distributions
|
|
@@ -59,4 +59,4 @@ jobs:
|
|
|
59
59
|
run: pipx run twine check dist/*
|
|
60
60
|
- name: Deploy to PyPI
|
|
61
61
|
if: startsWith(github.ref, 'refs/tags/')
|
|
62
|
-
uses: pypa/gh-action-pypi-publish@
|
|
62
|
+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
|
|
@@ -28,7 +28,7 @@ jobs:
|
|
|
28
28
|
fail-fast: false
|
|
29
29
|
matrix:
|
|
30
30
|
os: ['windows-latest', 'ubuntu-latest']
|
|
31
|
-
version: ['21', '20', '19', '18', '17', '16', '15', '14', '13', '12', '11'
|
|
31
|
+
version: ['22', '21', '20', '19', '18', '17', '16', '15', '14', '13', '12', '11']
|
|
32
32
|
env:
|
|
33
33
|
MAX_PYTHON_VERSION: '3.14'
|
|
34
34
|
# only used when installing for a pre-released python version
|
|
@@ -36,11 +36,11 @@ jobs:
|
|
|
36
36
|
|
|
37
37
|
runs-on: ${{ matrix.os }}
|
|
38
38
|
steps:
|
|
39
|
-
- uses: actions/checkout@
|
|
39
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
40
40
|
with:
|
|
41
41
|
persist-credentials: false
|
|
42
42
|
|
|
43
|
-
- uses: actions/setup-python@
|
|
43
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.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@
|
|
63
|
+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
64
64
|
with:
|
|
65
65
|
enable-cache: true
|
|
66
66
|
cache-dependency-glob: "uv.lock"
|
|
@@ -91,7 +91,7 @@ jobs:
|
|
|
91
91
|
- name: Install clang-tools
|
|
92
92
|
run: |
|
|
93
93
|
python -m pip install clang-tools
|
|
94
|
-
clang-tools
|
|
94
|
+
clang-tools install clang-format clang-tidy --version ${{ matrix.version }}
|
|
95
95
|
|
|
96
96
|
- name: Is clang-only tests?
|
|
97
97
|
id: clang-dep
|
|
@@ -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@
|
|
115
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
116
116
|
with:
|
|
117
117
|
name: coverage-data-${{ runner.os }}-${{ matrix.version }}
|
|
118
118
|
path: .coverage*
|
|
@@ -121,24 +121,27 @@ jobs:
|
|
|
121
121
|
coverage-report:
|
|
122
122
|
needs: [test]
|
|
123
123
|
runs-on: ubuntu-latest
|
|
124
|
+
environment:
|
|
125
|
+
name: test-coverage
|
|
126
|
+
url: https://app.codecov.io/gh/cpp-linter/cpp-linter
|
|
124
127
|
steps:
|
|
125
|
-
- uses: actions/checkout@
|
|
128
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
126
129
|
with:
|
|
127
130
|
persist-credentials: false
|
|
128
131
|
|
|
129
132
|
- name: Download all artifacts
|
|
130
|
-
uses: actions/download-artifact@
|
|
133
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
131
134
|
with:
|
|
132
135
|
pattern: coverage-data-*
|
|
133
136
|
merge-multiple: true
|
|
134
137
|
|
|
135
138
|
- name: Setup python
|
|
136
|
-
uses: actions/setup-python@
|
|
139
|
+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
137
140
|
with:
|
|
138
141
|
python-version: '3.x'
|
|
139
142
|
|
|
140
143
|
- name: Install uv
|
|
141
|
-
uses: astral-sh/setup-uv@
|
|
144
|
+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
142
145
|
with:
|
|
143
146
|
enable-cache: true
|
|
144
147
|
cache-dependency-glob: "uv.lock"
|
|
@@ -147,12 +150,12 @@ jobs:
|
|
|
147
150
|
run: uvx nox -s coverage
|
|
148
151
|
|
|
149
152
|
- name: Upload comprehensive coverage HTML report
|
|
150
|
-
uses: actions/upload-artifact@
|
|
153
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
151
154
|
with:
|
|
152
155
|
name: coverage-report
|
|
153
156
|
path: htmlcov/
|
|
154
157
|
|
|
155
|
-
- uses: codecov/codecov-action@
|
|
158
|
+
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
|
|
156
159
|
env:
|
|
157
160
|
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
|
|
158
161
|
with:
|
|
@@ -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.
|
|
23
|
+
rev: v0.15.9
|
|
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.
|
|
30
|
+
rev: 'v1.20.0'
|
|
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.
|
|
41
|
+
rev: v9.8.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.
|
|
3
|
+
Version: 1.13.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
|
|
@@ -15,14 +15,13 @@ Classifier: Natural Language :: English
|
|
|
15
15
|
Classifier: Operating System :: Microsoft :: Windows
|
|
16
16
|
Classifier: Operating System :: POSIX :: Linux
|
|
17
17
|
Classifier: Operating System :: MacOS
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.10
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
21
|
Classifier: Programming Language :: Python :: 3.13
|
|
23
22
|
Classifier: Programming Language :: Python :: 3.14
|
|
24
23
|
Classifier: Topic :: Software Development :: Build Tools
|
|
25
|
-
Requires-Python: >=3.
|
|
24
|
+
Requires-Python: >=3.10
|
|
26
25
|
Description-Content-Type: text/x-rst
|
|
27
26
|
License-File: LICENSE
|
|
28
27
|
Requires-Dist: pygit2>=1.15.1
|
|
@@ -51,8 +50,11 @@ C/C++ Linting Package
|
|
|
51
50
|
.. |pypi-badge| image:: https://img.shields.io/pypi/dw/cpp-linter?color=dark-green&label=PyPI%20Downloads&logo=python&logoColor=white
|
|
52
51
|
:target: https://pepy.tech/project/cpp-linter
|
|
53
52
|
:alt: PyPI - Downloads
|
|
53
|
+
.. |hub-badge| image:: https://img.shields.io/badge/%F0%9F%8F%A0_cpp--linter_hub-%E2%86%90_home-22863a
|
|
54
|
+
:alt: cpp-linter hub
|
|
55
|
+
:target: https://cpp-linter.github.io/
|
|
54
56
|
|
|
55
|
-
|latest-version| |python-version| |license-badge| |codecov-badge| |doc-badge| |pypi-badge|
|
|
57
|
+
|latest-version| |python-version| |license-badge| |codecov-badge| |doc-badge| |pypi-badge| |hub-badge|
|
|
56
58
|
|
|
57
59
|
A Python package for linting C/C++ code with clang-tidy and/or clang-format to collect feedback provided in the form of thread comments and/or file annotations.
|
|
58
60
|
|
|
@@ -19,8 +19,11 @@ C/C++ Linting Package
|
|
|
19
19
|
.. |pypi-badge| image:: https://img.shields.io/pypi/dw/cpp-linter?color=dark-green&label=PyPI%20Downloads&logo=python&logoColor=white
|
|
20
20
|
:target: https://pepy.tech/project/cpp-linter
|
|
21
21
|
:alt: PyPI - Downloads
|
|
22
|
+
.. |hub-badge| image:: https://img.shields.io/badge/%F0%9F%8F%A0_cpp--linter_hub-%E2%86%90_home-22863a
|
|
23
|
+
:alt: cpp-linter hub
|
|
24
|
+
:target: https://cpp-linter.github.io/
|
|
22
25
|
|
|
23
|
-
|latest-version| |python-version| |license-badge| |codecov-badge| |doc-badge| |pypi-badge|
|
|
26
|
+
|latest-version| |python-version| |license-badge| |codecov-badge| |doc-badge| |pypi-badge| |hub-badge|
|
|
24
27
|
|
|
25
28
|
A Python package for linting C/C++ code with clang-tidy and/or clang-format to collect feedback provided in the form of thread comments and/or file annotations.
|
|
26
29
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '1.13.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 13, 0)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = 'ge8981d1cf'
|
|
@@ -3,7 +3,7 @@ import json
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
import re
|
|
5
5
|
import subprocess
|
|
6
|
-
from typing import
|
|
6
|
+
from typing import cast
|
|
7
7
|
import shutil
|
|
8
8
|
|
|
9
9
|
from ..common_fs import FileObj, FileIOTimeout
|
|
@@ -14,7 +14,7 @@ from .clang_format import run_clang_format, FormatAdvice
|
|
|
14
14
|
from ..cli import Args
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
def assemble_version_exec(tool_name: str, specified_version: str) ->
|
|
17
|
+
def assemble_version_exec(tool_name: str, specified_version: str) -> str | None:
|
|
18
18
|
"""Assembles the command to the executable of the given clang tool based on given
|
|
19
19
|
version information.
|
|
20
20
|
|
|
@@ -37,13 +37,13 @@ def assemble_version_exec(tool_name: str, specified_version: str) -> Optional[st
|
|
|
37
37
|
def _run_on_single_file(
|
|
38
38
|
file: FileObj,
|
|
39
39
|
log_lvl: int,
|
|
40
|
-
tidy_cmd:
|
|
41
|
-
db_json:
|
|
42
|
-
format_cmd:
|
|
43
|
-
format_filter:
|
|
44
|
-
tidy_filter:
|
|
40
|
+
tidy_cmd: str | None,
|
|
41
|
+
db_json: list[dict[str, str]] | None,
|
|
42
|
+
format_cmd: str | None,
|
|
43
|
+
format_filter: FormatFileFilter | None,
|
|
44
|
+
tidy_filter: TidyFileFilter | None,
|
|
45
45
|
args: Args,
|
|
46
|
-
) ->
|
|
46
|
+
) -> tuple[str, str, TidyAdvice | None, FormatAdvice | None]:
|
|
47
47
|
log_stream = worker_log_init(log_lvl)
|
|
48
48
|
filename = Path(file.name).as_posix()
|
|
49
49
|
|
|
@@ -115,11 +115,11 @@ def _capture_tool_version(cmd: str) -> str:
|
|
|
115
115
|
|
|
116
116
|
class ClangVersions:
|
|
117
117
|
def __init__(self) -> None:
|
|
118
|
-
self.tidy:
|
|
119
|
-
self.format:
|
|
118
|
+
self.tidy: str | None = None
|
|
119
|
+
self.format: str | None = None
|
|
120
120
|
|
|
121
121
|
|
|
122
|
-
def capture_clang_tools_output(files:
|
|
122
|
+
def capture_clang_tools_output(files: list[FileObj], args: Args) -> ClangVersions:
|
|
123
123
|
"""Execute and capture all output from clang-tidy and clang-format. This aggregates
|
|
124
124
|
results in the :attr:`~cpp_linter.Globals.OUTPUT`.
|
|
125
125
|
|
|
@@ -150,7 +150,7 @@ def capture_clang_tools_output(files: List[FileObj], args: Args) -> ClangVersion
|
|
|
150
150
|
ignore_value=args.ignore_tidy,
|
|
151
151
|
)
|
|
152
152
|
|
|
153
|
-
db_json:
|
|
153
|
+
db_json: list[dict[str, str]] | None = None
|
|
154
154
|
if args.database:
|
|
155
155
|
db = Path(args.database)
|
|
156
156
|
if not db.is_absolute():
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from pathlib import PurePath
|
|
4
4
|
import subprocess
|
|
5
|
-
from typing import
|
|
5
|
+
from typing import cast
|
|
6
6
|
|
|
7
7
|
import xml.etree.ElementTree as ET
|
|
8
8
|
|
|
@@ -45,7 +45,7 @@ class FormatReplacementLine:
|
|
|
45
45
|
self.line = line_numb
|
|
46
46
|
|
|
47
47
|
#: A list of `FormatReplacement` object(s) representing suggestions.
|
|
48
|
-
self.replacements:
|
|
48
|
+
self.replacements: list[FormatReplacement] = []
|
|
49
49
|
|
|
50
50
|
def __repr__(self):
|
|
51
51
|
return (
|
|
@@ -66,7 +66,7 @@ class FormatAdvice(PatchMixin):
|
|
|
66
66
|
#: The source file that the suggestion concerns.
|
|
67
67
|
self.filename = PurePath(filename).as_posix()
|
|
68
68
|
|
|
69
|
-
self.replaced_lines:
|
|
69
|
+
self.replaced_lines: list[FormatReplacementLine] = []
|
|
70
70
|
"""A list of `FormatReplacementLine` representing replacement(s)
|
|
71
71
|
on a single line."""
|
|
72
72
|
|
|
@@ -85,7 +85,7 @@ class FormatAdvice(PatchMixin):
|
|
|
85
85
|
return "clang-format"
|
|
86
86
|
|
|
87
87
|
|
|
88
|
-
def tally_format_advice(files:
|
|
88
|
+
def tally_format_advice(files: list[FileObj]) -> int:
|
|
89
89
|
"""Returns the sum of clang-format errors"""
|
|
90
90
|
format_checks_failed = 0
|
|
91
91
|
for file_obj in files:
|
|
@@ -126,7 +126,7 @@ def parse_format_replacements_xml(
|
|
|
126
126
|
if not xml_out:
|
|
127
127
|
return format_advice
|
|
128
128
|
ranges = cast(
|
|
129
|
-
|
|
129
|
+
list[list[int]],
|
|
130
130
|
file_obj.range_of_changed_lines(lines_changed_only, get_ranges=True),
|
|
131
131
|
)
|
|
132
132
|
tree = ET.fromstring(xml_out)
|
|
@@ -139,7 +139,8 @@ def parse_format_replacements_xml(
|
|
|
139
139
|
line, cols = get_line_cnt_from_cols(content, offset)
|
|
140
140
|
is_line_in_ranges = False
|
|
141
141
|
for r in ranges:
|
|
142
|
-
|
|
142
|
+
# range() is partially inclusive: [r0, r1)
|
|
143
|
+
if line in range(r[0], r[1] + 1):
|
|
143
144
|
is_line_in_ranges = True
|
|
144
145
|
break
|
|
145
146
|
if is_line_in_ranges or lines_changed_only == 0:
|
|
@@ -183,7 +184,7 @@ def run_clang_format(
|
|
|
183
184
|
"--output-replacements-xml",
|
|
184
185
|
]
|
|
185
186
|
ranges = cast(
|
|
186
|
-
|
|
187
|
+
list[list[int]],
|
|
187
188
|
file_obj.range_of_changed_lines(lines_changed_only, get_ranges=True),
|
|
188
189
|
)
|
|
189
190
|
for span in ranges:
|
|
@@ -5,7 +5,7 @@ import os
|
|
|
5
5
|
from pathlib import Path, PurePath
|
|
6
6
|
import re
|
|
7
7
|
import subprocess
|
|
8
|
-
from typing import
|
|
8
|
+
from typing import cast
|
|
9
9
|
from ..loggers import logger
|
|
10
10
|
from ..common_fs import FileObj
|
|
11
11
|
from .patcher import PatchMixin, ReviewComments, Suggestion
|
|
@@ -30,8 +30,8 @@ class TidyNotification:
|
|
|
30
30
|
|
|
31
31
|
def __init__(
|
|
32
32
|
self,
|
|
33
|
-
notification_line:
|
|
34
|
-
database:
|
|
33
|
+
notification_line: tuple[str, int | str, int | str, str, str, str],
|
|
34
|
+
database: list[dict[str, str]] | None = None,
|
|
35
35
|
):
|
|
36
36
|
# logger.debug("Creating tidy note from line %s", notification_line)
|
|
37
37
|
(
|
|
@@ -78,9 +78,9 @@ class TidyNotification:
|
|
|
78
78
|
#: The source filename concerning the notification.
|
|
79
79
|
self.filename = rel_path
|
|
80
80
|
#: A `list` of lines for the code-block in the notification.
|
|
81
|
-
self.fixit_lines:
|
|
81
|
+
self.fixit_lines: list[str] = []
|
|
82
82
|
#: A list of line numbers where a suggested fix was applied.
|
|
83
|
-
self.applied_fixes:
|
|
83
|
+
self.applied_fixes: set[int] = set()
|
|
84
84
|
|
|
85
85
|
@property
|
|
86
86
|
def diagnostic_link(self) -> str:
|
|
@@ -105,7 +105,7 @@ class TidyNotification:
|
|
|
105
105
|
|
|
106
106
|
|
|
107
107
|
class TidyAdvice(PatchMixin):
|
|
108
|
-
def __init__(self, notes:
|
|
108
|
+
def __init__(self, notes: list[TidyNotification]) -> None:
|
|
109
109
|
#: A buffer of the applied fixes from clang-tidy
|
|
110
110
|
super().__init__()
|
|
111
111
|
self.notes = notes
|
|
@@ -174,7 +174,7 @@ class TidyAdvice(PatchMixin):
|
|
|
174
174
|
review_comments.suggestions.append(suggestion)
|
|
175
175
|
|
|
176
176
|
|
|
177
|
-
def tally_tidy_advice(files:
|
|
177
|
+
def tally_tidy_advice(files: list[FileObj]) -> int:
|
|
178
178
|
"""Returns the sum of clang-format errors"""
|
|
179
179
|
tidy_checks_failed = 0
|
|
180
180
|
for file_obj in files:
|
|
@@ -194,8 +194,8 @@ def run_clang_tidy(
|
|
|
194
194
|
checks: str,
|
|
195
195
|
lines_changed_only: int,
|
|
196
196
|
database: str,
|
|
197
|
-
extra_args:
|
|
198
|
-
db_json:
|
|
197
|
+
extra_args: list[str],
|
|
198
|
+
db_json: list[dict[str, str]] | None,
|
|
199
199
|
tidy_review: bool,
|
|
200
200
|
style: str,
|
|
201
201
|
) -> TidyAdvice:
|
|
@@ -277,7 +277,7 @@ def run_clang_tidy(
|
|
|
277
277
|
|
|
278
278
|
|
|
279
279
|
def parse_tidy_output(
|
|
280
|
-
tidy_out: str, database:
|
|
280
|
+
tidy_out: str, database: list[dict[str, str]] | None
|
|
281
281
|
) -> TidyAdvice:
|
|
282
282
|
"""Parse clang-tidy stdout.
|
|
283
283
|
|
|
@@ -300,7 +300,7 @@ def parse_tidy_output(
|
|
|
300
300
|
if " " not in diagnostic_name and "-" in diagnostic_name:
|
|
301
301
|
notification = TidyNotification(
|
|
302
302
|
cast(
|
|
303
|
-
|
|
303
|
+
tuple[str, int | str, int | str, str, str, str],
|
|
304
304
|
note_match.groups(),
|
|
305
305
|
),
|
|
306
306
|
database,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
by the clang tool's output."""
|
|
3
3
|
|
|
4
4
|
from abc import ABC
|
|
5
|
-
from typing import
|
|
5
|
+
from typing import Any
|
|
6
6
|
from pygit2 import Patch # type: ignore
|
|
7
7
|
from ..common_fs import FileObj
|
|
8
8
|
from pygit2.enums import DiffOption # type: ignore
|
|
@@ -27,7 +27,7 @@ class Suggestion:
|
|
|
27
27
|
#: The markdown comment about the suggestion.
|
|
28
28
|
self.comment: str = ""
|
|
29
29
|
|
|
30
|
-
def serialize_to_github_payload(self) ->
|
|
30
|
+
def serialize_to_github_payload(self) -> dict[str, Any]:
|
|
31
31
|
"""Serialize this object into a JSON compatible with Github's REST API."""
|
|
32
32
|
assert self.line_end > 0, "ending line number unknown"
|
|
33
33
|
from ..rest_api import COMMENT_MARKER # workaround circular import
|
|
@@ -47,9 +47,9 @@ class ReviewComments:
|
|
|
47
47
|
|
|
48
48
|
def __init__(self) -> None:
|
|
49
49
|
#: The list of actual comments
|
|
50
|
-
self.suggestions:
|
|
50
|
+
self.suggestions: list[Suggestion] = []
|
|
51
51
|
|
|
52
|
-
self.tool_total:
|
|
52
|
+
self.tool_total: dict[str, int | None] = {
|
|
53
53
|
"clang-tidy": None,
|
|
54
54
|
"clang-format": None,
|
|
55
55
|
}
|
|
@@ -62,7 +62,7 @@ class ReviewComments:
|
|
|
62
62
|
A `None` value means a review was not requested from the corresponding tool.
|
|
63
63
|
"""
|
|
64
64
|
|
|
65
|
-
self.full_patch:
|
|
65
|
+
self.full_patch: dict[str, str] = {"clang-tidy": "", "clang-format": ""}
|
|
66
66
|
"""The full patch of all the suggestions (including those that will not
|
|
67
67
|
fit within the diff)"""
|
|
68
68
|
|
|
@@ -84,9 +84,9 @@ class ReviewComments:
|
|
|
84
84
|
def serialize_to_github_payload(
|
|
85
85
|
# avoid circular imports by accepting primitive types (instead of ClangVersions)
|
|
86
86
|
self,
|
|
87
|
-
tidy_version:
|
|
88
|
-
format_version:
|
|
89
|
-
) ->
|
|
87
|
+
tidy_version: str | None,
|
|
88
|
+
format_version: str | None,
|
|
89
|
+
) -> tuple[str, list[dict[str, Any]]]:
|
|
90
90
|
"""Serialize this object into a summary and list of comments compatible
|
|
91
91
|
with Github's REST API.
|
|
92
92
|
|
|
@@ -143,7 +143,7 @@ class PatchMixin(ABC):
|
|
|
143
143
|
|
|
144
144
|
def __init__(self) -> None:
|
|
145
145
|
#: A unified diff of the applied fixes from the clang tool's output
|
|
146
|
-
self.patched:
|
|
146
|
+
self.patched: bytes | None = None
|
|
147
147
|
|
|
148
148
|
def get_suggestion_help(self, start, end) -> str:
|
|
149
149
|
"""Create helpful text about what the suggestion aims to fix.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import argparse
|
|
4
4
|
from collections import UserDict
|
|
5
|
-
from typing import
|
|
5
|
+
from typing import Any, Sequence
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class Args(UserDict):
|
|
@@ -14,7 +14,7 @@ class Args(UserDict):
|
|
|
14
14
|
#: See :std:option:`--database`.
|
|
15
15
|
database: str = ""
|
|
16
16
|
#: See :std:option:`--diff-base`.
|
|
17
|
-
diff_base:
|
|
17
|
+
diff_base: int | str | None = None
|
|
18
18
|
#: See :std:option:`--ignore-index`.
|
|
19
19
|
ignore_index: bool = False
|
|
20
20
|
#: See :std:option:`--style`.
|
|
@@ -27,7 +27,7 @@ class Args(UserDict):
|
|
|
27
27
|
#: See :std:option:`--version`.
|
|
28
28
|
version: str = ""
|
|
29
29
|
#: See :std:option:`--extensions`.
|
|
30
|
-
extensions:
|
|
30
|
+
extensions: list[str] = [
|
|
31
31
|
"c",
|
|
32
32
|
"h",
|
|
33
33
|
"C",
|
|
@@ -56,28 +56,30 @@ class Args(UserDict):
|
|
|
56
56
|
#: See :std:option:`--file-annotations`.
|
|
57
57
|
file_annotations: bool = True
|
|
58
58
|
#: See :std:option:`--extra-arg`.
|
|
59
|
-
extra_arg:
|
|
59
|
+
extra_arg: list[str] = []
|
|
60
60
|
#: See :std:option:`--no-lgtm`.
|
|
61
61
|
no_lgtm: bool = True
|
|
62
62
|
#: See :std:option:`files`.
|
|
63
|
-
files:
|
|
63
|
+
files: list[str] = []
|
|
64
64
|
#: See :std:option:`--tidy-review`.
|
|
65
65
|
tidy_review: bool = False
|
|
66
66
|
#: See :std:option:`--format-review`.
|
|
67
67
|
format_review: bool = False
|
|
68
68
|
#: See :std:option:`--jobs`.
|
|
69
|
-
jobs:
|
|
69
|
+
jobs: int | None = 1
|
|
70
70
|
#: See :std:option:`--ignore-tidy`.
|
|
71
71
|
ignore_tidy: str = ""
|
|
72
72
|
#: See :std:option:`--ignore-format`.
|
|
73
73
|
ignore_format: str = ""
|
|
74
74
|
#: See :std:option:`--passive-reviews`.
|
|
75
75
|
passive_reviews: bool = False
|
|
76
|
+
#: See :std:option:`--summary-output-file`.
|
|
77
|
+
summary_output_file: str = ""
|
|
76
78
|
#: A subcommand if provided
|
|
77
|
-
command:
|
|
79
|
+
command: str | None = None
|
|
78
80
|
|
|
79
81
|
|
|
80
|
-
_parser_args:
|
|
82
|
+
_parser_args: dict[Sequence[str], Any] = {}
|
|
81
83
|
_parser_args[("-v", "--verbosity")] = dict(
|
|
82
84
|
type=lambda a: a.lower() in ["debug", "10"],
|
|
83
85
|
default="info",
|
|
@@ -386,9 +388,16 @@ _parser_args[("-R", "--passive-reviews")] = dict(
|
|
|
386
388
|
help="""Set to ``true`` to prevent Pull Request
|
|
387
389
|
reviews from requesting or approving changes.""",
|
|
388
390
|
)
|
|
391
|
+
_parser_args[("-o", "--summary-output-file")] = dict(
|
|
392
|
+
default="",
|
|
393
|
+
help="""Supply a path to which the step summary will be written.
|
|
394
|
+
Leave empty to not write summary to a file.
|
|
395
|
+
Any relative path shall be relative to the
|
|
396
|
+
:std:option:`--repo-root` path.""",
|
|
397
|
+
)
|
|
389
398
|
|
|
390
399
|
|
|
391
|
-
def _parse_jobs(val: str) ->
|
|
400
|
+
def _parse_jobs(val: str) -> int | None:
|
|
392
401
|
try:
|
|
393
402
|
jobs = int(val)
|
|
394
403
|
except ValueError as exc:
|