Skip to content

Commit 151ddf1

Browse files
Add pre-commit hooks
1 parent 683fd43 commit 151ddf1

File tree

4 files changed

+110
-16
lines changed

4 files changed

+110
-16
lines changed

.pre-commit-config.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
default_language_version:
2+
python: python3.11 # set for project python version
3+
repos:
4+
- repo: local
5+
hooks:
6+
- id: black-apply
7+
name: black-apply
8+
entry: pipenv run black
9+
language: system
10+
pass_filenames: true
11+
types: ["python"]
12+
- id: mypy
13+
name: mypy
14+
entry: pipenv run mypy
15+
language: system
16+
pass_filenames: true
17+
types: ["python"]
18+
exclude: "tests/"
19+
- id: ruff-apply
20+
name: ruff-apply
21+
entry: pipenv run ruff check --fix
22+
language: system
23+
pass_filenames: true
24+
types: ["python"]
25+
- id: safety
26+
name: safety
27+
entry: pipenv check
28+
language: system
29+
pass_filenames: false

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ help: # preview Makefile commands
1414

1515
install: # install Python dependencies and pre-commit hook
1616
pipenv install --dev
17+
pipenv run pre-commit install
1718

1819
update: install # update Python dependencies
1920
pipenv clean

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ boto3-stubs = "*"
1818
coveralls = "*"
1919
freezegun = "*"
2020
mypy = "*"
21+
pre-commit = "*"
2122
pydocstyle = "*"
2223
pytest = "*"
2324
vcrpy = "*"

Pipfile.lock

Lines changed: 79 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)