This is an automated email from the git hooks/post-receive script.
nsoffer pushed a commit to branch master in repository sanlock.
commit aa7d0bf5b0f196a9340163f0aff89f6dbdf349f0 Author: Nir Soffer nsoffer@redhat.com AuthorDate: Fri Jun 14 19:53:17 2019 +0300
python: Add flak8 env
Flake8 provides basic linting and style checks for python code, helping to keep the source in good shape.
Running tox will run flake8 automatically, showing errors in the source and statistics for current issues. To run only flake8 tests use:
$ tox -e flake8
Running tox will fail now with these errors:
1 E203 whitespace before ',' 1 E265 block comment should start with '# ' 7 E302 expected 2 blank lines, found 1 1 E305 expected 2 blank lines after class or function definition, found 1 14 E501 line too long (82 > 79 characters) 1 F401 'stat' imported but unused 5 F403 'from .constants import *' used; unable to detect undefined names 44 F405 'MiB' may be undefined, or defined from star imports: .constants, .units 1 W391 blank line at end of file
Signed-off-by: Nir Soffer nsoffer@redhat.com --- .travis.yml | 4 ++++ README.dev | 4 ++++ tox.ini | 9 ++++++++- 3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml index 7b3fbe5..89fb52a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,11 @@ addons: - libblkid-dev - make
+install: + - pip install flake8 + script: - make BUILDARGS="--build-lib=." - source tests/env.sh - pytest + - flake8 --statistics tests python diff --git a/README.dev b/README.dev index cc2c613..8ade5e6 100644 --- a/README.dev +++ b/README.dev @@ -37,6 +37,10 @@ To run only tests matching the substring "foo":
$ tox -- -k foo
+To run basic lint and style check: + + $ tox -e flake8 +
Testing 4K support ================== diff --git a/tox.ini b/tox.ini index 5a48b23..0e337ce 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory.
[tox] -envlist = py27,py36 +envlist = py27,py36,flake8 skipsdist = True skip_missing_interpreters = True
@@ -22,6 +22,10 @@ commands = py36: make PY_VERSION=3.6 BUILDARGS="--build-lib={envsitepackagesdir}" pytest {posargs}
+[testenv:flake8] +deps = flake8 +commands = flake8 --statistics tests python + [pytest] # Notes: # --basetemp: we must use /var/tmp as sanlock uses direct I/O. @@ -29,3 +33,6 @@ commands = # -rxs: show extra test summary: (s)skipped, (x)failed # --durations: show slowest test duration addopts = -rxs -vv --basetemp=/var/tmp/sanlock --durations=10 + +[flake8] +show_source = True
sanlock-devel@lists.fedorahosted.org