-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Further tooling: black, flake8, and precommit-hooks (#32)
* feat: add black, flake8 and precommit-hooks * chore: run precommit-hooks on all files and fix all existing errors * feat: improve documentation regarding contributions and intended uses of GutenTAG * fix: pre-commit-dependency version specification * fix: downgrade flake8 to 5.0.4 to support Python 3.7 * chore: remove obsolete gitlab CI configuration * fix: downgrade pre-commit to 2.21 to support Python 3.7 * chore: remove additional generation configurations (they were accidentially added in a previous commit)
- Loading branch information
Showing
68 changed files
with
1,968 additions
and
1,151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
args: [--markdown-linebreak-ext=md] | ||
- id: check-case-conflict | ||
- id: mixed-line-ending | ||
args: [--fix=lf] | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.920 | ||
hooks: | ||
- id: mypy | ||
files: gutenTAG | ||
additional_dependencies: | ||
- types-PyYAML | ||
- types-jsonschema | ||
- repo: https://github.com/psf/black | ||
rev: '23.1.0' | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: '5.0.4' | ||
hooks: | ||
- id: flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Contributing | ||
|
||
## Code style and format | ||
|
||
We use [black](https://black.readthedocs.io/) to automatically format our python files. | ||
Please stick to the black code style. | ||
|
||
Please consider using the pre-commit hooks. | ||
They automatically run i.a. black for you. | ||
See next section. | ||
|
||
### Black quick-installation guide | ||
|
||
```bash | ||
pip install black | ||
black | ||
``` | ||
|
||
## Running pre-commit hooks | ||
|
||
We use [pre-commit](https://pre-commit.com/) to run some checks on your files before they are commited. | ||
Find the configured hooks in [`.pre-commit-config.yaml`](./pre-commit-config.yaml). | ||
If there are errors, you have to re-add the files to the index and commit the fixed files. | ||
|
||
### Pre-commit quick-installation guide | ||
|
||
```bash | ||
pip install pre-commit | ||
pre-commit install | ||
``` | ||
|
||
Optionally, cou can then run the hooks against all files with: | ||
|
||
```bash | ||
pre-commit run --all-files | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.