Skip to content

Commit ab00048

Browse files
authored
Add pre-commit checks (#3)
* Add pre-commit checks * We don't have toml * Add ruff to checks * try workaround for pre-commit ci * use standard library testing for ci to work * Skip pytest on CI
1 parent 9297cf0 commit ab00048

File tree

4 files changed

+65
-1
lines changed

4 files changed

+65
-1
lines changed

.pre-commit-config.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
repos:
2+
- repo: https://github.com/pycqa/isort
3+
rev: 5.13.2
4+
hooks:
5+
- id: isort
6+
7+
- repo: https://github.com/psf/black-pre-commit-mirror
8+
rev: 24.4.2
9+
hooks:
10+
- id: black
11+
12+
- repo: https://github.com/pre-commit/pre-commit-hooks
13+
rev: v4.6.0
14+
hooks:
15+
- id: check-case-conflict
16+
- id: check-merge-conflict
17+
- id: check-yaml
18+
- id: end-of-file-fixer
19+
- id: trailing-whitespace
20+
21+
- repo: https://github.com/astral-sh/ruff-pre-commit
22+
rev: v0.4.4
23+
hooks:
24+
- id: ruff
25+
- id: ruff-format
26+
args: ["--check"]
27+
28+
- repo: local
29+
hooks:
30+
- id: pytest
31+
name: Run pytest
32+
entry: make test
33+
language: system
34+
pass_filenames: false
35+
always_run: true
36+
37+
ci:
38+
skip: [pytest]

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ all: download transform
2121

2222
test:
2323
PYTHONPATH="src" pytest
24+
25+
pre-commit:
26+
pre-commit install
27+
pre-commit run --all-files

requirements.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ pdbpp
22
black
33
isort
44
pytest
5+
pre-commit
56

67
requests
78
pydantic

requirements.txt

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,20 @@ black==22.3.0
1010
# via -r requirements.in
1111
certifi==2021.10.8
1212
# via requests
13+
cfgv==3.4.0
14+
# via pre-commit
1315
charset-normalizer==2.0.12
1416
# via requests
1517
click==8.1.3
1618
# via black
19+
distlib==0.3.8
20+
# via virtualenv
1721
fancycompleter==0.9.1
1822
# via pdbpp
23+
filelock==3.14.0
24+
# via virtualenv
25+
identify==2.5.36
26+
# via pre-commit
1927
idna==3.3
2028
# via requests
2129
iniconfig==1.1.1
@@ -24,16 +32,22 @@ isort==5.10.1
2432
# via -r requirements.in
2533
mypy-extensions==0.4.3
2634
# via black
35+
nodeenv==1.8.0
36+
# via pre-commit
2737
packaging==21.3
2838
# via pytest
2939
pathspec==0.9.0
3040
# via black
3141
pdbpp==0.10.3
3242
# via -r requirements.in
3343
platformdirs==2.5.2
34-
# via black
44+
# via
45+
# black
46+
# virtualenv
3547
pluggy==1.0.0
3648
# via pytest
49+
pre-commit==3.7.1
50+
# via -r requirements.in
3751
py==1.11.0
3852
# via pytest
3953
pydantic==1.9.0
@@ -48,6 +62,8 @@ pytest==7.1.2
4862
# via -r requirements.in
4963
python-slugify==6.1.2
5064
# via -r requirements.in
65+
pyyaml==6.0.1
66+
# via pre-commit
5167
requests==2.27.1
5268
# via -r requirements.in
5369
text-unidecode==1.3
@@ -60,5 +76,10 @@ typing-extensions==4.2.0
6076
# via pydantic
6177
urllib3==1.26.9
6278
# via requests
79+
virtualenv==20.21.1
80+
# via pre-commit
6381
wmctrl==0.4
6482
# via pdbpp
83+
84+
# The following packages are considered to be unsafe in a requirements file:
85+
# setuptools

0 commit comments

Comments
 (0)