diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 545c85b38960e3dad432b76a44f94412db08ede4..7599297d80e622a0d738baa646b43e66ae6c9eac 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -105,6 +105,8 @@
 
 Pylint:
   script:
+  # Needed to avoid name shadowing issues when running from source directory.
+  - PROJECT_INSTALL_FLAGS="--editable"
   - export PY_EXE=python3
   - EXTRA_INSTALL="pybind11 numpy mako matplotlib ipykernel ply fparser"
   - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-pylint.sh
@@ -137,13 +139,13 @@ Pylint:
 #   - python3
 #   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 loopy test"
-#   tags:
-#   - python3
-#   except:
-#   - tags
-# 
+ 
+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 loopy test"
+  tags:
+  - python3
+  except:
+  - tags
+
diff --git a/loopy/codegen/control.py b/loopy/codegen/control.py
index 45e2a18c4b93665275cc61f84b221a2a0e504d32..e1520a82ed69fa2aed729d9b1d849a78d658c4e1 100644
--- a/loopy/codegen/control.py
+++ b/loopy/codegen/control.py
@@ -503,7 +503,7 @@ def build_loop_nest(codegen_state, schedule_index):
 
                 prev_gen_code = gen_code
 
-                def gen_code(inner_codegen_state):
+                def gen_code(inner_codegen_state):  # noqa pylint:disable=function-redefined
                     condition_exprs = [
                             constraint_to_cond_expr(cns)
                             for cns in bounds_checks] + [
diff --git a/loopy/codegen/loop.py b/loopy/codegen/loop.py
index ebddf315373403b8afaf174d149872f5dcb4518e..58f055b7b5042ff28f7bf9674b0e7dc5ff1b6269 100644
--- a/loopy/codegen/loop.py
+++ b/loopy/codegen/loop.py
@@ -175,7 +175,7 @@ def generate_vectorize_loop(codegen_state, sched_index):
         warn(kernel, "vec_upper_not_const",
                 "upper bound for vectorized loop '%s' is not a constant, "
                 "cannot vectorize--unrolling instead")
-        return generate_unroll_loop(kernel, sched_index, codegen_state)
+        return generate_unroll_loop(codegen_state, sched_index)
 
     length = int(pw_aff_to_expr(length_aff))
 
@@ -190,7 +190,7 @@ def generate_vectorize_loop(codegen_state, sched_index):
         warn(kernel, "vec_lower_not_0",
                 "lower bound for vectorized loop '%s' is not zero, "
                 "cannot vectorize--unrolling instead")
-        return generate_unroll_loop(kernel, sched_index, codegen_state)
+        return generate_unroll_loop(codegen_state, sched_index)
 
     # {{{ 'implement' vectorization bounds
 
diff --git a/loopy/kernel/__init__.py b/loopy/kernel/__init__.py
index e3342d0f9d0cac2ef3c4e3d56423ce4b4ba0ac8a..42d7c0f1e2062f84ee171c8c6274a0aa74601a4a 100644
--- a/loopy/kernel/__init__.py
+++ b/loopy/kernel/__init__.py
@@ -121,15 +121,15 @@ class kernel_state(object):  # noqa
     """
 
     @_deperecated_kernel_state_class_method
-    def INITIAL():
-        return KernelState.INITITAL
+    def INITIAL():  # pylint:disable=no-method-argument
+        return KernelState.INITIAL
 
     @_deperecated_kernel_state_class_method
-    def PREPROCESSED():
+    def PREPROCESSED():  # pylint:disable=no-method-argument
         return KernelState.PREPROCESSED
 
     @_deperecated_kernel_state_class_method
-    def SCHEDULED():
+    def SCHEDULED():  # pylint:disable=no-method-argument
         return KernelState.SCHEDULED
 
 # }}}
@@ -1456,13 +1456,11 @@ class LoopKernel(ImmutableRecordWithoutPickling):
             # {{{ check that 'reconstituted' object has same hash
 
             from loopy.tools import LoopyKeyBuilder
-            LoopyKeyBuilder()(self)
-
-            assert p_hash_digest == self._pytools_persistent_hash_digest
+            assert p_hash_digest == LoopyKeyBuilder()(self)
 
             # }}}
-        else:
-            self._pytools_persistent_hash_digest = p_hash_digest
+
+        self._pytools_persistent_hash_digest = p_hash_digest
 
         from loopy.kernel.tools import SetOperationCacheManager
         self.cache_manager = SetOperationCacheManager()
diff --git a/loopy/target/c/__init__.py b/loopy/target/c/__init__.py
index 83efecf0eed38b2abc225ae0a892edd4c905214f..17dd9dc1034f4572e2bcf1d3abc806354c73336e 100644
--- a/loopy/target/c/__init__.py
+++ b/loopy/target/c/__init__.py
@@ -381,7 +381,7 @@ def c_math_mangler(target, name, arg_dtypes, modify_name=True):
                 pass  # fabs
             elif dtype == np.float32:
                 name = name + "f"  # fabsf
-            elif dtype == np.float128:
+            elif dtype == np.float128:  # pylint:disable=no-member
                 name = name + "l"  # fabsl
             else:
                 raise LoopyTypeError("%s does not support type %s" % (name, dtype))
@@ -407,7 +407,7 @@ def c_math_mangler(target, name, arg_dtypes, modify_name=True):
                     pass  # fmin
                 elif dtype == np.float32:
                     name = name + "f"  # fminf
-                elif dtype == np.float128:
+                elif dtype == np.float128:  # pylint:disable=no-member
                     name = name + "l"  # fminl
                 else:
                     raise LoopyTypeError("%s does not support type %s"
diff --git a/loopy/target/ispc.py b/loopy/target/ispc.py
index 5e59dff48de85626e01b7caf456a74a725ea508d..cccee2301e44b16e2454bda5e98af7db7893c003 100644
--- a/loopy/target/ispc.py
+++ b/loopy/target/ispc.py
@@ -404,7 +404,7 @@ class ISPCASTBuilder(CASTBuilder):
                     simplify_using_aff(kernel, idx) for idx in lhs.index_tuple)
 
             access_info = get_access_info(kernel.target, ary, index_tuple,
-                    lambda expr: evaluate(expr, self.codegen_state.var_subst_map),
+                    lambda expr: evaluate(expr, codegen_state.var_subst_map),
                     codegen_state.vectorization_info)
 
             from loopy.kernel.data import ArrayArg, TemporaryVariable
diff --git a/loopy/target/opencl.py b/loopy/target/opencl.py
index 81292fe6086d8034ca75c381af9cfa78d1415013..8a6e5284258d864d19d7f1353ec9dfaaa7d72a9b 100644
--- a/loopy/target/opencl.py
+++ b/loopy/target/opencl.py
@@ -607,7 +607,7 @@ class OpenCLCASTBuilder(CASTBuilder):
                     var_kind = "__global"
                 else:
                     raise LoopyError("unexpected kind of variable '%s' in "
-                            "atomic operation: "
+                            "atomic operation: '%s'"
                             % (lhs_var.name, type(lhs_var).__name__))
 
                 old_val = "*(%s *) &" % ctype + old_val
diff --git a/loopy/transform/precompute.py b/loopy/transform/precompute.py
index 52d568975216699f53b6a038d0ce775b89dbc4b0..f2b184a4119485e53d7dee14b1a322be45a0bfe3 100644
--- a/loopy/transform/precompute.py
+++ b/loopy/transform/precompute.py
@@ -997,13 +997,13 @@ def precompute(kernel, subst_use, sweep_inames=[], within=None,
 
         if len(temp_var.shape) != len(new_temp_shape):
             raise LoopyError("Existing and new temporary '%s' do not "
-                    "have matching number of dimensions "
+                    "have matching number of dimensions ('%d' vs. '%d') "
                     % (temporary_name,
                         len(temp_var.shape), len(new_temp_shape)))
 
         if temp_var.base_indices != (0,) * len(new_temp_shape):
             raise LoopyError("Existing and new temporary '%s' do not "
-                    "have matching number of dimensions "
+                    "have matching number of dimensions ('%d' vs. '%d') "
                     % (temporary_name,
                         len(temp_var.shape), len(new_temp_shape)))