Skip to content

Commit

Permalink
Add pre-commit hook config to run flake8 and black on commit (#864)
Browse files Browse the repository at this point in the history
Notes added to README on how to install and set up
  • Loading branch information
austinweisgrau authored Aug 10, 2023
1 parent 77ead60 commit 07174ad
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
language_version: python3
args: [
'--extend-ignore=E203,W503',
'--max-line-length=100'
]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
language_version: python3
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ Run the following commands from the root of the Parsons repository to lint your
> black parsons
```

Pre-commit hooks are available to enforce black and isort formatting on
commit. You can also set up your IDE to reformat using black and/or isort on
save.

To set up the pre-commit hooks, install pre-commit with `pip install
pre-commit`, and then run `pre-commit install`.

#### Coding Conventions

The following is a list of best practices to consider when writing code for the Parsons project:
Expand Down

0 comments on commit 07174ad

Please sign in to comment.