diff options
Diffstat (limited to 'SUBMITTING_PATCHES.md')
| -rw-r--r-- | SUBMITTING_PATCHES.md | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/SUBMITTING_PATCHES.md b/SUBMITTING_PATCHES.md index 085ae06a..07f76616 100644 --- a/SUBMITTING_PATCHES.md +++ b/SUBMITTING_PATCHES.md | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | - Make small logical changes. | 3 | - Make small logical changes. |
| 4 | - Provide a meaningful commit message. | 4 | - Provide a meaningful commit message. |
| 5 | - Check for coding errors with pylint | 5 | - Check for coding errors and style nits with pyflakes and flake8 |
| 6 | - Make sure all code is under the Apache License, 2.0. | 6 | - Make sure all code is under the Apache License, 2.0. |
| 7 | - Publish your changes for review. | 7 | - Publish your changes for review. |
| 8 | - Make corrections if requested. | 8 | - Make corrections if requested. |
| @@ -36,12 +36,32 @@ If your description starts to get too long, that's a sign that you | |||
| 36 | probably need to split up your commit to finer grained pieces. | 36 | probably need to split up your commit to finer grained pieces. |
| 37 | 37 | ||
| 38 | 38 | ||
| 39 | ## Check for coding errors with pylint | 39 | ## Check for coding errors and style nits with pyflakes and flake8 |
| 40 | 40 | ||
| 41 | Run pylint on changed modules using the provided configuration: | 41 | ### Coding errors |
| 42 | 42 | ||
| 43 | pylint --rcfile=.pylintrc file.py | 43 | Run `pyflakes` on changed modules: |
| 44 | 44 | ||
| 45 | pyflakes file.py | ||
| 46 | |||
| 47 | Ideally there should be no new errors or warnings introduced. | ||
| 48 | |||
| 49 | ### Style violations | ||
| 50 | |||
| 51 | Run `flake8` on changes modules: | ||
| 52 | |||
| 53 | flake8 file.py | ||
| 54 | |||
| 55 | Note that repo generally follows [Google's python style guide] | ||
| 56 | (https://google.github.io/styleguide/pyguide.html) rather than [PEP 8] | ||
| 57 | (https://www.python.org/dev/peps/pep-0008/), so it's possible that | ||
| 58 | the output of `flake8` will be quite noisy. It's not mandatory to | ||
| 59 | avoid all warnings, but at least the maximum line length should be | ||
| 60 | followed. | ||
| 61 | |||
| 62 | If there are many occurrences of the same warning that cannot be | ||
| 63 | avoided without going against the Google style guide, these may be | ||
| 64 | suppressed in the included `.flake8` file. | ||
| 45 | 65 | ||
| 46 | ## Check the license | 66 | ## Check the license |
| 47 | 67 | ||
