Skip to content

Commit

Permalink
Added pre-commit (#752)
Browse files Browse the repository at this point in the history
- 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).
  • Loading branch information
Markus28 authored Oct 2, 2022
1 parent 65c4e3d commit b0c8d28
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 39 deletions.
35 changes: 35 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
repos:
# - repo: local
# hooks:
# - id: mypy
# name: mypy
# entry: mypy
# language: python
# pass_filenames: false
# args: [--config-file=setup.cfg, tianshou]

- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.32.0
hooks:
- id: yapf
args: [-r]

- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort

- repo: https://gitlab.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
args: [--config=setup.cfg, --count, --show-source, --statistics]
additional_dependencies: ["flake8_bugbear"]

- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
exclude: ^(test/)|(docs/)|(examples/)|(setup.py)
Loading

0 comments on commit b0c8d28

Please sign in to comment.