diff options
Diffstat (limited to 'SUBMITTING_PATCHES.md')
| -rw-r--r-- | SUBMITTING_PATCHES.md | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/SUBMITTING_PATCHES.md b/SUBMITTING_PATCHES.md index 5021e7ee..0c189247 100644 --- a/SUBMITTING_PATCHES.md +++ b/SUBMITTING_PATCHES.md | |||
| @@ -4,13 +4,13 @@ | |||
| 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. |
| 11 | - Verify your changes on gerrit so they can be submitted. | 11 | - Verify your changes on gerrit so they can be submitted. |
| 12 | 12 | ||
| 13 | `git push https://gerrit-review.googlesource.com/git-repo HEAD:refs/for/master` | 13 | `git push https://gerrit-review.googlesource.com/git-repo HEAD:refs/for/main` |
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | # Long Version | 16 | # Long Version |
| @@ -38,34 +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 | 44 | ||
| 45 | Run `pyflakes` on changed modules: | 45 | flake8 file.py |
| 46 | |||
| 47 | pyflakes file.py | ||
| 48 | 46 | ||
| 49 | Ideally there should be no new errors or warnings introduced. | 47 | Note that repo generally follows [Google's Python Style Guide] rather than |
| 48 | [PEP 8], with a couple of notable exceptions: | ||
| 50 | 49 | ||
| 51 | ### Style violations | 50 | * Indentation is at 2 columns rather than 4 |
| 51 | * The maximum line length is 100 columns rather than 80 | ||
| 52 | 52 | ||
| 53 | Run `flake8` on changes modules: | 53 | There should be no new errors or warnings introduced. |
| 54 | 54 | ||
| 55 | flake8 file.py | 55 | Warnings that cannot be avoided without going against the Google Style Guide |
| 56 | may be suppressed inline individally using a `# noqa` comment as described | ||
| 57 | in the [flake8 documentation]. | ||
| 56 | 58 | ||
| 57 | Note that repo generally follows [Google's python style guide] rather than | 59 | If there are many occurrences of the same warning, these may be suppressed for |
| 58 | [PEP 8], so it's possible that the output of `flake8` will be quite noisy. | 60 | the entire project in the included `.flake8` file. |
| 59 | It's not mandatory to avoid all warnings, but at least the maximum line | ||
| 60 | length should be followed. | ||
| 61 | 61 | ||
| 62 | If there are many occurrences of the same warning that cannot be | 62 | [Google's Python Style Guide]: https://google.github.io/styleguide/pyguide.html |
| 63 | avoided without going against the Google style guide, these may be | ||
| 64 | suppressed in the included `.flake8` file. | ||
| 65 | |||
| 66 | [Google's python style guide]: https://google.github.io/styleguide/pyguide.html | ||
| 67 | [PEP 8]: https://www.python.org/dev/peps/pep-0008/ | 63 | [PEP 8]: https://www.python.org/dev/peps/pep-0008/ |
| 68 | 64 | [flake8 documentation]: https://flake8.pycqa.org/en/3.1.1/user/ignoring-errors.html#in-line-ignoring-errors | |
| 69 | 65 | ||
| 70 | ## Running tests | 66 | ## Running tests |
| 71 | 67 | ||
| @@ -154,7 +150,7 @@ Push your patches over HTTPS to the review server, possibly through | |||
| 154 | a remembered remote to make this easier in the future: | 150 | a remembered remote to make this easier in the future: |
| 155 | 151 | ||
| 156 | git config remote.review.url https://gerrit-review.googlesource.com/git-repo | 152 | git config remote.review.url https://gerrit-review.googlesource.com/git-repo |
| 157 | git config remote.review.push HEAD:refs/for/master | 153 | git config remote.review.push HEAD:refs/for/main |
| 158 | 154 | ||
| 159 | git push review | 155 | git push review |
| 160 | 156 | ||
