Skip to content

Commit

Permalink
CONTRIBUTING: introduce pre-commit (#3875)
Browse files Browse the repository at this point in the history
  • Loading branch information
xrmx authored Apr 29, 2024
1 parent 5994be3 commit d285b7f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.3.0
hooks:
- id: black
language_version: python3.11
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: '6.1.0'
hooks:
- id: flake8
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ An easier way to do so is:
1. Run `.tox/lint/bin/black .`
2. Run `.tox/lint/bin/isort .`

Or you can call formatting and linting in one command by [pre-commit](https://pre-commit.com/):

```console
$ pre-commit
```

You can also configure it to run lint tools automatically before committing with:

```console
$ pre-commit install
```

We try to keep the amount of _public symbols_ in our code minimal. A public symbol is any Python identifier that does not start with an underscore.
Every public symbol is something that has to be kept in order to maintain backwards compatibility, so we try to have as few as possible.

Expand Down
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ asgiref==3.7.2
psutil==5.9.6
GitPython==3.1.41
flaky==3.7.0
pre-commit==3.7.0

0 comments on commit d285b7f

Please sign in to comment.