Skip to content

Commit 29bb490

Browse files
committed
add pre-commit
1 parent a7c8f36 commit 29bb490

File tree

1 file changed

+30
-21
lines changed

1 file changed

+30
-21
lines changed

.pre-commit-config.yaml

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,37 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
4+
ci:
5+
autoupdate_commit_msg: "chore: update pre-commit hooks"
6+
autofix_commit_msg: "style: pre-commit fixes"
7+
autofix_prs: true
8+
19
repos:
10+
- repo: https://github.com/astral-sh/ruff-pre-commit
11+
rev: "v0.11.13"
12+
hooks:
13+
- id: ruff
14+
types_or: [python, pyi, jupyter]
15+
args: [--fix, --show-fixes]
16+
- id: ruff-format
17+
types_or: [python, pyi, jupyter]
18+
219
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
20+
rev: v5.0.0
421
hooks:
522
- id: trailing-whitespace
6-
- id: check-toml
7-
- id: check-json
23+
exclude: '.*\.fits$'
24+
- id: end-of-file-fixer
25+
exclude_types: [csv]
26+
exclude: '.*\.fits$'
827
- id: check-yaml
9-
args: ["--allow-multiple-documents"]
10-
- id: sort-simple-yaml
11-
files: keywords\.yaml$
12-
13-
- repo: https://github.com/PyCQA/isort
14-
rev: "5.10.1"
15-
hooks:
16-
- id: isort
17-
additional_dependencies:
18-
- toml
19-
20-
- repo: https://github.com/psf/black
21-
rev: "22.3.0"
22-
hooks:
23-
- id: black
28+
# prevent addition of (presumably data) files >= 10 MB
29+
# (for such files, see https://learn.astropy.org/contributing/how-to-contribute)
30+
- id: check-added-large-files
31+
args: ["--maxkb=10000"]
2432

25-
- repo: https://github.com/PyCQA/flake8
26-
rev: "4.0.1"
33+
- repo: https://github.com/kynan/nbstripout
34+
rev: 0.8.1
2735
hooks:
28-
- id: flake8
36+
- id: nbstripout
37+
args: ["--extra-keys=metadata.kernelspec metadata.language_info.version metadata.toc"]

0 commit comments

Comments
 (0)