Skip to content

Commit

Permalink
docs: state that we use the google style guide (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
dluo96 authored Nov 14, 2022
1 parent b1015e6 commit 98837d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ When contributing a new environment, make sure to do the following:


### Coding Style
To guarantee the quality and uniformisation of the code, we use various linters:
In general, we follow the [Google Style Guide](https://google.github.io/styleguide/pyguide.html).
In addition, to guarantee the quality and uniformity of the code, we use various linters:

- [Black](https://black.readthedocs.io/en/stable/#) is a deterministic code formatter that is compliant with PEP8 standards.
- [Isort](https://pycqa.github.io/isort/) sorts imports alphabetically and separates them into sections.
- [Flake8](https://flake8.pycqa.org/en/latest/) is a library that wraps PyFlakes and PyCodeStyle. It is a great toolkit for checking your codebase against coding style (PEP8), programming, and syntax errors. Flake8 also benefits from an ecosystem of plugins developed by the community that extend its capabilities. You can read more about Flake8 plugins on the documentation and find a curated list of plugins here.
- [MyPy](https://mypy.readthedocs.io/en/stable/#) is a static type checker that can help you detect inconsistent typing of variables.


#### Pre-Commit
To help in automating the quality of the code, we use [pre-commit](https://pre-commit.com/), a framework that manages the installation and execution of git hooks that will be run before every commit. These hooks help to automatically point out issues in code such as formatting mistakes, unused variables, trailing whitespace, debug statements, etc. By pointing these issues out before code review, it allows a code reviewer to focus on the architecture of a change while not wasting time with trivial style nitpicks. Each commit should be preceded by a call to pre-commit to ensure code quality and formatting. The configuration is in .pre-commit-config.yaml and includes Black, Flake8, MyPy and checks for the yaml formatting, trimming trailing whitespace, etc.
Try running: `pre-commit run --all-files`. All linters must pass before committing your change.
Expand Down

0 comments on commit 98837d5

Please sign in to comment.