cmake-pre-commit-hooks 1.9.4__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 (67) hide show
  1. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/.github/workflows/ci.yml +27 -9
  2. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/.github/workflows/codeql-analysis.yml +4 -4
  3. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/.github/workflows/draft_release.yml +4 -4
  4. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/.github/workflows/format.yml +1 -1
  5. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/.github/workflows/publish_release.yml +2 -2
  6. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/.github/workflows/pull_request.yml +4 -4
  7. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/.pre-commit-config.yaml +18 -13
  8. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/CHANGELOG.md +50 -3
  9. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/MANIFEST.in +0 -1
  10. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/PKG-INFO +11 -5
  11. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/_argparse.py +54 -17
  12. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/_call_process.py +1 -1
  13. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/_cmake.py +159 -71
  14. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/_utils.py +12 -4
  15. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/clang_tidy.py +1 -1
  16. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/cppcheck.py +3 -3
  17. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/include_what_you_use.py +5 -3
  18. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pre_commit_hooks.egg-info/PKG-INFO +12 -6
  19. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pre_commit_hooks.egg-info/SOURCES.txt +0 -1
  20. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pre_commit_hooks.egg-info/requires.txt +3 -0
  21. cmake_pre_commit_hooks-1.9.6/pyproject.toml +224 -0
  22. cmake_pre_commit_hooks-1.9.6/setup.cfg +4 -0
  23. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/setup.py +29 -15
  24. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/python/_argparse_test.py +15 -14
  25. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/python/_call_process_test.py +3 -3
  26. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/python/_cmake_test.py +18 -9
  27. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/python/_test_utils.py +2 -1
  28. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/python/_utils_test.py +5 -5
  29. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/python/clang_format_test.py +4 -6
  30. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/python/clang_tidy_test.py +3 -3
  31. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/python/conftest.py +6 -8
  32. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/python/cppcheck_test.py +2 -2
  33. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/python/iwyu_test.py +3 -3
  34. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/python/lizard_test.py +2 -2
  35. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/run_tests.ps1 +1 -1
  36. cmake_pre_commit_hooks-1.9.4/pyproject.toml +0 -154
  37. cmake_pre_commit_hooks-1.9.4/setup.cfg +0 -66
  38. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/.codespell.allow +0 -0
  39. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/.editorconfig +0 -0
  40. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/.github/dependabot.yml +0 -0
  41. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/.gitignore +0 -0
  42. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/.pre-commit-hooks.yaml +0 -0
  43. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/.sonarcloud.properties +0 -0
  44. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/.yamllint +0 -0
  45. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/LICENSE +0 -0
  46. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/README.md +0 -0
  47. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/__init__.py +0 -0
  48. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/clang_format.py +0 -0
  49. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/cpplint.py +0 -0
  50. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pc_hooks/lizard.py +0 -0
  51. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pre_commit_hooks.egg-info/dependency_links.txt +0 -0
  52. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pre_commit_hooks.egg-info/entry_points.txt +0 -0
  53. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/cmake_pre_commit_hooks.egg-info/top_level.txt +0 -0
  54. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/codecov.yml +0 -0
  55. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/environment.yml +0 -0
  56. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/misc/license_header.txt +0 -0
  57. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/sonar-project.properties +0 -0
  58. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/cmake_bad/.pre-commit-config.yaml +0 -0
  59. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/cmake_bad/.pre-commit-win.yaml +0 -0
  60. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/cmake_bad/CMakeLists.txt +0 -0
  61. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/cmake_bad/bad.cpp +0 -0
  62. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/cmake_good/.pre-commit-config.yaml +0 -0
  63. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/cmake_good/.pre-commit-win.yaml +0 -0
  64. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/cmake_good/CMakeLists.txt +0 -0
  65. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/cmake_good/good.cpp +0 -0
  66. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/python/cpplint_test.py +0 -0
  67. {cmake_pre_commit_hooks-1.9.4 → cmake_pre_commit_hooks-1.9.6}/tests/run_tests.sh +0 -0
@@ -21,6 +21,15 @@ jobs:
21
21
  - 3.9
22
22
  - '3.10'
23
23
  - '3.11'
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
24
33
 
