Skip to content

Commit

Permalink
Merge pull request #170 from PrefectHQ/pre-commit
Browse files Browse the repository at this point in the history
Pre commit instructions
  • Loading branch information
cicdw authored Aug 27, 2018
2 parents 4712c66 + 535ba0c commit 785f6a8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- repo: local
hooks:
- id: black
name: black
entry: black
language: python
language_version: python3
types: [python]
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ cd prefect
pytest
```

### Black formatting

Merging to master in Prefect requires your code to pass [black](https://github.com/ambv/black). This can be easy to forget when developing, and for that reason some developers may choose to install a pre-push hook for black, as follows:
```
pip install pre-commit # installs pre-commit package
cd prefect/ # make sure you are in the root directory of the prefect repo
pre-commit install --hook-type pre-push # creates necessary git hook files
```
There is already a pre-commit config file contained in the repo that creates the pre-push hook for black. Now, you won't be allowed to `git push` without passing black.


### Build documentation

To view documentation locally:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

install_requires = [
"click >= 6.7, < 7.0",
"cloudpickle >= 0.5.3, < 0.6.0",
"cloudpickle == 0.5.3",
"croniter >= 0.3.23, < 0.4",
"cryptography >= 2.2.2, < 3.0",
"dask >= 0.18, < 0.19",
Expand Down

0 comments on commit 785f6a8

Please sign in to comment.