diff --git a/sumpy/__init__.py b/sumpy/__init__.py
index 8bece3a2dccde8dc6bf6a2b0d41eef20dfb3d1f2..fd0fc5154e04882ef45a0d6f8e282362e6f39f27 100644
--- a/sumpy/__init__.py
+++ b/sumpy/__init__.py
@@ -61,8 +61,7 @@ CACHING_ENABLED = True
 
 CACHING_ENABLED = (
     "SUMPY_NO_CACHE" not in os.environ
-    and
-    "CG_NO_CACHE" not in os.environ)
+    and "CG_NO_CACHE" not in os.environ)
 
 
 def set_caching_enabled(flag):
diff --git a/sumpy/assignment_collection.py b/sumpy/assignment_collection.py
index a12a17fd84b7158628c120a4626464fd288940bb..96d078a0f55b5d34e5a08231e28b7f5d9e94f089 100644
--- a/sumpy/assignment_collection.py
+++ b/sumpy/assignment_collection.py
@@ -51,7 +51,7 @@ class _SymbolGenerator(object):
     def _normalize(self, base):
         # Strip off any _N suffix, to avoid generating conflicting names.
         import re
-        base = re.split("_\d+$", base)[0]
+        base = re.split(r"_\d+$", base)[0]
         return base if base != "" else "expr"
 
     def __call__(self, base="expr"):
diff --git a/sumpy/expansion/level_to_order.py b/sumpy/expansion/level_to_order.py
index 44d86ee236a8db894f76320516552c6b69588c69..8f012e55827f7676e2429f76502f5146c085387c 100644
--- a/sumpy/expansion/level_to_order.py
+++ b/sumpy/expansion/level_to_order.py
@@ -131,7 +131,7 @@ class SimpleExpansionOrderFinder(object):
 
         laplace_order = int(np.ceil(
                 (np.log(self.tol) - np.log(self.err_const_laplace))
-                /
+                /  # noqa: W504
                 np.log(
                     np.sqrt(tree.dimensions)/3
                     ) - 1))
diff --git a/sumpy/kernel.py b/sumpy/kernel.py
index 3ce0bb8d3b654ca564ad672ef2417815be2a5eec..99222f684340fe1f36d888355a24cbffe29573c0 100644
--- a/sumpy/kernel.py
+++ b/sumpy/kernel.py
@@ -600,7 +600,7 @@ class StokesletKernel(ExpressionKernel):
             r = pymbolic_real_norm_2(d)
             expr = (
                 -var("log")(r)*(1 if icomp == jcomp else 0)
-                +
+                +  # noqa: W504
                 d[icomp]*d[jcomp]/r**2
                 )
             scaling = -1/(4*var("pi")*mu)
@@ -610,7 +610,7 @@ class StokesletKernel(ExpressionKernel):
             r = pymbolic_real_norm_2(d)
             expr = (
                 (1/r)*(1 if icomp == jcomp else 0)
-                +
+                +  # noqa: W504
                 d[icomp]*d[jcomp]/r**3
                 )
             scaling = -1/(8*var("pi")*mu)
diff --git a/sumpy/p2p.py b/sumpy/p2p.py
index d8fdadf45bbd7bedd9d0da6e3353e479cd107e3b..4c4eb945bb90d2d71bcb5ed3327d744e4ad26391 100644
--- a/sumpy/p2p.py
+++ b/sumpy/p2p.py
@@ -136,10 +136,10 @@ class P2PBase(KernelComputation, KernelCacheWrapper):
                 lp.GlobalArg("targets", None,
                    shape=(self.dim, "ntargets")),
                 lp.ValueArg("nsources", None),
-                lp.ValueArg("ntargets", None)] +
-                ([lp.GlobalArg("target_to_source", None, shape=("ntargets",))]
-                    if self.exclude_self else []) +
-                gather_loopy_source_arguments(self.kernels))
+                lp.ValueArg("ntargets", None)]
+                + ([lp.GlobalArg("target_to_source", None, shape=("ntargets",))]
+                    if self.exclude_self else [])
+                + gather_loopy_source_arguments(self.kernels))
 
     def get_kernel(self):
         raise NotImplementedError
