diff options
| -rw-r--r-- | SUBMITTING_PATCHES.md | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/SUBMITTING_PATCHES.md b/SUBMITTING_PATCHES.md index 316cb620..c51fac0b 100644 --- a/SUBMITTING_PATCHES.md +++ b/SUBMITTING_PATCHES.md | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | - Make small logical changes. | 5 | - Make small logical changes. |
| 6 | - Provide a meaningful commit message. | 6 | - Provide a meaningful commit message. |
| 7 | - Check for coding errors and style nits with pyflakes and flake8 | 7 | - Check for coding errors and style nits with flake8. |
| 8 | - Make sure all code is under the Apache License, 2.0. | 8 | - Make sure all code is under the Apache License, 2.0. |
| 9 | - Publish your changes for review. | 9 | - Publish your changes for review. |
| 10 | - Make corrections if requested. | 10 | - Make corrections if requested. |
| @@ -38,39 +38,30 @@ If your description starts to get too long, that's a sign that you | |||
| 38 | probably need to split up your commit to finer grained pieces. | 38 | probably need to split up your commit to finer grained pieces. |
| 39 | 39 | ||
| 40 | 40 | ||
| 41 | ## Check for coding errors and style nits with pyflakes and flake8 | 41 | ## Check for coding errors and style violations with flake8 |
| 42 | 42 | ||
| 43 | ### Coding errors | 43 | Run `flake8` on changed modules: |
| 44 | |||
| 45 | Run `pyflakes` on changed modules: | ||
| 46 | |||
| 47 | pyflakes file.py | ||
| 48 | |||
| 49 | Ideally there should be no new errors or warnings introduced. | ||
| 50 | |||
| 51 | ### Style violations | ||
| 52 | |||
| 53 | Run `flake8` on changes modules: | ||
| 54 | 44 | ||
| 55 | flake8 file.py | 45 | flake8 file.py |
| 56 | 46 | ||
| 57 | Note that repo generally follows [Google's python style guide] rather than | 47 | Note that repo generally follows [Google's Python Style Guide] rather than |
| 58 | [PEP 8], with a couple of notable exceptions: | 48 | [PEP 8], with a couple of notable exceptions: |
| 59 | 49 | ||
| 60 | * Indentation is at 2 columns rather than 4 | 50 | * Indentation is at 2 columns rather than 4 |
| 61 | * The maximum line length is 100 columns rather than 80 | 51 | * The maximum line length is 100 columns rather than 80 |
| 62 | 52 | ||
| 63 | It's possible that the output of `flake8` will be quite noisy, so it's not | 53 | There should be no new errors or warnings introduced. |
| 64 | mandatory to avoid all warnings, but at least the maximum line length | ||
| 65 | should be followed. | ||
| 66 | 54 | ||
| 67 | If there are many occurrences of the same warning that cannot be | 55 | Warnings that cannot be avoided without going against the Google Style Guide |
| 68 | avoided without going against the Google style guide, these may be | 56 | may be suppressed inline individally using a `# noqa` comment as described |
| 69 | suppressed in the included `.flake8` file. | 57 | in the [flake8 documentation]. |
| 70 | 58 | ||
| 71 | [Google's python style guide]: https://google.github.io/styleguide/pyguide.html | 59 | If there are many occurrences of the same warning, these may be suppressed for |
| 72 | [PEP 8]: https://www.python.org/dev/peps/pep-0008/ | 60 | the entire project in the included `.flake8` file. |
| 73 | 61 | ||
| 62 | [Google's Python Style Guide]: https://google.github.io/styleguide/pyguide.html | ||
| 63 | [PEP 8]: https://www.python.org/dev/peps/pep-0008/ | ||
| 64 | [flake8 documentation]: https://flake8.pycqa.org/en/3.1.1/user/ignoring-errors.html#in-line-ignoring-errors | ||
| 74 | 65 | ||
| 75 | ## Running tests | 66 | ## Running tests |
| 76 | 67 | ||
