aboutsummaryrefslogtreecommitdiff
path: root/SUBMITTING_PATCHES.md
diff options
context:
space:
mode:
authorDavid Pursehouse <dpursehouse@collab.net>2016-09-02 14:20:38 +0900
committerDavid Pursehouse <dpursehouse@collab.net>2016-09-14 09:49:02 +0200
commitbb5b1a076b86a67508bbcc94baf08deea50e1d09 (patch)
tree2a6778983b838539292134a72fb6a0ec77b39456 /SUBMITTING_PATCHES.md
parente01ee026e63688606183025606a4879146dba20a (diff)
downloadrepo-bb5b1a076b86a67508bbcc94baf08deea50e1d09.tar.gz
Replace pylint with pyflakes/flake8
pylint reports a lot of warnings, but many of them are false positive, and it's difficult to configure it. It also seems that for some reason the included config file is not working well with the latest version. Update the documentation to recommend using pyflakes and flake8 instead of pylint. Remove the pylint config and add a basic flake8 config with minimum settings: - Maximum line length 80 columns - Ignore warnings about indentation (repo uses 2 rather than expected 4) - Ignore warnings about import placement In this commit no code cleanup is done, and it's expected that most of the files will throw up quite a few warnings, at least for flake8. These can be cleaned up in follow-up commits. The existing pylint suppression comments are left as-is. These will be helpful when cleaning up pyflakes warnings later. Change-Id: I2f7cb4340266ed07cc973ca6483b8f09d66a765b
Diffstat (limited to 'SUBMITTING_PATCHES.md')
-rw-r--r--SUBMITTING_PATCHES.md28
1 files changed, 24 insertions, 4 deletions
diff --git a/SUBMITTING_PATCHES.md b/SUBMITTING_PATCHES.md
index 085ae06..07f7661 100644
--- a/SUBMITTING_PATCHES.md
+++ b/SUBMITTING_PATCHES.md
@@ -2,7 +2,7 @@
- Make small logical changes.
- Provide a meaningful commit message.
- - Check for coding errors with pylint
+ - Check for coding errors and style nits with pyflakes and flake8
- Make sure all code is under the Apache License, 2.0.
- Publish your changes for review.
- Make corrections if requested.
@@ -36,12 +36,32 @@ If your description starts to get too long, that's a sign that you
probably need to split up your commit to finer grained pieces.
-## Check for coding errors with pylint
+## Check for coding errors and style nits with pyflakes and flake8
-Run pylint on changed modules using the provided configuration:
+### Coding errors
- pylint --rcfile=.pylintrc file.py
+Run `pyflakes` on changed modules:
+ pyflakes file.py
+
+Ideally there should be no new errors or warnings introduced.
+
+### Style violations
+
+Run `flake8` on changes modules:
+
+ flake8 file.py
+
+Note that repo generally follows [Google's python style guide]
+(https://google.github.io/styleguide/pyguide.html) rather than [PEP 8]
+(https://www.python.org/dev/peps/pep-0008/), so it's possible that
+the output of `flake8` will be quite noisy. It's not mandatory to
+avoid all warnings, but at least the maximum line length should be
+followed.
+
+If there are many occurrences of the same warning that cannot be
+avoided without going against the Google style guide, these may be
+suppressed in the included `.flake8` file.
## Check the license