From 43e939f0d29636527bbf4de888a6573debdac958 Mon Sep 17 00:00:00 2001 From: Oliver Sauder Date: Mon, 8 Oct 2018 09:33:56 +0200 Subject: [PATCH] Introduce pre-commit hooks (#83) --- .pre-commit-config.yaml | 18 ++++++++++++++++++ README.md | 13 ++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..be90fe504 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,18 @@ +repos: +- repo: local + hooks: + - id: black + name: black + language: system + entry: black + types: [python] + - id: isort + name: isort + language: system + entry: isort -y + types: [python] + - id: flake8 + name: flake8 + language: system + entry: flake8 + types: [python] diff --git a/README.md b/README.md index 0b402a32c..54401b154 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,9 @@ make start And access GraphiQL at [http://localhost:8000/graphql](http://localhost:8000/graphql) -## Testing +## Development + +### Testing Run tests by executing: ```bash @@ -31,5 +33,14 @@ make install-dev make test ``` +### Setup pre commit + +Pre commit hooks is an additional option instead of excuting checks in your editor of choice. + +```bash +pip install pre-commit +pre-commit install +``` + ## License Code released under the [MIT license](LICENSE).