-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy path.pre-commit-config.yaml
62 lines (60 loc) · 1.9 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# pip install datajoint[test]
# pre-commit install
# pre-commit run --all-files
# pre-commit autoupdate
# SKIP=flake8 git commit -m "foo"
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
exclude: 'docs/mkdocs.yaml' # exclude mkdocs.yaml since pymdownx.emoji !! usage
- id: check-json
exclude: '(.vscode|.devcontainer)' # exclude these since // was used for comments
- id: check-toml
- id: check-added-large-files
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
- repo: https://github.com/pycqa/isort
rev: 5.12.0 # Use the latest stable version
hooks:
- id: isort
args:
- --profile=black # Optional, makes isort compatible with Black
- repo: https://github.com/psf/black
rev: 24.2.0 # matching versions in pyproject.toml and github actions
hooks:
- id: black
args: ["--check", "-v", "datajoint", "tests", "--diff"] # --required-version is conflicting with pre-commit
- repo: https://github.com/PyCQA/flake8
rev: 7.1.2
hooks:
# syntax tests
- id: flake8
args:
- --select=E9,F63,F7,F82
- --count
- --show-source
- --statistics
files: datajoint # a lot of files in tests are not compliant
# style tests
- id: flake8
args:
- --ignore=E203,E722,W503
- --count
- --max-complexity=62
- --max-line-length=127
- --statistics
- --per-file-ignores=datajoint/diagram.py:C901
files: datajoint # a lot of files in tests are not compliant
- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
hooks:
# lint github actions workflow yaml
- id: actionlint
## Suggest to add pytest hook that runs unit test | Prerequisite: split unit/integration test
## https://github.com/datajoint/datajoint-python/issues/1211