summaryrefslogtreecommitdiffstats
path: root/SUBMITTING_PATCHES.md
diff options
context:
space:
mode:
Diffstat (limited to 'SUBMITTING_PATCHES.md')
-rw-r--r--SUBMITTING_PATCHES.md35
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
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
45Run `pyflakes` on changed modules:
46
47 pyflakes file.py
48
49Ideally there should be no new errors or warnings introduced.
50
51### Style violations
52
53Run `flake8` on changes modules:
54 44
55 flake8 file.py 45 flake8 file.py
56 46
57Note that repo generally follows [Google's python style guide] rather than 47Note 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
63It's possible that the output of `flake8` will be quite noisy, so it's not 53There should be no new errors or warnings introduced.
64mandatory to avoid all warnings, but at least the maximum line length
65should be followed.
66 54
67If there are many occurrences of the same warning that cannot be 55Warnings that cannot be avoided without going against the Google Style Guide
68avoided without going against the Google style guide, these may be 56may be suppressed inline individally using a `# noqa` comment as described
69suppressed in the included `.flake8` file. 57in the [flake8 documentation].
70 58
71[Google's python style guide]: https://google.github.io/styleguide/pyguide.html 59If there are many occurrences of the same warning, these may be suppressed for
72[PEP 8]: https://www.python.org/dev/peps/pep-0008/ 60the 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