25
34
  name: "Unit tests • ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }}"
26
35
  runs-on: ${{ matrix.runs-on }}
@@ -29,7 +38,7 @@ jobs:
29
38
  || (github.event_name == 'pull_request' && github.event.pull_request.merged != true))
30
39
 
31
40
  steps:
32
- - uses: actions/checkout@v3
41
+ - uses: actions/checkout@v4
33
42
 
34
43
  - name: Get history and tags for SCM versioning to work
35
44
  run: |
@@ -37,12 +46,12 @@ jobs:
37
46
  git fetch --depth=1 origin +refs/tags/*:refs/tags/*
38
47
 
39
48
  - name: Setup Python ${{ matrix.python }}
40
- uses: actions/setup-python@v4
49
+ uses: actions/setup-python@v5
41
50
  with:
42
51
  python-version: ${{ matrix.python }}
43
52
  architecture: 'x64'
44
53
  cache: 'pip'
45
- cache-dependency-path: '**/setup.cfg'
54
+ cache-dependency-path: '**/pyproject.toml'
46
55
 
47
56
  - name: Prepare env
48
57
  run: python -m pip install -U pytest-github-actions-annotate-failures wheel build
@@ -54,7 +63,7 @@ jobs:
54
63
  run: python -m pytest -v --cov=cmake_pc_hooks --cov-report=xml --cov-report=term-missing --cov-branch
55
64
 
56
65
  - name: Upload coverage reports to Codecov
57
- uses: codecov/codecov-action@v3
66
+ uses: codecov/codecov-action@v4
58
67
  with:
59
68
  token: ${{ secrets.CODECOV_TOKEN }}
60
69
 
@@ -76,6 +85,15 @@ jobs:
76
85
  - 3.9
77
86
  - '3.10'
78
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
79
97
 
80
98
  name: "System tests ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }}"
81
99
  runs-on: ${{ matrix.runs-on }}
@@ -85,7 +103,7 @@ jobs:
85
103
  || (github.event_name == 'pull_request' && github.event.pull_request.merged != true))
86
104
 
87
105
  steps:
88
- - uses: actions/checkout@v3
106
+ - uses: actions/checkout@v4
89
107
 
90
108
  - name: Get history and tags for SCM versioning to work
91
109
  run: |
@@ -94,15 +112,15 @@ jobs:
94
112
 
95
113
  - name: Enable Developer Command Prompt
96
114
  if: runner.os == 'Windows'
97
- uses: ilammy/msvc-dev-cmd@v1.12.1
115
+ uses: ilammy/msvc-dev-cmd@v1.13.0
98
116
 
99
117
  - name: Setup Python ${{ matrix.python }}
100
- uses: actions/setup-python@v4
118
+ uses: actions/setup-python@v5
101
119
  with:
102
120
  python-version: ${{ matrix.python }}
103
121
  architecture: 'x64'
104
122
  cache: 'pip'
105
- cache-dependency-path: '**/setup.cfg'
123
+ cache-dependency-path: '**/pyproject.toml'
106
124
 
107
125
  - name: Prepare env
108
126
  run: python -m pip install -U pytest-github-actions-annotate-failures wheel build
@@ -169,7 +187,7 @@ jobs:
169
187
  runs-on: ubuntu-latest
170
188
  needs: unit-tests
171
189
  steps:
172
- - uses: actions/checkout@v3
190
+ - uses: actions/checkout@v4
173
191
  with:
174
192
  fetch-depth: 0
175
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,14 +14,14 @@ 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'
24
- cache-dependency-path: '**/setup.cfg'
24
+ cache-dependency-path: '**/pyproject.toml'
25
25
 
26
26
  - name: Update CHANGELOG
27
27
  run: |
@@ -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,18 +13,18 @@ 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'
27
- cache-dependency-path: '**/setup.cfg'
27
+ cache-dependency-path: '**/pyproject.toml'
28
28
 
29
29
  - name: Install dependencies
30
30
  run: |
@@ -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,30 +32,24 @@ 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.32.0
49
+ rev: v1.35.1
50
50
  hooks:
51
51
  - id: yamllint
52
52
 
