Skip to content

Commit b0c8d28

Browse files
authored
Added pre-commit (#752)
- This PR adds the checks that are defined in the Makefile as pre-commit hooks. - Hopefully, the checks are equivalent to those from the Makefile, but I can't guarantee it. - CI remains as it is. - As I pointed out on discord, I experienced some conflicts between flake8 and yapf, so it might be better to transition to some other combination (e.g. black).
1 parent 65c4e3d commit b0c8d28

File tree

4 files changed

+85
-39
lines changed

4 files changed

+85
-39
lines changed

.pre-commit-config.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
repos:
3+
# - repo: local
4+
# hooks:
5+
# - id: mypy
6+
# name: mypy
7+
# entry: mypy
8+
# language: python
9+
# pass_filenames: false
10+
# args: [--config-file=setup.cfg, tianshou]
11+
12+
- repo: https://github.com/pre-commit/mirrors-yapf
13+
rev: v0.32.0
14+
hooks:
15+
- id: yapf
16+
args: [-r]
17+
18+
- repo: https://github.com/pycqa/isort
19+
rev: 5.10.1
20+
hooks:
21+
- id: isort
22+
name: isort
23+
24+
- repo: https://gitlab.com/PyCQA/flake8
25+
rev: 4.0.1
26+
hooks:
27+
- id: flake8
28+
args: [--config=setup.cfg, --count, --show-source, --statistics]
29+
additional_dependencies: ["flake8_bugbear"]
30+
31+
- repo: https://github.com/pycqa/pydocstyle
32+
rev: 6.1.1
33+
hooks:
34+
- id: pydocstyle
35+
exclude: ^(test/)|(docs/)|(examples/)|(setup.py)

0 commit comments

Comments
 (0)