@@ -171,8 +171,8 @@ class P2P(P2PBase):
         loopy_insns, result_names = self.get_loopy_insns_and_result_names()
         kernel_exprs = self.get_kernel_exprs(result_names)
         arguments = (
-            self.get_default_src_tgt_arguments() +
-            [
+            self.get_default_src_tgt_arguments()
+            + [
                 lp.GlobalArg("strength", None,
                     shape="nstrengths, nsources", dim_tags="sep,C"),
                 lp.GlobalArg("result", None,
@@ -241,8 +241,8 @@ class P2PMatrixGenerator(P2PBase):
         loopy_insns, result_names = self.get_loopy_insns_and_result_names()
         kernel_exprs = self.get_kernel_exprs(result_names)
         arguments = (
-            self.get_default_src_tgt_arguments() +
-            [lp.GlobalArg("result_%d" % i, dtype,
+            self.get_default_src_tgt_arguments()
+            + [lp.GlobalArg("result_%d" % i, dtype,
                 shape="ntargets,nsources")
              for i, dtype in enumerate(self.value_dtypes)])
 
@@ -307,13 +307,13 @@ class P2PMatrixBlockGenerator(P2PBase):
         loopy_insns, result_names = self.get_loopy_insns_and_result_names()
         kernel_exprs = self.get_kernel_exprs(result_names)
         arguments = (
-            self.get_default_src_tgt_arguments() +
-            [
+            self.get_default_src_tgt_arguments()
+            + [
                 lp.GlobalArg("srcindices", None, shape="nresult"),
                 lp.GlobalArg("tgtindices", None, shape="nresult"),
                 lp.ValueArg("nresult", None)
-            ] +
-            [lp.GlobalArg("result_%d" % i, dtype, shape="nresult")
+            ]
+            + [lp.GlobalArg("result_%d" % i, dtype, shape="nresult")
              for i, dtype in enumerate(self.value_dtypes)])
 
         loopy_knl = lp.make_kernel(
@@ -415,8 +415,8 @@ class P2PFromCSR(P2PBase):
         loopy_insns, result_names = self.get_loopy_insns_and_result_names()
         kernel_exprs = self.get_kernel_exprs(result_names)
         arguments = (
-            self.get_default_src_tgt_arguments() +
-            [
+            self.get_default_src_tgt_arguments()
+            + [
                 lp.GlobalArg("box_target_starts",
                     None, shape=None),
                 lp.GlobalArg("box_target_counts_nonchild",
diff --git a/sumpy/qbx.py b/sumpy/qbx.py
index 79de1544a8355940303f234ba121d31e84a136cb..0d4359b6566e146d66f717d25c92569803893d0d 100644
--- a/sumpy/qbx.py
+++ b/sumpy/qbx.py
@@ -158,8 +158,8 @@ class LayerPotentialBase(KernelComputation, KernelCacheWrapper):
                 lp.GlobalArg("expansion_radii",
                     None, shape="ntargets"),
                 lp.ValueArg("nsources", None),
-                lp.ValueArg("ntargets", None)] +
-                gather_loopy_source_arguments(self.kernels))
+                lp.ValueArg("ntargets", None)]
+                + gather_loopy_source_arguments(self.kernels))
 
     def get_kernel(self):
         raise NotImplementedError
@@ -201,11 +201,11 @@ class LayerPotential(LayerPotentialBase):
         loopy_insns, result_names = self.get_loopy_insns_and_result_names()
         kernel_exprs = self.get_kernel_exprs(result_names)
         arguments = (
-            self.get_default_src_tgt_arguments() +
-            [lp.GlobalArg("strength_%d" % i,
+            self.get_default_src_tgt_arguments()
+            + [lp.GlobalArg("strength_%d" % i,
                 None, shape="nsources", order="C")
-            for i in range(self.strength_count)] +
-            [lp.GlobalArg("result_%d" % i,
+            for i in range(self.strength_count)]
+            + [lp.GlobalArg("result_%d" % i,
                 None, shape="ntargets", order="C")
             for i in range(len(self.kernels))])
 
@@ -275,8 +275,8 @@ class LayerPotentialMatrixGenerator(LayerPotentialBase):
         loopy_insns, result_names = self.get_loopy_insns_and_result_names()
         kernel_exprs = self.get_kernel_exprs(result_names)
         arguments = (
-            self.get_default_src_tgt_arguments() +
-            [lp.GlobalArg("result_%d" % i,
+            self.get_default_src_tgt_arguments()
+            + [lp.GlobalArg("result_%d" % i,
                 dtype, shape="ntargets, nsources", order="C")
              for i, dtype in enumerate(self.value_dtypes)])
 
@@ -339,13 +339,13 @@ class LayerPotentialMatrixBlockGenerator(LayerPotentialBase):
         loopy_insns, result_names = self.get_loopy_insns_and_result_names()
         kernel_exprs = self.get_kernel_exprs(result_names)
         arguments = (
-            self.get_default_src_tgt_arguments() +
-            [
+            self.get_default_src_tgt_arguments()
+            + [
                 lp.GlobalArg("srcindices", None, shape="nresult"),
                 lp.GlobalArg("tgtindices", None, shape="nresult"),
                 lp.ValueArg("nresult", None)
-            ] +
-            [lp.GlobalArg("result_%d" % i, dtype, shape="nresult")
+            ]
+            + [lp.GlobalArg("result_%d" % i, dtype, shape="nresult")
              for i, dtype in enumerate(self.value_dtypes)])
 
         loopy_knl = lp.make_kernel([
diff --git a/sumpy/toys.py b/sumpy/toys.py
index 5177d869e99c62ebd5035037ae00a532411d00ff..9bc68ae5e480f043ec4fbc4636839ee0a69d2b45 100644
--- a/sumpy/toys.py
+++ b/sumpy/toys.py
@@ -564,8 +564,7 @@ def combine_inner_outer(psource_inner, psource_outer, radius, center=None):
     ball_one = OneOnBallPotential(psource_inner.toy_ctx, center, radius)
     return (
             psource_inner * ball_one
-            +
-            psource_outer * (1 - ball_one))
+            + psource_outer * (1 - ball_one))
 
 
 def combine_halfspace(psource_pos, psource_neg, axis, center=None):
@@ -575,8 +574,7 @@ def combine_halfspace(psource_pos, psource_neg, axis, center=None):
     halfspace_one = HalfspaceOnePotential(psource_pos.toy_ctx, center, axis)
     return (
         psource_pos * halfspace_one
-        +
-        psource_neg * (1-halfspace_one))
+        + psource_neg * (1-halfspace_one))
 
 
 def combine_halfspace_and_outer(psource_pos, psource_neg, psource_outer,
diff --git a/test/test_cse.py b/test/test_cse.py
index d6a2c0f05cb1c4512fa3a8b26b6a2654a7ed1ea3..703e8c9f93ca2069c273ead893a00ed0ba3dc697 100644
--- a/test/test_cse.py
+++ b/test/test_cse.py
@@ -134,8 +134,8 @@ def test_cse_not_possible():
     assert substs == []
     assert reduced == [x + y]
     # issue 6329
-    eq = (meijerg((1, 2), (y, 4), (5,), [], x) +
-          meijerg((1, 3), (y, 4), (5,), [], x))
+    eq = (meijerg((1, 2), (y, 4), (5,), [], x)
+          + meijerg((1, 3), (y, 4), (5,), [], x))
     assert cse(eq) == ([], [eq])
 
 
@@ -251,9 +251,9 @@ def test_issue_4499():
     from sympy import Tuple, S
     B = Function('B')  # noqa
     G = Function('G')  # noqa
-    t = Tuple(*
-        (a, a + S(1)/2, 2*a, b, 2*a - b + 1, (sqrt(z)/2)**(-2*a + 1)*B(2*a -
-        b, sqrt(z))*B(b - 1, sqrt(z))*G(b)*G(2*a - b + 1),
+    t = Tuple(
+        *(a, a + S(1)/2, 2*a, b, 2*a - b + 1, (sqrt(z)/2)**(-2*a + 1)*B(2*a
+        - b, sqrt(z))*B(b - 1, sqrt(z))*G(b)*G(2*a - b + 1),
         sqrt(z)*(sqrt(z)/2)**(-2*a + 1)*B(b, sqrt(z))*B(2*a - b,
         sqrt(z))*G(b)*G(2*a - b + 1), sqrt(z)*(sqrt(z)/2)**(-2*a + 1)*B(b - 1,
         sqrt(z))*B(2*a - b + 1, sqrt(z))*G(b)*G(2*a - b + 1),
diff --git a/test/test_matrixgen.py b/test/test_matrixgen.py
index 01ebaa0eb290fcc1cc392c866c8b2e8994dd420c..2c07b40a5c753e6c362be61263f0bf388784fc4a 100644
--- a/test/test_matrixgen.py
+++ b/test/test_matrixgen.py
@@ -251,8 +251,8 @@ def test_p2p_direct(ctx_getter, exclude_self, factor, lpot_id):
 
         index_set = index_set.get(queue)
         for i in range(index_set.nblocks):
-            assert la.norm(index_set.block_take(blk, i) -
-                           index_set.take(mat, i)) < eps
+            assert la.norm(index_set.block_take(blk, i)
+                           - index_set.take(mat, i)) < eps
 
 
 # You can test individual routines by typing