Skip to content

Commit fcbd1f0

Browse files
authored
Add pre-commit (#63)
* Set isort to black compatability * Add pre-commit config * Add pre-commit as a dev dependency * Add pre-commit to contributing docs
1 parent 8db3f0a commit fcbd1f0

4 files changed

Lines changed: 178 additions & 3 deletions

File tree

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
repos:
2+
- repo: https://github.com/pycqa/isort
3+
rev: 5.10.1
4+
hooks:
5+
- id: isort
6+
- repo: https://github.com/ambv/black
7+
rev: 22.1.0
8+
hooks:
9+
- id: black

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,8 @@ Add the following to user's `settings.json` :
9999

100100
All isort command line options can be found [here](https://pycqa.github.io/isort/docs/configuration/options.html).
101101

102+
## pre-commit
103+
104+
[pre-commit](https://pre-commit.com) is a dev dependency of Pglet and is automatically installed by `pdm install`.
105+
To install the pre-commit hooks run: `pre-commit install`.
106+
Once installed, everytime you commit, pre-commit will run the configured hooks against changed files.

pdm.lock

Lines changed: 156 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@ documentation = "https://pglet.io/docs/"
3030
tests = [
3131
"pytest>=6.1.2",
3232
]
33-
dev = []
33+
dev = [
34+
"pre-commit>=2.17.0",
35+
]
3436

3537
[build-system]
3638
requires = ["git+https://github.com/pdm-project/pdm-pep517.git"]
37-
build-backend = "pdm.pep517.api"
39+
build-backend = "pdm.pep517.api"
40+
41+
[tool.isort]
42+
profile = "black"
43+
float_to_top = true

0 commit comments

Comments
 (0)