[CRIU] [PATCH 2/4] add a Makefile with a lint target

Tycho Andersen tycho.andersen at canonical.com
Thu Oct 22 10:50:55 PDT 2015


I find linting in python extremely useful since we don't really have a
compiler; here's a shortcut for linting.

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 Makefile        |  3 +++
 test/flake8.cfg | 10 ++++++++++
 2 files changed, 13 insertions(+)
 create mode 100644 Makefile
 create mode 100644 test/flake8.cfg

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..e440df7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,3 @@
+.PHONY: lint
+lint:
+	flake8 --config=./test/flake8.cfg p.haul p.haul-wrap phaul/*.py
diff --git a/test/flake8.cfg b/test/flake8.cfg
new file mode 100644
index 0000000..fff964a
--- /dev/null
+++ b/test/flake8.cfg
@@ -0,0 +1,10 @@
+[flake8]
+# W191 indentation contains tabs
+# E128 continuation line under-indented for visual indent
+# E225 missing whitespace around operator
+# E302 expected 2 blank lines, found 1
+# E501 line too long
+# E251 unexpected spaces around keyword / parameter equals
+# E301 expected 1 blank line, found 0
+# E101 indentation contains mixed spaces and tabs
+ignore = W191,E128,E225,E302,E501,E251,E301,E101
-- 
2.5.0



More information about the CRIU mailing list