53
- - repo: https://github.com/psf/black
54
- rev: 23.9.1
55
- hooks:
56
- - id: black
57
- language_version: python3
58
-
59
53
  - repo: https://github.com/asottile/blacken-docs
60
54
  rev: 1.16.0
61
55
  hooks:
@@ -64,7 +58,18 @@ repos:
64
58
  additional_dependencies: [black==22.12.0]
65
59
 
66
60
  - repo: https://github.com/astral-sh/ruff-pre-commit
67
- rev: v0.0.292
61
+ rev: v0.4.7
68
62
  hooks:
63
+ - id: ruff-format
64
+ name: ruff (format)
65
+ args: [--preview]
66
+
69
67
  - id: ruff
70
- args: [--fix, --exit-non-zero-on-fix, --show-source, --show-fixes]
68
+ name: ruff (fix)
69
+ alias: ruff-fix
70
+ args:
71
+ - --fix
72
+ - --exit-non-zero-on-fix
73
+ - --output-format=full
74
+ - --show-fixes
75
+ - --preview
@@ -1,4 +1,4 @@
1
- ¨# Changelog
1
+ # Changelog
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
@@ -7,6 +7,47 @@ 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
+
33
+ ## [v1.9.5] - 2023-12-15
34
+
35
+ ### Added
36
+
37
+ - Added metadata to mark support for Python 3.12 and enabled CI checks for it
38
+ - Implemented PEP-621
39
+
40
+ ### Changed
41
+
42
+ - Remove all Python linters/formatters in favour of ruff
43
+ - Require setuptools>=61.0 in preparation for PEP-621
44
+
45
+ ### Repository
46
+
47
+ - Fix GitHub workflows
48
+ - Update `astral-sh/ruff-pre-commit` to v0.1.8
49
+ - Update `adrienverge/yamllint` hook to v1.33.0
50
+
10
51
  ## [v1.9.4] - 2023-10-15
11
52
 
12
53
  ### Added
@@ -168,7 +209,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
168
209
 
169
210
  ### Repository
170
211
 
171
- - 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
172
215
  - Update `ilammy/msvc-dev-cmd` GitHub Action to v1.12.1
173
216
  - Update `thomaseizinger/create-pull-request` GitHub Action to v1.3.0
174
217
  - Update `Lucas-C/pre-commit-hooks` hook to v1.4.2
@@ -197,6 +240,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
197
240
  ### Repository
198
241
 
199
242
  - Update GitHub's CodeQL action to v2
243
+ - Update `astral-sh/ruff-pre-commit` hook to v0.4.7
200
244
  - Update `pre-commit/pre-commit-hooks` hook to v4.3.0
201
245
  - Update `Lucas-C/pre-commit-hooks` hook to v1.2.0
202
246
  - Update `pre-commit/mirrors-pylint` hook to v3.0.0a5
@@ -223,6 +267,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
223
267
  and release/\_ branches
224
268
  - Update `isort` hook to v5.10.1
225
269
  - Update `black` hook to v21.12b0
270
+ - Disable macOS CI for Python \< 3.11 (now runs on M1 macs on GitHub)
226
271
 
227
272
  ## [v1.5.0] - 2021-11-08
228
273
 
@@ -355,7 +400,7 @@ Initial release with support for:
355
400
  - clang-tidy
356
401
  - cppcheck
357
402
 
358
- [unreleased]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/v1.9.4...HEAD
403
+ [unreleased]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/v1.9.6...HEAD
359
404
  [v1.0.0]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/20b1113bf223273cda31a14a82c9d573a342de4a...v1.0.0
360
405
  [v1.0.1]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/v1.0.0...v1.0.1
361
406
  [v1.1.0]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/v1.0.1...v1.1.0
@@ -377,3 +422,5 @@ Initial release with support for:
377
422
  [v1.9.2]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/v1.9.1...v1.9.2
378
423
  [v1.9.3]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/v1.9.2...v1.9.3
379
424
  [v1.9.4]: https://github.com/Takishima/cmake-pre-commit-hooks/compare/v1.9.3...v1.9.4
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,7 +1,6 @@
1
1
  include CHANGELOG.md
