cmake-pre-commit-hooks 1.9.5__tar.gz → 1.9.6__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 (65) hide show
  1. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/.github/workflows/ci.yml +24 -7
  2. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/.github/workflows/codeql-analysis.yml +4 -4
  3. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/.github/workflows/draft_release.yml +3 -3
  4. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/.github/workflows/format.yml +1 -1
  5. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/.github/workflows/publish_release.yml +2 -2
  6. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/.github/workflows/pull_request.yml +3 -3
  7. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/.pre-commit-config.yaml +7 -7
  8. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/CHANGELOG.md +30 -2
  9. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/PKG-INFO +1 -1
  10. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/_call_process.py +1 -1
  11. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/_cmake.py +103 -26
  12. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/_utils.py +1 -1
  13. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pre_commit_hooks.egg-info/PKG-INFO +2 -2
  14. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/pyproject.toml +7 -6
  15. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/setup.py +1 -1
  16. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/python/_argparse_test.py +2 -2
  17. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/python/_call_process_test.py +2 -2
  18. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/python/_cmake_test.py +2 -2
  19. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/python/_utils_test.py +3 -3
  20. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/python/clang_format_test.py +1 -1
  21. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/python/clang_tidy_test.py +1 -1
  22. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/python/conftest.py +1 -1
  23. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/python/cppcheck_test.py +1 -1
  24. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/python/iwyu_test.py +1 -1
  25. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/python/lizard_test.py +1 -1
  26. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/run_tests.ps1 +1 -1
  27. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/.codespell.allow +0 -0
  28. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/.editorconfig +0 -0
  29. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/.github/dependabot.yml +0 -0
  30. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/.gitignore +0 -0
  31. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/.pre-commit-hooks.yaml +0 -0
  32. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/.sonarcloud.properties +0 -0
  33. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/.yamllint +0 -0
  34. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/LICENSE +0 -0
  35. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/MANIFEST.in +0 -0
  36. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/README.md +0 -0
  37. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/__init__.py +0 -0
  38. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/_argparse.py +0 -0
  39. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/clang_format.py +0 -0
  40. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/clang_tidy.py +0 -0
  41. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/cppcheck.py +0 -0
  42. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/cpplint.py +0 -0
  43. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/include_what_you_use.py +0 -0
  44. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/lizard.py +0 -0
  45. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pre_commit_hooks.egg-info/SOURCES.txt +0 -0
  46. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pre_commit_hooks.egg-info/dependency_links.txt +0 -0
  47. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pre_commit_hooks.egg-info/entry_points.txt +0 -0
  48. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pre_commit_hooks.egg-info/requires.txt +0 -0
  49. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/cmake_pre_commit_hooks.egg-info/top_level.txt +0 -0
  50. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/codecov.yml +0 -0
  51. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/environment.yml +0 -0
  52. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/misc/license_header.txt +0 -0
  53. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/setup.cfg +0 -0
  54. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/sonar-project.properties +0 -0
  55. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/cmake_bad/.pre-commit-config.yaml +0 -0
  56. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/cmake_bad/.pre-commit-win.yaml +0 -0
  57. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/cmake_bad/CMakeLists.txt +0 -0
  58. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/cmake_bad/bad.cpp +0 -0
  59. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/cmake_good/.pre-commit-config.yaml +0 -0
  60. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/cmake_good/.pre-commit-win.yaml +0 -0
  61. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/cmake_good/CMakeLists.txt +0 -0
  62. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/cmake_good/good.cpp +0 -0
  63. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/python/_test_utils.py +0 -0
  64. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/python/cpplint_test.py +0 -0
  65. {cmake_pre_commit_hooks-1.9.5 → cmake_pre_commit_hooks-1.9.6}/tests/run_tests.sh +0 -0
@@ -22,6 +22,14 @@ jobs:
22
22
  - '3.10'
23
23
  - '3.11'
24
24
  - '3.12'
25
+ exclude:
26
+ # macos-latest is now running on M1 macs
27
+ - runs-on: macos-latest
28
+ python: 3.8
29
+ - runs-on: macos-latest
30
+ python: 3.9
31
+ - runs-on: macos-latest
32
+ python: 3.10
25
33
 
26
34
  name: "Unit tests • ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }}"
27
35
  runs-on: ${{ matrix.runs-on }}
@@ -30,7 +38,7 @@ jobs:
30
38
  || (github.event_name == 'pull_request' && github.event.pull_request.merged != true))
31
39
 
32
40
  steps:
33
- - uses: actions/checkout@v3
41
+ - uses: actions/checkout@v4
34
42
 
35
43
  - name: Get history and tags for SCM versioning to work
