Adds flake8 and fixes style issues

This commit is contained in:
Sergi Delgado Segura
2020-03-31 11:57:25 +02:00
parent 03c8ad8c87
commit b56123055d
21 changed files with 103 additions and 401 deletions

View File

@@ -8,6 +8,15 @@ We use [black](https://github.com/psf/black) as our base code formatter with a l
```bash
black --line-length=120 {source_file_or_directory}
```
In additon, we use [flake8](https://flake8.pycqa.org/en/latest/) to detect style issues with the code:
```bash
flake8 --max-line-length=120 {source_file_or_directory}
```
Not all outputs from flake8 are mandatory. For instance, splitting **bullet points in docstrings (E501)** will cause issues when generating the docuementation, so we will leave that longer than the line lenght limit . Another example are **whitespaces before colons in inline fors (E203)**. `black` places them in that way, so we'll leave them like that.
On top of that, there are a few rules to also have in mind.
### Code Spacing