Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre commit instructions #170

Merged
merged 6 commits into from
Aug 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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