[v2] zdtm: use flake8 to verify zdtm.py

Submitted by Andrey Vagin on June 3, 2016, 4:41 p.m.

Details

Message ID 20160603164142.GA19345@outlook.office365.com
State Rejected
Series "zdtm: use flake8 to verify zdtm.py"
Headers show

Commit Message

Andrey Vagin June 3, 2016, 4:41 p.m.
On Fri, Jun 03, 2016 at 09:06:51AM -0600, Tycho Andersen wrote:
> Hey Andrey,
>
> On Fri, Jun 03, 2016 at 05:33:48AM +0300, Andrey Vagin wrote:
> > From: Andrew Vagin <avagin@virtuozzo.com>
> >
> > and fix various warnings. For example, we mix tab and space indentations.
> >
> > v2: add flake8.cfg
> >
> > Cc: Tycho Andersen <tycho.andersen@canonical.com>
>
> Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
>
> This looks great to me, thanks for doing it. My only other suggestion
> would be to add it to travis, so that builds fail. Something like,

It's here already


>
> From 17bc6d48113ac3b4f5505f400bea9cb886652fc2 Mon Sep 17 00:00:00 2001
> From: Tycho Andersen <tycho.andersen@canonical.com>
> Date: Fri, 3 Jun 2016 09:05:46 -0600
> Subject: [PATCH] travis: run `make lint` to catch pep8 violations in zdtm.py
>
> Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
> ---
>  scripts/travis-tests | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/travis-tests b/scripts/travis-tests
> index fc7d050..b8fd7c0 100755
> --- a/scripts/travis-tests
> +++ b/scripts/travis-tests
> @@ -4,8 +4,9 @@ set -x -e
>  test "$1" = "x86_64" || exit 0
>
>  apt-get update -qq
> -apt-get install -qq protobuf-c-compiler libprotobuf-c0-dev libaio-dev libprotobuf-dev protobuf-compiler python-ipaddr libcap-dev libnl-3-dev
> +apt-get install -qq protobuf-c-compiler libprotobuf-c0-dev libaio-dev libprotobuf-dev protobuf-compiler python-ipaddr libcap-dev libnl-3-dev flake8
>  chmod a+x $HOME
>  make
> +make lint
>  make -C test/zdtm
>  python test/zdtm.py run -a -f h,ns -x 'cgroup*'
> --
> 2.7.4

Patch hide | download patch | download mbox

diff --git a/scripts/travis-tests b/scripts/travis-tests
index cb6ac1e..d579d9b 100755
--- a/scripts/travis-tests
+++ b/scripts/travis-tests
@@ -11,3 +11,6 @@  chmod a+x $HOME
 make
 make -C test/zdtm
 python test/zdtm.py run -a -f h,ns -x 'cgroup*'
+
+pip install flake8
+make lint

Comments

Tycho Andersen June 3, 2016, 4:42 p.m.
On Fri, Jun 03, 2016 at 09:41:42AM -0700, Andrew Vagin wrote:
> On Fri, Jun 03, 2016 at 09:06:51AM -0600, Tycho Andersen wrote:
> > Hey Andrey,
> >
> > On Fri, Jun 03, 2016 at 05:33:48AM +0300, Andrey Vagin wrote:
> > > From: Andrew Vagin <avagin@virtuozzo.com>
> > >
> > > and fix various warnings. For example, we mix tab and space indentations.
> > >
> > > v2: add flake8.cfg
> > >
> > > Cc: Tycho Andersen <tycho.andersen@canonical.com>
> >
> > Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
> >
> > This looks great to me, thanks for doing it. My only other suggestion
> > would be to add it to travis, so that builds fail. Something like,
> 
> It's here already

Oh, I missed it somehow. Looks good, thanks!

Tycho

> diff --git a/scripts/travis-tests b/scripts/travis-tests
> index cb6ac1e..d579d9b 100755
> --- a/scripts/travis-tests
> +++ b/scripts/travis-tests
> @@ -11,3 +11,6 @@ chmod a+x $HOME
>  make
>  make -C test/zdtm
>  python test/zdtm.py run -a -f h,ns -x 'cgroup*'
> +
> +pip install flake8
> +make lint
> 
> >
> > From 17bc6d48113ac3b4f5505f400bea9cb886652fc2 Mon Sep 17 00:00:00 2001
> > From: Tycho Andersen <tycho.andersen@canonical.com>
> > Date: Fri, 3 Jun 2016 09:05:46 -0600
> > Subject: [PATCH] travis: run `make lint` to catch pep8 violations in zdtm.py
> >
> > Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
> > ---
> >  scripts/travis-tests | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/scripts/travis-tests b/scripts/travis-tests
> > index fc7d050..b8fd7c0 100755
> > --- a/scripts/travis-tests
> > +++ b/scripts/travis-tests
> > @@ -4,8 +4,9 @@ set -x -e
> >  test "$1" = "x86_64" || exit 0
> >
> >  apt-get update -qq
> > -apt-get install -qq protobuf-c-compiler libprotobuf-c0-dev libaio-dev libprotobuf-dev protobuf-compiler python-ipaddr libcap-dev libnl-3-dev
> > +apt-get install -qq protobuf-c-compiler libprotobuf-c0-dev libaio-dev libprotobuf-dev protobuf-compiler python-ipaddr libcap-dev libnl-3-dev flake8
> >  chmod a+x $HOME
> >  make
> > +make lint
> >  make -C test/zdtm
> >  python test/zdtm.py run -a -f h,ns -x 'cgroup*'
> > --
> > 2.7.4