summaryrefslogtreecommitdiffstats
path: root/SUBMITTING_PATCHES.md
diff options
context:
space:
mode:
Diffstat (limited to 'SUBMITTING_PATCHES.md')
-rw-r--r--SUBMITTING_PATCHES.md40
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
38probably need to split up your commit to finer grained pieces. 38probably 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 43Run `flake8` on changed modules:
44 44
45Run `pyflakes` on changed modules: 45 flake8 file.py
46
47 pyflakes file.py
48 46
49Ideally there should be no new errors or warnings introduced. 47Note 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
53Run `flake8` on changes modules: 53There should be no new errors or warnings introduced.
54 54
55 flake8 file.py 55Warnings that cannot be avoided without going against the Google Style Guide
56may be suppressed inline individally using a `# noqa` comment as described
57in the [flake8 documentation].
56 58
57Note that repo generally follows [Google's python style guide] rather than 59If 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. 60the entire project in the included `.flake8` file.
59It's not mandatory to avoid all warnings, but at least the maximum line
60length should be followed.
61 61
62If there are many occurrences of the same warning that cannot be 62[Google's Python Style Guide]: https://google.github.io/styleguide/pyguide.html
63avoided without going against the Google style guide, these may be
64suppressed 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
154a remembered remote to make this easier in the future: 150a 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