Skip to content

Commit

Permalink
Merge pull request #30 from python-discord/precommit-fix
Browse files Browse the repository at this point in the history
Update pre-commit config so it actually uses the flake8 plugins
  • Loading branch information
lemonsaurus committed Oct 20, 2019
2 parents afdcf05 + dad0150 commit 199c439
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -4,4 +4,4 @@

build/
dist/
crispy_bulma.egg-info/
django_simple_bulma.egg-info/
11 changes: 9 additions & 2 deletions .pre-commit-config.yaml
@@ -1,5 +1,12 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
rev: v2.2.3
hooks:
- id: flake8
- id: flake8
additional_dependencies: [
"flake8-bugbear~=19.8",
"flake8-import-order~=0.18",
"flake8-tidy-imports~=2.0",
"flake8-todo~=0.7",
"flake8-string-format~=0.2"
]
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -9,6 +9,7 @@ Note that contributions may be rejected on the basis of a contributor failing to
1. **No force-pushes** or modifying the Git history in any way.
2. If you have direct access to the repository, **create a branch for your changes** and create a pull request for that branch. If not, create a branch on a fork of the repository and create a pull request from there.
* It's common practice for a repository to reject direct pushes to `master`, so make branching a habit!
* If PRing from your own fork, **ensure that "Allow edits from maintainers" is checked**. This gives permission for maintainers to commit changes directly to your fork, speeding up the review process.
3. **Adhere to the prevailing code style**, which we enforce using [flake8](http://flake8.pycqa.org/en/latest/index.html).
* Run `flake8` against your code **before** you push it. Your commit will be rejected by the build server if it fails to lint.
* [Git Hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) are a powerful tool that can be a daunting to set up. Fortunately, [`pre-commit`](https://github.com/pre-commit/pre-commit) abstracts this process away from you and is provided as a dev dependency for this project. Run `pipenv run precommit` when setting up the project and you'll never have to worry about breaking the build for linting errors.
Expand Down Expand Up @@ -79,6 +80,13 @@ def foo(bar: int, baz: dict=None) -> bool:
"""
```

### Work in Progress (WIP) PRs
Github [has introduced a new PR feature](https://github.blog/2019-02-14-introducing-draft-pull-requests/) that allows the PR author to mark it as a WIP. This provides both a visual and functional indicator that the contents of the PR are in a draft state and not yet ready for formal review.

This feature should be utilized in place of the traditional method of prepending `[WIP]` to the PR title.

As stated earlier, **ensure that "Allow edits from maintainers" is checked**. This gives permission for maintainers to commit changes directly to your fork, speeding up the review process.

## Footnotes

This document was inspired by the [Glowstone contribution guidelines](https://github.com/GlowstoneMC/Glowstone/blob/dev/docs/CONTRIBUTING.md).

0 comments on commit 199c439

Please sign in to comment.