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

Nikita Spiridonov nspiridonov at odin.com
Thu Oct 22 11:08:05 PDT 2015


Acked-by: Nikita Spiridonov <nspiridonov at odin.com>

Tycho, thanks for the patch, I think we really need linting in p.haul.
We can reform code and get rid of some ignores as time goes by, for
example E302. I also dream of disallowing mixed tabs/spaces (E101), but
Pavel don't like that idea.

On Thu, 2015-10-22 at 11:50 -0600, Tycho Andersen wrote:
> 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




More information about the CRIU mailing list