2
2
  include LICENSE
3
3
  include README.md
4
- include setup.cfg
5
4
  include setup.py
6
5
  include pyproject.toml
7
6
 
@@ -1,11 +1,14 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cmake_pre_commit_hooks
3
- Version: 1.9.4
4
- Summary: pre-commit hooks for CMake based projects
5
- Home-page: https://github.com/Takishima/cmake-pre-commit-hooks
6
- Author: Damien Nguyen
7
- Author-email: ngn.damien@gmail.com
3
+ Version: 1.9.6
4
+ Summary: pre-commit hooks for CMake-based projects
5
+ Author-email: Damien Nguyen <ngn.damien@gmail.com>
8
6
  License: Apache2
7
+ Project-URL: Homepage, https://github.com/Takishima/cmake-pre-commit-hooks
8
+ Project-URL: Pypi, https://pypi.org/project/cmake-pre-commit-hooks/
9
+ Project-URL: Repository, https://github.com/Takishima/cmake-pre-commit-hooks
10
+ Project-URL: Issues, https://github.com/Takishima/cmake-pre-commit-hooks/issues
11
+ Project-URL: Changelog, https://github.com/Takishima/cmake-pre-commit-hooks/blob/main/CHANGELOG.md
9
12
  Classifier: License :: OSI Approved :: Apache Software License
10
13
  Classifier: Programming Language :: Python :: 3
11
14
  Classifier: Programming Language :: Python :: 3 :: Only
@@ -13,6 +16,7 @@ Classifier: Programming Language :: Python :: 3.8
13
16
  Classifier: Programming Language :: Python :: 3.9
14
17
  Classifier: Programming Language :: Python :: 3.10
15
18
  Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
16
20
  Requires-Python: >=3.8
17
21
  Description-Content-Type: text/markdown
18
22
  License-File: LICENSE
@@ -24,6 +28,8 @@ Requires-Dist: attrs>=23
24
28
  Requires-Dist: lizard
25
29
  Provides-Extra: clang-format
26
30
  Requires-Dist: clang-format; extra == "clang-format"
31
+ Provides-Extra: clang-tidy
32
+ Requires-Dist: clang-tidy; extra == "clang-tidy"
27
33
  Provides-Extra: lizard
28
34
  Requires-Dist: lizard; extra == "lizard"
29
35
  Provides-Extra: test
@@ -28,6 +28,44 @@ import toml
28
28
  # ==============================================================================
29
29
 
30
30
 
31
+ class InvalidExecutablePathError(argparse.ArgumentTypeError):
32
+ """Exception raised when a path to an executable is invalid."""
33
+
34
+ def __init__(self, path: Path) -> None:
35
+ """Initialize an InvalidExecutablePathError."""
36
+ super().__init__(f'{path} is not a valid file and/or does not appear executable')
37
+
38
+
39
+ class TOMLFileNotFoundError(FileNotFoundError):
40
+ """Exception raised when a TOML file cannot be found."""
41
+
42
+ def __init__(self, path: Path) -> None:
43
+ """Initialize a TOMLFileNotFoundError object."""
44
+ super().__init__(f'Unable to locate TOML file {path}')
45
+
46
+
47
+ class TOMLSectionKeyError(KeyError):
48
+ """Exception raised when a TOML key cannot be found."""
49
+
50
+ def __init__(self, section: str, path: Path) -> None:
51
+ """Initialize a TOMLSectionKeyError object."""
52
+ super().__init__(f'Unable to locate section {section} in TOML file {path}')
53
+
54
+
55
+ class TOMLTypeError(argparse.ArgumentTypeError):
56
+ """Exception raised when a TOML key does not match the type of a default value."""
57
+
58
+ def __init__(self, value_type: type, default_value_type: type, toml_key: str) -> None:
59
+ """Initialize a TOMLSectionKeyError object."""
60
+ super().__init__(
61
+ f'TOML value type {value_type} not compatible with parser argument '
62
+ f'{default_value_type} for key "{toml_key}"'
63
+ )
64
+
65
+
66
+ # ==============================================================================
67
+
68
+
31
69
  def _append_in_namespace(namespace, key, values):
