Skip to content

Commit d19828b

Browse files
authored
Merge pull request #2294 from larrybradley/cython-precommit
Add cython-lint to pre-commit hooks
2 parents b3eac27 + 64a086f commit d19828b

2 files changed

Lines changed: 26 additions & 18 deletions

File tree

.pre-commit-config.yaml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,29 @@ repos:
8282
- id: flake8
8383
args: ['--ignore', 'E501,W503']
8484

85+
- repo: https://github.com/MarcoGorelli/cython-lint
86+
rev: v0.19.0
87+
hooks:
88+
- id: cython-lint
89+
90+
- repo: https://github.com/woodruffw/zizmor-pre-commit
91+
rev: v1.25.2
92+
hooks:
93+
- id: zizmor
94+
95+
- repo: https://github.com/rbubley/mirrors-prettier
96+
rev: v3.8.3
97+
hooks:
98+
- id: prettier
99+
types_or: [css, rst, json, yaml, toml, markdown]
100+
args: ['--single-quote']
101+
# Exclude codeql.yml, dependabot.yml, and schemas/**/*.yaml
102+
exclude: |
103+
(?x)^(
104+
(.*\/)?(codeql\.yml|dependabot\.yml)$|
105+
.*schemas\/.*\.yaml$
106+
)
107+
85108
- repo: https://github.com/codespell-project/codespell
86109
rev: v2.4.2
87110
hooks:
@@ -106,26 +129,8 @@ repos:
106129
# args: [--in-place, --config, ./pyproject.toml]
107130
# exclude: "extern/"
108131

109-
- repo: https://github.com/woodruffw/zizmor-pre-commit
110-
rev: v1.25.2
111-
hooks:
112-
- id: zizmor
113-
114132
- repo: https://github.com/sphinx-contrib/sphinx-lint
115133
rev: v1.0.2
116134
hooks:
117135
- id: sphinx-lint
118136
exclude: '(docs/_build/|photutils/extern/)'
119-
120-
- repo: https://github.com/rbubley/mirrors-prettier
121-
rev: v3.8.3
122-
hooks:
123-
- id: prettier
124-
types_or: [css, rst, json, yaml, toml, markdown]
125-
args: ['--single-quote']
126-
# Exclude codeql.yml, dependabot.yml, and schemas/**/*.yaml
127-
exclude: |
128-
(?x)^(
129-
(.*\/)?(codeql\.yml|dependabot\.yml)$|
130-
.*schemas\/.*\.yaml$
131-
)

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,5 +337,8 @@ convention = 'numpy'
337337
[tool.ruff.lint.flake8-quotes]
338338
inline-quotes = 'single'
339339

340+
[tool.cython-lint]
341+
max-line-length = 79
342+
340343
[tool.distutils.bdist_wheel]
341344
py-limited-api = "cp311"

0 commit comments

Comments
 (0)