Skip to content

Commit 498c50a

Browse files
committed
Add pre-commit hooks.
1 parent 5fd5b9e commit 498c50a

2 files changed

Lines changed: 32 additions & 4 deletions

File tree

.pre-commit-config.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.4.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- id: check-shebang-scripts-are-executable
12+
- id: check-merge-conflict
13+
- id: check-toml
14+
- id: debug-statements
15+
- id: fix-byte-order-marker
16+
- id: detect-private-key
17+
- repo: https://github.com/psf/black
18+
rev: 23.3.0
19+
hooks:
20+
- id: black
21+
- repo: https://github.com/pycqa/isort
22+
rev: 5.12.0
23+
hooks:
24+
- id: isort
25+
default_language_version:
26+
python: python3.11

CONTRIBUTING.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
## Code style
22

3-
New and refactored Python code should follow the
4-
[PEP 8](https://www.python.org/dev/peps/pep-0008/) guidelines.
3+
Code styles are enforced using black and linters.
4+
These are best enabled with a pre-commit which you can setup with:
55

6-
It's recommended to use an editor supporting
7-
[EditorConfig](https://editorconfig.org/).
6+
```sh
7+
pip install pre-commit
8+
pre-commit install
9+
```
810

911
## Building python-tcod
1012

0 commit comments

Comments
 (0)