36
44
  run: |
@@ -38,7 +46,7 @@ jobs:
38
46
  git fetch --depth=1 origin +refs/tags/*:refs/tags/*
39
47
 
40
48
  - name: Setup Python ${{ matrix.python }}
41
- uses: actions/setup-python@v4
49
+ uses: actions/setup-python@v5
42
50
  with:
43
51
  python-version: ${{ matrix.python }}
44
52
  architecture: 'x64'
@@ -55,7 +63,7 @@ jobs:
55
63
  run: python -m pytest -v --cov=cmake_pc_hooks --cov-report=xml --cov-report=term-missing --cov-branch
56
64
 
57
65
  - name: Upload coverage reports to Codecov
58
- uses: codecov/codecov-action@v3
66
+ uses: codecov/codecov-action@v4
59
67
  with:
60
68
  token: ${{ secrets.CODECOV_TOKEN }}
61
69
 
@@ -77,6 +85,15 @@ jobs:
77
85
  - 3.9
78
86
  - '3.10'
79
87
  - '3.11'
88
+ - '3.12'
89
+ exclude:
90
+ # macos-latest is now running on M1 macs
91
+ - runs-on: macos-latest
92
+ python: 3.8
93
+ - runs-on: macos-latest
94
+ python: 3.9
95
+ - runs-on: macos-latest
96
+ python: 3.10
80
97
 
81
98
  name: "System tests ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }}"
82
99
  runs-on: ${{ matrix.runs-on }}
@@ -86,7 +103,7 @@ jobs:
86
103
  || (github.event_name == 'pull_request' && github.event.pull_request.merged != true))
87
104
 
88
105
  steps:
89
- - uses: actions/checkout@v3
106
+ - uses: actions/checkout@v4
90
107
 
91
108
  - name: Get history and tags for SCM versioning to work
92
109
  run: |
@@ -95,10 +112,10 @@ jobs:
95
112
 
96
113
  - name: Enable Developer Command Prompt
97
114
  if: runner.os == 'Windows'
98
- uses: ilammy/msvc-dev-cmd@v1.12.1
115
+ uses: ilammy/msvc-dev-cmd@v1.13.0
99
116
 
100
117
  - name: Setup Python ${{ matrix.python }}
101
- uses: actions/setup-python@v4
118
+ uses: actions/setup-python@v5
102
119
  with:
103
120
  python-version: ${{ matrix.python }}
104
121
  architecture: 'x64'
@@ -170,7 +187,7 @@ jobs:
170
187
  runs-on: ubuntu-latest
171
188
  needs: unit-tests
172
189
  steps:
173
- - uses: actions/checkout@v3
190
+ - uses: actions/checkout@v4
174
191
  with:
175
192
  fetch-depth: 0
176
193
 
@@ -38,11 +38,11 @@ jobs:
38
38
 
39
39
  steps:
40
40
  - name: Checkout repository
41
- uses: actions/checkout@v3
41
+ uses: actions/checkout@v4
42
42
 
43
43
  # Initializes the CodeQL tools for scanning.
44
44
  - name: Initialize CodeQL
45
- uses: github/codeql-action/init@v2
45
+ uses: github/codeql-action/init@v3
46
46
  with:
47
47
  languages: ${{ matrix.language }}
48
48
  # If you wish to specify custom queries, you can do so here or in a config file.
@@ -51,7 +51,7 @@ jobs:
51
51
  # queries: ./path/to/local/query, your-org/your-repo/queries@main
52
52
 
53
53
  - name: Autobuild
54
- uses: github/codeql-action/autobuild@v2
54
+ uses: github/codeql-action/autobuild@v3
55
55
 
56
56
  - name: Perform CodeQL Analysis
57
- uses: github/codeql-action/analyze@v2
57
+ uses: github/codeql-action/analyze@v3
@@ -14,10 +14,10 @@ jobs:
14
14
  name: "Draft a new release"
15
15
  runs-on: ubuntu-latest
16
16
  steps:
17
- - uses: actions/checkout@v3
17
+ - uses: actions/checkout@v4
18
18
 
19
19
  - name: Setup Python
20
- uses: actions/setup-python@v3
20
+ uses: actions/setup-python@v5
21
21
  with:
22
22
  python-version: '3.11'
23
23
  cache: 'pip'
@@ -41,7 +41,7 @@ jobs:
41
41
 
42
42
  # yamllint disable rule:line-length
43
43
  - name: Create pull request
44
- uses: thomaseizinger/create-pull-request@1.3.1
44
+ uses: thomaseizinger/create-pull-request@1.4.0
45
45
  env:
46
46
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47
47
  with:
@@ -18,7 +18,7 @@ jobs:
18
18
  && (startsWith(github.event.pull_request.head.ref, 'release/')
19
19
  || startsWith(github.event.pull_request.head.ref, 'hotfix/'))
20
20
  steps:
21
- - uses: actions/checkout@v3
21
+ - uses: actions/checkout@v4
22
22
  - name: Installing parse-changelog
23
23
  env:
24
24
  target: x86_64-unknown-linux-musl
@@ -23,7 +23,7 @@ jobs:
23
23
  || startsWith(github.event.pull_request.head.ref, 'hotfix/')))
24
24
 
25
25
  steps:
26
- - uses: actions/checkout@v3
26
+ - uses: actions/checkout@v4
27
27
 
28
28
  - name: Get history and tags for SCM versioning to work
29
29
  run: |
@@ -104,7 +104,7 @@ jobs:
104
104
  dist/*
105
105
 
106
106
  - name: Setup Python for Pypi upload
107
- uses: actions/setup-python@v4
107
+ uses: actions/setup-python@v5
108
108
 
109
109
  - name: Publish standard package
110
110
  uses: pypa/gh-action-pypi-publish@release/v1
@@ -13,14 +13,14 @@ jobs:
13
13
  (github.event.pull_request.title == '[pre-commit.ci] pre-commit autoupdate') &&
14
14
  (github.event.action == 'opened')
15
15
  steps:
16
- - uses: actions/checkout@v3
16
+ - uses: actions/checkout@v4
17
17
  with:
18
18
  ref: ${{ github.event.pull_request.head.ref }}
19
19
  fetch-depth: 0
20
20
  token: ${{ secrets.PRE_COMMIT_CI_CHANGELOG }}
21
21
 
22
22
  - name: Setup Python
23
- uses: actions/setup-python@v3
23
+ uses: actions/setup-python@v5
24
24
  with:
25
25
  python-version: '3.11'
26
26
  cache: 'pip'
@@ -48,7 +48,7 @@ jobs:
48
48
  name: CHANGELOG enforcer
49
49
  if: '!cancelled()'
50
50
  steps:
51
- - uses: actions/checkout@v3
51
+ - uses: actions/checkout@v4
52
52
  with:
53
53
  ref: ${{ github.event.pull_request.head.ref }}
54
54
  fetch-depth: 0
@@ -6,7 +6,7 @@ repos:
6
6
  - id: check-useless-excludes
7
7
 
8
8
  - repo: https://github.com/pre-commit/pre-commit-hooks
9
- rev: v4.5.0
9
+ rev: v4.6.0
10
10
  hooks:
11
11
  - id: check-added-large-files
12
12
  - id: check-case-conflict
@@ -20,7 +20,7 @@ repos:
20
20
  - id: trailing-whitespace
21
21
 
22
22
  - repo: https://github.com/Lucas-C/pre-commit-hooks
23
- rev: v1.5.4
23
+ rev: v1.5.5
24
24
  hooks:
25
25
  - id: remove-tabs
26
26
 
@@ -32,21 +32,21 @@ repos:
32
32
  additional_dependencies: [tomli]
33
33
 
34
34
  - repo: https://github.com/codespell-project/codespell
35
- rev: v2.2.6
35
+ rev: v2.3.0
36
36
  hooks:
37
37
  - id: codespell
38
38
  files: .*\.(py|txt|cmake|md|rst|sh|ps1|hpp|tpp|cpp|cc)$
39
39
  args: [-I, .codespell.allow]
40
40
 
41
41
  - repo: https://github.com/shellcheck-py/shellcheck-py
42
- rev: v0.9.0.6
42
+ rev: v0.10.0.1
43
43
  hooks:
44
44
  - id: shellcheck
45
45
  require_serial: false
46
46
  args: [-x, --severity=info]
47
47
 
48
48
  - repo: https://github.com/adrienverge/yamllint.git
49
- rev: v1.33.0
49
+ rev: v1.35.1
50
50
  hooks:
51
51
  - id: yamllint
52
52
 
@@ -58,7 +58,7 @@ repos:
58
58
  additional_dependencies: [black==22.12.0]
59
59
 
60
60
  - repo: https://github.com/astral-sh/ruff-pre-commit
61
- rev: v0.1.8
61
+ rev: v0.4.7
62
62
  hooks:
63
63
  - id: ruff-format
64
64
  name: ruff (format)
@@ -70,6 +70,6 @@ repos:
70
70
  args:
71
71
  - --fix
72
72
  - --exit-non-zero-on-fix
73
- - --show-source
73
+ - --output-format=full
74
74
  - --show-fixes
75
75
  - --preview
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [v1.9.6] - 2024-06-02
11
+
12
+ ### Changed
13
+
14
+ - Apply new linter/formatters
15
+
16
+ ### Fixed
17
+
18
+ - Fixed a bug where a condition always evaluated to `true`
19
+
20
+ ### Repository
21
+
22
+ - Update GitHub Action `action/setup-python` to v5
23
+ - Update GitHub Action `codecov/codecov-action` from v3 to v4
24
+ - Update GitHub Action `ilammy/msvc-dev-cmd` from v1.12.1 to v1.13.0
25
+ - Update GitHub Action `thomaseizinger/create-pull-request` to v1.4.0
26
+ - Update `adrienverge/yamllint` hook to v1.35.1
27
+ - Update `astral-sh/ruff-pre-commit` hook to v0.4.5
28
+ - Update `codespell-project/codespell` hook to v2.3.0
29
+ - Update `Lucas-C/pre-commit-hook` hook to v1.5.5
30
+ - Update `pre-commit/pre-commit-hooks` hook to v4.6.0
31
+ - Update `shellcheck-py/shellcheck-py` hook to v0.10.0
32
+
10
33
  ## [v1.9.5] - 2023-12-15
11
34
 
12
35
  ### Added
@@ -186,7 +209,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
186
209
 
187
210
  ### Repository
188
211
 
189
- - Update `action/setup-python` GitHub Action to v4
212
+ - Update `action/setup-python` GitHub Action to v5
213
+ - Update `action/checkout` GitHub Action to v4
214
+ - Update `github/codeql-action/analyze` GitHub Action to v3
190
215
  - Update `ilammy/msvc-dev-cmd` GitHub Action to v1.12.1
191
216
  - Update `thomaseizinger/create-pull-request` GitHub Action to v1.3.0
192
217
  - Update `Lucas-C/pre-commit-hooks` hook to v1.4.2
@@ -215,6 +240,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
215
240
  ### Repository
216
241
 
217
242
  - Update GitHub's CodeQL action to v2
243
+ - Update `astral-sh/ruff-pre-commit` hook to v0.4.7
218
244
  - Update `pre-commit/pre-commit-hooks` hook to v4.3.0
219
245
  - Update `Lucas-C/pre-commit-hooks` hook to v1.2.0
220
246
  - Update `pre-commit/mirrors-pylint` hook to v3.0.0a5
@@ -241,6 +267,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
241
267
  and release/\_ branches
242
268
  - Update `isort` hook to v5.10.1
243
269
  - Update `black` hook to v21.12b0
270
+ - Disable macOS CI for Python \< 3.11 (now runs on M1 macs on GitHub)
244
271
 
245
272
  ## [v1.5.0] - 2021-11-08
246
273
 
@@ -373,7 +400,7 @@ Initial release with support for:
373
400
  - clang-tidy
374
401
  - cppcheck
375
402
 
376
- [unreleased]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/v1.9.5...HEAD
403
+ [unreleased]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/v1.9.6...HEAD
377
404
  [v1.0.0]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/20b1113bf223273cda31a14a82c9d573a342de4a...v1.0.0
378
405
  [v1.0.1]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/v1.0.0...v1.0.1
379
406
  [v1.1.0]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/v1.0.1...v1.1.0
@@ -396,3 +423,4 @@ Initial release with support for:
396
423
  [v1.9.3]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/v1.9.2...v1.9.3
397
424
  [v1.9.4]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/v1.9.3...v1.9.4
398
425
  [v1.9.5]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/v1.9.4...v1.9.5
426
+ [v1.9.6]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/v1.9.5...v1.9.6
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cmake_pre_commit_hooks
3
- Version: 1.9.5
3
+ Version: 1.9.6
4
4
  Summary: pre-commit hooks for CMake-based projects
5
5
  Author-email: Damien Nguyen <ngn.damien@gmail.com>
6
6
  License: Apache2
@@ -17,7 +17,7 @@
17
17
  from __future__ import annotations
18
18
 
19
19
  import logging
20
- import subprocess as sp
20
+ import subprocess as sp # noqa: S404
21
21
  import sys
22
22
 
23
23
  import attrs
@@ -23,7 +23,7 @@ import os
23
23
  import platform
24
24
  import re
25
25
  import shutil
26
- import subprocess as sp
26
+ import subprocess as sp # noqa: S404
27
27
  import sys
28
28
  from pathlib import Path
29
29
 
@@ -66,9 +66,9 @@ def get_cmake_command(cmake_names=None): # pragma: nocover
66
66
  cmake_names = ['cmake', 'cmake3']
67
67
 
68
68
  for cmake in cmake_names:
69
- cmake_cmd = [shutil.which(cmake)]
70
- if cmake_cmd is not None and _try_calling_cmake(cmake_cmd):
71
- return cmake_cmd
69
+ cmake_cmd = shutil.which(cmake)
70
+ if cmake_cmd is not None and _try_calling_cmake([cmake_cmd]):
71
+ return [cmake_cmd]
72
72
 
73
73
  # CMake not in PATH, should have installed Python CMake module
74
74
  # -> try to find out where it is
@@ -128,7 +128,8 @@ class CMakeCommand:
128
128
  description='Options mirroring those of CMake and that will be passed onto CMake as-is.',
129
129
  )
130
130
  options = parser.add_argument_group(
131
- title='Other CMake related options', description='Options used to configure how CMake is called'
131
+ title='Other CMake related options',
132
+ description='Options used to configure how CMake is called',
132
133
  )
133
134
  platform_specific_cmake = parser.add_argument_group(
134
135
  title='Options to define platform-dependent CMake variables',
@@ -141,7 +142,11 @@ class CMakeCommand:
141
142
 
142
143
  # Custom options
143
144
  options.add_argument('--clean', action='store_true', help='Start from a clean build directory')
144
- options.add_argument('--cmake', type=_argparse.executable_path, help='Specify path to CMake executable.')
145
+ options.add_argument(
146
+ '--cmake',
147
+ type=_argparse.executable_path,
148
+ help='Specify path to CMake executable.',
149
+ )
145
150
  options.add_argument(
146
151
  '--detect-configured-files',
147
152
  action='store_true',
@@ -171,20 +176,40 @@ class CMakeCommand:
171
176
  help='Unix-only (ie. Linux and MacOS) options for CMake',
172
177
  )
173
178
  platform_specific_cmake.add_argument(
174
- '--linux', action=_argparse.OSSpecificAction, type=str, help='Linux-only options for CMake'
179
+ '--linux',
180
+ action=_argparse.OSSpecificAction,
181
+ type=str,
182
+ help='Linux-only options for CMake',
175
183
  )
176
184
  platform_specific_cmake.add_argument(
177
- '--mac', action=_argparse.OSSpecificAction, type=str, help='Mac-only options for CMake'
185
+ '--mac',
186
+ action=_argparse.OSSpecificAction,
187
+ type=str,
188
+ help='Mac-only options for CMake',
178
189
  )
179
190
  platform_specific_cmake.add_argument(
180
- '--win', action=_argparse.OSSpecificAction, type=str, help='Windows-only options for CMake'
191
+ '--win',
192
+ action=_argparse.OSSpecificAction,
193
+ type=str,
194
+ help='Windows-only options for CMake',
181
195
  )
182
196
 
183
197
  # CMake-like options
184
198
  cmake_options.add_argument('-S', '--source-dir', type=str, help='Path to build directory', default='.')
185
- cmake_options.add_argument('-B', '--build-dir', action='append', type=str, help='Path to build directory')
186
199
  cmake_options.add_argument(
187
- '-D', dest='defines', action='append', type=str, help='Create or update a cmake cache entry.', default=[]
200
+ '-B',
201
+ '--build-dir',
202
+ action='append',
203
+ type=str,
204
+ help='Path to build directory',
205
+ )
206
+ cmake_options.add_argument(
207
+ '-D',
208
+ dest='defines',
209
+ action='append',
210
+ type=str,
211
+ help='Create or update a cmake cache entry.',
212
+ default=[],
188
213
  )
189
214
  cmake_options.add_argument(
190
215
  '-U',
@@ -196,11 +221,23 @@ class CMakeCommand:
196
221
  )
197
222
  cmake_options.add_argument('-G', dest='generator', type=str, help='Specify a build system generator.')
198
223
  cmake_options.add_argument(
199
- '-T', dest='toolset', type=str, help='Specify toolset name if supported by generator.'
224
+ '-T',
225
+ dest='toolset',
226
+ type=str,
227
+ help='Specify toolset name if supported by generator.',
200
228
  )
201
- cmake_options.add_argument('-A', dest='platform', type=str, help='Specify platform if supported by generator.')
202
229
  cmake_options.add_argument(
203
- '-Werror', dest='errors', choices=['dev'], help='Make developer warnings errors.', default=[]
230
+ '-A',
231
+ dest='platform',
232
+ type=str,
233
+ help='Specify platform if supported by generator.',
234
+ )
235
+ cmake_options.add_argument(
236
+ '-Werror',
237
+ dest='errors',
238
+ choices=['dev'],
239
+ help='Make developer warnings errors.',
240
+ default=[],
204
241
  )
205
242
  cmake_options.add_argument(
206
243
  '-Wno-error',
@@ -211,9 +248,17 @@ class CMakeCommand:
211
248
  )
212
249
  cmake_options.add_argument('--preset', type=str, help='Specify a configure preset.')
213
250
 
214
- cmake_options.add_argument('-Wdev', dest='dev_warnings', action='store_true', help='Enable developer warnings.')
215
251
  cmake_options.add_argument(
216
- '-Wno-dev', dest='no_dev_warnings', action='store_true', help='Suppress developer warnings.'
252
+ '-Wdev',
253
+ dest='dev_warnings',
254
+ action='store_true',
255
+ help='Enable developer warnings.',
256
+ )
257
+ cmake_options.add_argument(
258
+ '-Wno-dev',
259
+ dest='no_dev_warnings',
260
+ action='store_true',
261
+ help='Suppress developer warnings.',
217
262
  )
218
263
 
219
264
  def resolve_build_directory(self, build_dir_list=None, *, automatic_discovery=True):
@@ -222,7 +267,10 @@ class CMakeCommand:
222
267
  build_dir_list = [] if build_dir_list is None else [Path(path) for path in build_dir_list]
223
268
  for build_dir in build_dir_list:
224
269
  if build_dir.exists() and Path(build_dir, 'CMakeCache.txt').exists():
225
- logging.debug('Located valid build directory with CMakeCache.txt at: %s', str(build_dir))
270
+ logging.debug(
271
+ 'Located valid build directory with CMakeCache.txt at: %s',
272
+ str(build_dir),
273
+ )
226
274
  self.build_dir = build_dir.resolve()
227
275
  return
228
276
 
@@ -243,7 +291,10 @@ class CMakeCommand:
243
291
  self.build_dir = self.source_dir / self.DEFAULT_BUILD_DIR
244
292
  else:
245
293
  self.build_dir = Path(build_dir_list[0]).resolve()
246
- logging.info('Unable to locate a valid build directory. Will be creating one at %s', str(self.build_dir))
294
+ logging.info(
295
+ 'Unable to locate a valid build directory. Will be creating one at %s',
296
+ str(self.build_dir),
297
+ )
247
298
 
248
299
  def setup_cmake_args(self, cmake_args): # noqa: C901
249
300
  """
@@ -272,7 +323,8 @@ class CMakeCommand:
272
323
  self.no_cmake_configure = cmake_args.no_cmake_configure
273
324
 
274
325
  self.resolve_build_directory(
275
- build_dir_list=cmake_args.build_dir, automatic_discovery=cmake_args.automatic_discovery
326
+ build_dir_list=cmake_args.build_dir,
327
+ automatic_discovery=cmake_args.automatic_discovery,
276
328
  )
277
329
 
278
330
  if cmake_args.detect_configured_files and self.build_dir:
@@ -344,13 +396,29 @@ class CMakeCommand:
344
396
  try:
345
397
  with cmake_configure_try_lock.acquire(blocking=False): # noqa: SIM117
346
398
  with cmake_configure_lock.write_lock():
347
- logging.debug('Command %s with id %s is running CMake configure', command, os.getpid())
399
+ logging.debug(
400
+ 'Command %s with id %s is running CMake configure',
401
+ command,
402
+ os.getpid(),
403
+ )
348
404
  returncode = self._configure(
349
- lock_files=(cmake_configure_lock_file, cmake_configure_try_lock_file), clean_build=clean_build
405
+ lock_files=(
406
+ cmake_configure_lock_file,
407
+ cmake_configure_try_lock_file,
408
+ ),
409
+ clean_build=clean_build,
410
+ )
411
+ logging.debug(
412
+ 'Command %s with id %s is done running CMake configure',
413
+ command,
414
+ os.getpid(),
350
415
  )
351
- logging.debug('Command %s with id %s is done running CMake configure', command, os.getpid())
352
416
  except filelock.Timeout:
353
- logging.debug('Command %s with id %s is not running CMake configure and waiting', command, os.getpid())
417
+ logging.debug(
418
+ 'Command %s with id %s is not running CMake configure and waiting',
419
+ command,
420
+ os.getpid(),
421
+ )
354
422
  with cmake_configure_lock.read_lock():
355
423
  logging.debug('Command %s with id %s is done waiting', command, os.getpid())
356
424
  returncode = 0
@@ -368,7 +436,8 @@ class CMakeCommand:
368
436
  extra_args = []
369
437
 
370
438
  result = _call_process.call_process(
371
- [*command, str(self.source_dir), *self.cmake_args, *extra_args], cwd=str(self.build_dir)
439
+ [*command, str(self.source_dir), *self.cmake_args, *extra_args],
440
+ cwd=str(self.build_dir),
372
441
  )
373
442
  result.stdout = '\n'.join([
374
443
  f'Running CMake with: {[*command, str(self.source_dir), *self.cmake_args]}',
@@ -392,7 +461,11 @@ class CMakeCommand:
392
461
 
393
462
  extra_args = []
394
463
  if self.cmake_trace_log:
395
- extra_args.extend(['--trace-expand', '--trace-format=json-v1', f'--trace-redirect={self.cmake_trace_log}'])
464
+ extra_args.extend([
465
+ '--trace-expand',
466
+ '--trace-format=json-v1',
467
+ f'--trace-redirect={self.cmake_trace_log}',
468
+ ])
396
469
 
397
470
  result = self._call_cmake(extra_args=extra_args)
398
471
 
@@ -451,7 +524,11 @@ class CMakeCommand:
451
524
  input_file, configured_file = (Path(arg) for arg in configure_file_call['args'][:2])
452
525
  if not configured_file.is_absolute():
453
526
  configured_file = self.build_dir / configured_file
454
- logging.debug('detected call to configure_file(%s %s [...])', str(input_file), str(configured_file))
527
+ logging.debug(
528
+ 'detected call to configure_file(%s %s [...])',
529
+ str(input_file),
530
+ str(configured_file),
531
+ )
455
532
  self.cmake_configured_files.append(str(configured_file))
456
533
 
457
534
 
@@ -102,7 +102,7 @@ class Command(hooks.utils.Command): # pylint: disable=too-many-instance-attribu
102
102
  self.all_at_once = known_args.all_at_once
103
103
  self.read_json_db = known_args.read_json_db
104
104
  self.clean_build = known_args.clean
105
- self.build_dir_list.extend(known_args.build_dir if known_args.build_dir else [])
105
+ self.build_dir_list.extend(known_args.build_dir or [])
106
106
 
107
107
  if not known_args.build_dir and known_args.preset:
108
108
  raise CMakePresetError
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
- Name: cmake-pre-commit-hooks
3
- Version: 1.9.5
2
+ Name: cmake_pre_commit_hooks
3
+ Version: 1.9.6
4
4
  Summary: pre-commit hooks for CMake-based projects
5
5
  Author-email: Damien Nguyen <ngn.damien@gmail.com>
6
6
  License: Apache2
@@ -68,6 +68,8 @@ namespaces = false
68
68
  line-length = 120
69
69
  target-version = 'py38'
70
70
 
71
+ [tool.ruff.lint]
72
+
71
73
  select = ['F', # pyflakes
72
74
  'E', # pycodestyle
73
75
  'W', # pycodestyle
@@ -148,29 +150,28 @@ indent-style = "space"
148
150
  line-ending = 'lf'
149
151
  skip-magic-trailing-comma = false
150
152
 
151
- [tool.ruff.per-file-ignores]
153
+ [tool.ruff.lint.per-file-ignores]
152
154
 
153
155
  'tests/python/*.py' = ['S101', 'SLF001', 'PLR0913', 'PLR2004', 'D']
154
156
 
155
-
156
- [tool.ruff.flake8-annotations]
157
+ [tool.ruff.lint.flake8-annotations]
157
158
  allow-star-arg-any = true
158
159
  ignore-fully-untyped = true
159
160
  mypy-init-return = true
160
161
  suppress-dummy-args = true
161
162
  suppress-none-returning = true
162
163
 
163
- [tool.ruff.flake8-quotes]
164
+ [tool.ruff.lint.flake8-quotes]
164
165
  docstring-quotes = 'double'
165
166
  inline-quotes = 'single'
166
167
  multiline-quotes = 'single'
167
168
 
168
- [tool.ruff.isort]
169
+ [tool.ruff.lint.isort]
169
170
  combine-as-imports = true
170
171
  section-order = ["future", "standard-library", "first-party", "third-party", "local-folder"]
171
172
  split-on-trailing-comma = false
172
173
 
173
- [tool.ruff.pydocstyle]
174
+ [tool.ruff.lint.pydocstyle]
174
175
  convention = 'google'
175
176
 
176
177
  # ------------------------------------------------------------------------------
@@ -19,7 +19,7 @@ from __future__ import annotations
19
19
  import logging
20
20
  import os
21
21
  import shutil
22
- import subprocess
22
+ import subprocess # noqa: S404
23
23
  import sys
24
24
  from pathlib import Path
25
25
 
@@ -17,10 +17,10 @@ import contextlib
17
17
  import platform
18
18
  from textwrap import dedent
19
19
 
20
- from cmake_pc_hooks import _argparse
20
+ from cmake_pc_hooks import _argparse # noqa: PLC2701
21
21
 
22
22
  import pytest
23
- from _test_utils import ExitError
23
+ from _test_utils import ExitError # noqa: PLC2701
24
24
 
25
25
  # ==============================================================================
26
26
 
@@ -12,9 +12,9 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- import subprocess as sp
15
+ import subprocess as sp # noqa: S404
16
16
 
17
- from cmake_pc_hooks._call_process import History, call_process
17
+ from cmake_pc_hooks._call_process import History, call_process # noqa: PLC2701
18
18
 
19
19
  import pytest
20
20
 
@@ -18,12 +18,12 @@ import sys
18
18
  from pathlib import Path
19
19
  from textwrap import dedent
20
20
 
21
- from cmake_pc_hooks._cmake import CMakeCommand, _try_calling_cmake, get_cmake_command
21
+ from cmake_pc_hooks._cmake import CMakeCommand, _try_calling_cmake, get_cmake_command # noqa: PLC2701
22
22
 
23
23
  import fasteners
24
24
  import filelock
25
25
  import pytest
26
- from _test_utils import ExitError
26
+ from _test_utils import ExitError # noqa: PLC2701
27
27
 
28
28
  # ==============================================================================
29
29
 
@@ -13,11 +13,11 @@
13
13
  # limitations under the License.
14
14
 
15
15
 
16
- from cmake_pc_hooks import _utils
17
- from cmake_pc_hooks._cmake import CMakeCommand
16
+ from cmake_pc_hooks import _utils # noqa: PLC2701
17
+ from cmake_pc_hooks._cmake import CMakeCommand # noqa: PLC2701
18
18
 
19
19
  import pytest
20
- from _test_utils import run_command_default_assertions
20
+ from _test_utils import run_command_default_assertions # noqa: PLC2701
21
21
 
22
22
  # ==============================================================================
23
23
 
@@ -15,7 +15,7 @@
15
15
  from cmake_pc_hooks import clang_format
16
16
 
17
17
  import pytest
18
- from _test_utils import command_main_asserts
18
+ from _test_utils import command_main_asserts # noqa: PLC2701
19
19
 
20
20
  # ==============================================================================
21
21
 
@@ -16,7 +16,7 @@
16
16
  from cmake_pc_hooks import clang_tidy
17
17
 
18
18
  import pytest
19
- from _test_utils import command_main_asserts, run_command_default_assertions
19
+ from _test_utils import command_main_asserts, run_command_default_assertions # noqa: PLC2701
20
20
 
21
21
  # ==============================================================================
22
22
 
@@ -3,7 +3,7 @@ import json
3
3
  from collections import namedtuple
4
4
 
5
5
  import pytest
6
- from _test_utils import ExitError
6
+ from _test_utils import ExitError # noqa: PLC2701
7
7
 
8
8
  # ==============================================================================
9
9
 
@@ -15,7 +15,7 @@
15
15
 
16
16
  from cmake_pc_hooks import cppcheck
17
17
 
18
- from _test_utils import command_main_asserts, run_command_default_assertions
18
+ from _test_utils import command_main_asserts, run_command_default_assertions # noqa: PLC2701
19
19
 
20
20
  # ==============================================================================
21
21
 
@@ -16,7 +16,7 @@
16
16
  from cmake_pc_hooks import include_what_you_use
17
17
 
18
18
  import pytest
19
- from _test_utils import command_main_asserts, run_command_default_assertions
19
+ from _test_utils import command_main_asserts, run_command_default_assertions # noqa: PLC2701
20
20
 
21
21
  # ==============================================================================
22
22
 
@@ -15,7 +15,7 @@
15
15
 
16
16
  from cmake_pc_hooks import lizard
17
17
 
18
- from _test_utils import command_main_asserts, run_command_default_assertions
18
+ from _test_utils import command_main_asserts, run_command_default_assertions # noqa: PLC2701
19
19
 
20
20
  # ==============================================================================
21
21
 
@@ -1,5 +1,5 @@
1
1
  $build_dir = "build"
2
- $CMakeArgs = '-GNinja', '-DCMAKE_C_COMPILER="cl.exe"', '-DCMAKE_CXX_COMPILER="cl.exe"'
2
+ $CMakeArgs = '-GNinja', '-DCMAKE_C_COMPILER=cl.exe', '-DCMAKE_CXX_COMPILER=cl.exe'
3
3
 
4
4
  Set-PSDebug -trace 1
5
5