Skip to content

Commit d85c665

Browse files
author
Drew Yang
committed
feat: ✨ add pre-commit
1 parent 52e2cfc commit d85c665

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed

.pre-commit-config.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# pip install datajoint[test]
2+
# pre-commit install
3+
# pre-commit run --all-files
4+
# pre-commit autoupdate
5+
# SKIP=flake8 git commit -m "foo"
6+
7+
# See https://pre-commit.com for more information
8+
# See https://pre-commit.com/hooks.html for more hooks
9+
repos:
10+
- repo: https://github.com/pre-commit/pre-commit-hooks
11+
rev: v5.0.0
12+
hooks:
13+
- id: check-yaml
14+
- id: check-json
15+
- id: check-toml
16+
- id: trailing-whitespace
17+
- id: end-of-file-fixer
18+
- id: check-added-large-files
19+
- repo: https://github.com/codespell-project/codespell
20+
rev: v2.4.1
21+
hooks:
22+
- id: codespell
23+
- repo: https://github.com/psf/black
24+
rev: 24.2.0
25+
hooks:
26+
- id: black
27+
args:
28+
- --required-version='24.2.0'
29+
- -check
30+
- -v=datajoint,tests
31+
- --diff
32+
- repo: https://github.com/PyCQA/flake8
33+
rev: 7.1.2
34+
hooks:
35+
- id: flake8
36+
args:
37+
- --ignore=E203,E722,W503 datajoint
38+
- --count
39+
- --max-complexity=62
40+
- --max-line-length=127
41+
- --statistics
42+
- --per-file-ignores='datajoint/diagram.py:C901'

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
"[dockercompose]": {
1818
"editor.defaultFormatter": "disable"
1919
},
20-
"files.autoSave": "off"
21-
}
20+
//"files.autoSave": "off"
21+
}

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ classifiers = [
4444

4545
[project.optional-dependencies]
4646
test = [
47+
"pre-commit",
4748
"pytest",
4849
"pytest-cov",
4950
"black==24.2.0",

0 commit comments

Comments
 (0)