Skip to content

Commit

Permalink
update CONTRIBUTING
Browse files Browse the repository at this point in the history
  • Loading branch information
MarquessV committed May 31, 2024
1 parent cadcd18 commit 6d777c3
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,14 @@ poetry install

### Style Guidelines

We use [Black](https://black.readthedocs.io/en/stable/index.html) and `flake8` to automatically
lint the code and enforce style requirements as part of the CI pipeline. You can run these style
tests yourself locally by running `make check-style` (to check for violations of the `flake8` rules)
and `make check-format` (to see if `black` would reformat the code) in the top-level directory of
the repository. If you aren't presented with any errors, then that means your code is good enough
for the linter (`flake8`) and formatter (`black`). If `make check-format` fails, it will present
you with a diff, which you can resolve by running `make format`. Black is very opinionated, but
saves a lot of time by removing the need for style nitpicks in PR review. We only deviate from its
default behavior in one category: we choose to use a line length of 100 rather than the Black
default of 88 (this is configured in the [`pyproject.toml`](pyproject.toml) file). As for `flake8`,
we ignore a couple of its rules (all for good reasons), and the specific configuration can be
found in the [`.flake8`](.flake8) file.
We use [ruff]() to enforce lint and formatting requireements as part of CI. You can run these
tests yourself locally by running `make check-style` (to check for violations of the linting rules)
and `make check-format` (to see if `ruff` would reformat the code) in the top-level directory of
the repository. If you aren't presented with any errors, then that means your code satisfies all
the linting and formatting requirements. If `make check-format` fails, it will present you with a
diff, which you can resolve by running `make format`. The ruff formatter is opinionated, but
saves a lot of time by removing the need for style nitpicks in PR review. The configuration for
`ruff` can be found in `pyproject.toml`.

In addition to linting and formatting, we use type hints for all parameters and return values,
following the [PEP 484 syntax][pep-484]. This is enforced as part of the CI via the command
Expand Down

0 comments on commit 6d777c3

Please sign in to comment.