From 2674e535f853ad36ea43680ad8a22297970e6515 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Mon, 5 Dec 2016 18:46:08 -0600 Subject: [PATCH] Run flake8 during CI --- .gitlab-ci.yml | 12 ++++++++++++ meshmode/discretization/connection/face.py | 4 ++-- meshmode/mesh/__init__.py | 11 ++++++----- setup.cfg | 1 + 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7c2f2c97..4668a2b0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,6 +10,7 @@ Python 2.7 AMD CPU: - amd-cl-cpu except: - tags + Python 2.7 POCL: script: - export PY_EXE=python2.7 @@ -22,6 +23,7 @@ Python 2.7 POCL: - pocl except: - tags + Python 3.5 POCL: script: - export PY_EXE=python3.5 @@ -34,6 +36,7 @@ Python 3.5 POCL: - pocl except: - tags + Documentation: script: - EXTRA_INSTALL="numpy" @@ -43,3 +46,12 @@ Documentation: - python3.5 only: - master + +Flake8: + script: + - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-flake8.sh + - ". ./prepare-and-run-flake8.sh meshmode test" + tags: + - python3.5 + except: + - tags diff --git a/meshmode/discretization/connection/face.py b/meshmode/discretization/connection/face.py index 52d7575d..124b4252 100644 --- a/meshmode/discretization/connection/face.py +++ b/meshmode/discretization/connection/face.py @@ -36,7 +36,7 @@ import logging logger = logging.getLogger(__name__) -class FRESTR_INTERIOR_FACES: +class FRESTR_INTERIOR_FACES: # noqa """A special value to pass to :func:`meshmode.discretization.connection.make_face_restriction` to produce a discretization consisting of all interior faces @@ -44,7 +44,7 @@ class FRESTR_INTERIOR_FACES: """ -class FRESTR_ALL_FACES: +class FRESTR_ALL_FACES: # noqa """A special value to pass to :func:`meshmode.discretization.connection.make_face_restriction` to produce a discretization consisting of all faces (interior and boundary) diff --git a/meshmode/mesh/__init__.py b/meshmode/mesh/__init__.py index da0fdfe2..81ec7ae2 100644 --- a/meshmode/mesh/__init__.py +++ b/meshmode/mesh/__init__.py @@ -59,12 +59,12 @@ Predefined Boundary tags # {{{ element tags -class BTAG_NONE(object): +class BTAG_NONE(object): # noqa """A boundary tag representing an empty boundary or volume.""" pass -class BTAG_ALL(object): +class BTAG_ALL(object): # noqa """A boundary tag representing the entire boundary or volume. In the case of the boundary, TAG_ALL does not include rank boundaries, @@ -72,7 +72,7 @@ class BTAG_ALL(object): pass -class BTAG_REALLY_ALL(object): +class BTAG_REALLY_ALL(object): # noqa """A boundary tag representing the entire boundary. Unlike :class:`TAG_ALL`, this includes rank boundaries, @@ -80,7 +80,7 @@ class BTAG_REALLY_ALL(object): pass -class BTAG_NO_BOUNDARY(object): +class BTAG_NO_BOUNDARY(object): # noqa """A boundary tag indicating that this edge should not fall under :class:`TAG_ALL`. Among other things, this is used to keep rank boundaries out of :class:`BTAG_ALL`. @@ -589,7 +589,8 @@ class Mesh(Record): assert nodal_adjacency.neighbors_starts.shape == (self.nelements+1,) assert len(nodal_adjacency.neighbors.shape) == 1 - assert nodal_adjacency.neighbors_starts.dtype == self.element_id_dtype + assert (nodal_adjacency.neighbors_starts.dtype + == self.element_id_dtype) assert nodal_adjacency.neighbors.dtype == self.element_id_dtype if facial_adjacency_groups: diff --git a/setup.cfg b/setup.cfg index 51292424..4abe1a05 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,4 @@ [flake8] ignore = E126,E127,E128,E123,E226,E241,E242,E265,W503,E402 max-line-length=85 +exclude=meshmode/mesh/refinement/__init__.py -- GitLab