32
70
  current = getattr(namespace, key, [])
33
71
  if current is None:
@@ -65,14 +103,14 @@ def executable_path(path: str) -> Path:
65
103
  """
66
104
  if Path(path).is_file() and os.access(path, os.X_OK):
67
105
  return path
68
- raise argparse.ArgumentTypeError(f'{path} is not a valid file and/or does not appear executable')
106
+ raise InvalidExecutablePathError(path)
69
107
 
70
108
 
71
109
  # ==============================================================================
72
110
 
73
111
 
74
112
  def _load_data_from_toml(
75
- path: Path, section: str, path_must_exist: bool = True, section_must_exist: bool = True
113
+ path: Path, section: str, *, path_must_exist: bool = True, section_must_exist: bool = True
76
114
  ) -> dict:
77
115
  """
78
116
  Load a TOML file and return the corresponding config dictionary.
@@ -98,15 +136,16 @@ def _load_data_from_toml(
98
136
  else:
99
137
  config = {key: value for key, value in config.items() if not isinstance(value, dict)}
100
138
  logging.debug('Loading data from root table of %s', path)
101
- return config
102
139
  except FileNotFoundError as err:
103
140
  if path_must_exist:
104
- raise FileNotFoundError(f'Unable to locate TOML file {path}') from err
141
+ raise TOMLFileNotFoundError(path) from err
105
142
  logging.debug('TOML file %s does not exist (not an error)', str(path))
106
143
  except KeyError as err:
107
144
  if section_must_exist:
108
- raise KeyError(f'Unable to locate section {section} in TOML file {path}') from err
145
+ raise TOMLSectionKeyError(section, path) from err
109
146
  logging.debug('TOML file %s does not have a %s section (not an error)', str(path), section)
147
+ else:
148
+ return config
110
149
  return {}
111
150
 
112
151
 
@@ -226,13 +265,11 @@ class ArgumentParser(argparse.ArgumentParser):
226
265
  if namespace.dump_toml:
227
266
  exclude_keys = {'positionals', 'dump_toml'}
228
267
  print(
229
- toml.dumps(
230
- {
231
- key: value
232
- for key, value in vars(namespace).items()
233
- if value != self._default_args[key] and key not in exclude_keys
234
- }
235
- )
268
+ toml.dumps({
269
+ key: value
270
+ for key, value in vars(namespace).items()
271
+ if value != self._default_args[key] and key not in exclude_keys
272
+ })
236
273
  )
237
274
  sys.exit(0)
238
275
 
@@ -243,6 +280,7 @@ class ArgumentParser(argparse.ArgumentParser):
243
280
  namespace: argparse.Namespace,
244
281
  path: Path,
245
282
  section: str = '',
283
+ *,
246
284
  path_must_exist: bool = True,
247
285
  section_must_exist: bool = True,
248
286
  overridable_keys: set | None = None,
@@ -258,7 +296,9 @@ class ArgumentParser(argparse.ArgumentParser):
258
296
  section_must_exist: Whether a missing section in the TOML file is considered an error or not
259
297
  overridable_keys: List of keys that can be overridden by values in the TOML file
260
298
  """
261
- config = _load_data_from_toml(path, section, path_must_exist, section_must_exist)
299
+ config = _load_data_from_toml(
300
+ path, section, path_must_exist=path_must_exist, section_must_exist=section_must_exist
301
+ )
262
302
 
263
303
  for key, value in config.items():
264
304
  if key not in self._default_args:
@@ -267,10 +307,7 @@ class ArgumentParser(argparse.ArgumentParser):
267
307
  # NB: we can only do proper type check if the default value is given...
268
308
  default_value = self._default_args[key]
269
309
  if default_value is not None and not isinstance(value, type(default_value)):
270
- raise argparse.ArgumentTypeError(
271
- f'TOML value type {type(value)} not compatible with parser argument '
272
- f'{type(default_value)} for key "{key}"'
273
- )
310
+ raise TOMLTypeError(type(value), type(default_value), key)
274
311
  if overridable_keys is not None and key not in overridable_keys:
275
312
  logging.debug(' skipping non-overridable key: "%s"', key)
276
313
  continue
@@ -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