]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
trivial: Use implicit string concatenation
authorStephen Finucane <stephen@that.guru>
Fri, 26 Oct 2018 09:34:34 +0000 (10:34 +0100)
committerStephen Finucane <stephen@that.guru>
Fri, 26 Oct 2018 09:42:01 +0000 (10:42 +0100)
While pycodestyle's W504 ("line break after binary operator") error was
recently disabled, it did highlight a number of areas where explicit
string concatenation was being used despite it not be necessary. Fix
these while we're aware of them.

[1] http://pycodestyle.pycqa.org/en/latest/intro.html#error-codes

Signed-off-by: Stephen Finucane <stephen@that.guru>
patchwork/filters.py
patchwork/forms.py
patchwork/parser.py
patchwork/tests/test_updates.py

index 99003072d44a1f60bb4095fd880f2d0b69b1dab3..79aaea437c6e3cd43ef5baf74f18c3578f8a83f8 100644 (file)
@@ -112,8 +112,8 @@ class SeriesFilter(Filter):
 
     @property
     def form(self):
-        return mark_safe(('<input type="text" name="series" ' +
-                          'id="series_input" class="form-control">'))
+        return mark_safe('<input type="text" name="series" '
+                         'id="series_input" class="form-control">')
 
 
 class SubmitterFilter(Filter):
@@ -178,8 +178,8 @@ class SubmitterFilter(Filter):
 
     @property
     def form(self):
-        return mark_safe(('<input type="text" name="submitter" ' +
-                          'id="submitter_input" class="form-control">'))
+        return mark_safe('<input type="text" name="submitter" '
+                         'id="submitter_input" class="form-control">')
 
 
 class StateFilter(Filter):
index f112dccc2185b98a93264bfbb5e0f8b234cf5956..5d4c920a80cdce6ca8b0da10319e2722aefd861e 100644 (file)
@@ -29,7 +29,7 @@ class RegistrationForm(forms.Form):
             User.objects.get(username__iexact=value)
         except User.DoesNotExist:
             return self.cleaned_data['username']
-        raise forms.ValidationError('This username is already taken. ' +
+        raise forms.ValidationError('This username is already taken. '
                                     'Please choose another.')
 
     def clean_email(self):
@@ -38,7 +38,7 @@ class RegistrationForm(forms.Form):
             user = User.objects.get(email__iexact=value)
         except User.DoesNotExist:
             return self.cleaned_data['email']
-        raise forms.ValidationError('This email address is already in use ' +
+        raise forms.ValidationError('This email address is already in use '
                                     'for the account "%s".\n' % user.username)
 
     def clean(self):
index bc9dae2f8b7ec70c5f4854ac5de2982cffa83919..6b7189cb138a7d21c92eb92d50c951ff8a119c2d 100644 (file)
@@ -867,7 +867,7 @@ def parse_patch(content):
 
 
 def parse_pull_request(content):
-    git_re = re.compile(r'^The following changes since commit.*' +
+    git_re = re.compile(r'^The following changes since commit.*'
                         r'^are available in the git repository at:\n'
                         r'^\s*([\S]+://[^\n]+)$',
                         re.DOTALL | re.MULTILINE | re.IGNORECASE)
index e136aeefe62e4ffec2851a736eb7a3d1276739be..a554e38bce776ba8fdde9e499f01f26c37f0166e 100644 (file)
@@ -97,7 +97,7 @@ class MultipleUpdateTest(TestCase):
         new_states = [Patch.objects.get(pk=p.pk).state for p in self.patches]
         self.assertEqual(new_states, orig_states)
         self.assertFormError(response, 'patchform', 'state',
-                             'Select a valid choice. That choice is not one ' +
+                             'Select a valid choice. That choice is not one '
                              'of the available choices.')
 
     def _test_delegate_change(self, delegate_str):