Skip to content

Commit

Permalink
Merge c3c94a5 into 7f0df6a
Browse files Browse the repository at this point in the history
  • Loading branch information
HassanAbouelela committed May 16, 2021
2 parents 7f0df6a + c3c94a5 commit da66151
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ If you don't understand anything or need clarification, feel free to ask any sta

### Useful Resources

[Guidelines](./contributing-guidelines/) - General guidelines you should follow when contributing to our projects.<br>
[Style Guide](./style-guide/) - Information regarding the code styles you should follow when working on our projects.<br>
[Review Guide](../code-reviews-primer/) - A guide to get you started on doing code reviews.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ If you are confused by any of these rules, feel free to ask us in the `#dev-cont

1. **Lint before you push.** We have simple but strict style rules that are enforced through linting.
You must always lint your code before committing or pushing.
[Using tools](./supplemental-information/#linting-and-precommit) such as `precommit` or `black` can make this easier.
[Using tools](./supplemental-information/#linting-and-pre-commit) such as `flake8` and `pre-commit` can make this easier.
Make sure to follow our [style guide](../style-guide/) when contributing.
2. **Make great commits.**
Great commits should be atomic, with a commit message explaining what and why.
More on that can be found in [this section](./supplemental-information/#writing-good-commit-messages).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,22 @@ During PR review, it's not unusual for style adjustments to be requested.

[This page](../../style-guide/) will reference the differences between our projects and what is recommended by [PEP 8.](https://www.python.org/dev/peps/pep-0008/)

## Linting and Precommit
## Linting and Pre-commit

On most of our projects, we use `flake8` and `precommit` to ensure that the code style is consistent across the code base.
On most of our projects, we use `flake8` and `pre-commit` to ensure that the code style is consistent across the code base.

Running `flake8` will warn you about any potential style errors in your contribution.
You must always check it **before pushing**.
Your commit will be rejected by the build server if it fails to lint.

`precommit` is a powerful tool that helps you automatically lint before you commit.
**Some style rules are not enforced by flake8. Make sure to read the [style guide](../../style-guide/).**

`pre-commit` is a powerful tool that helps you automatically lint before you commit.
If the linter complains, the commit is aborted so that you can fix the linting errors before committing again.
That way, you never commit the problematic code in the first place!

Please refer to the project-specific documentation to see how to setup and run those tools.
In most cases, it is either `pipenv run [lint | precommit]` or `poetry run [lint | precommit]`.
In most cases, you can install pre-commit using `pipenv run precommit` or `poetry run task precommit`, and lint using `pipenv run lint` or `poetry run task lint`.

## Type Hinting

Expand Down

0 comments on commit da66151

Please sign in to comment.