From: Stephen Finucane Date: Fri, 26 Oct 2018 09:34:34 +0000 (+0100) Subject: trivial: Use implicit string concatenation X-Git-Tag: v2.2.0-rc1~232 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed2052cd7f4087774263159f85361c2e03b2c161;p=thirdparty%2Fpatchwork.git trivial: Use implicit string concatenation 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 --- diff --git a/patchwork/filters.py b/patchwork/filters.py index 99003072..79aaea43 100644 --- a/patchwork/filters.py +++ b/patchwork/filters.py @@ -112,8 +112,8 @@ class SeriesFilter(Filter): @property def form(self): - return mark_safe(('')) + return mark_safe('') class SubmitterFilter(Filter): @@ -178,8 +178,8 @@ class SubmitterFilter(Filter): @property def form(self): - return mark_safe(('')) + return mark_safe('') class StateFilter(Filter): diff --git a/patchwork/forms.py b/patchwork/forms.py index f112dccc..5d4c920a 100644 --- a/patchwork/forms.py +++ b/patchwork/forms.py @@ -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): diff --git a/patchwork/parser.py b/patchwork/parser.py index bc9dae2f..6b7189cb 100644 --- a/patchwork/parser.py +++ b/patchwork/parser.py @@ -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) diff --git a/patchwork/tests/test_updates.py b/patchwork/tests/test_updates.py index e136aeef..a554e38b 100644 --- a/patchwork/tests/test_updates.py +++ b/patchwork/tests/test_updates.py @@ -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):