From 084cf03591f469ece2d8796606096a9de37647be Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sun, 10 Dec 2023 00:26:29 -0500 Subject: [PATCH] chore: Fix E501 --- postcodes/management/commands/loadpostcodeconcordance.py | 5 ++++- postcodes/management/commands/loadpostcodes.py | 5 ++++- postcodes/models.py | 9 +++++++-- setup.cfg | 4 +--- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/postcodes/management/commands/loadpostcodeconcordance.py b/postcodes/management/commands/loadpostcodeconcordance.py index 5b8266d..4d64ab0 100644 --- a/postcodes/management/commands/loadpostcodeconcordance.py +++ b/postcodes/management/commands/loadpostcodeconcordance.py @@ -31,7 +31,10 @@ def add_arguments(self, parser): action='store', dest='search-field', default='external_id', - help="Set the SQL column to which the second column of the CSV corresponds. One of 'external_id' (default), 'name' or 'slug'.", + help=( + "Set the SQL column to which the second column of the CSV corresponds. " + "One of 'external_id' (default), 'name' or 'slug'." + ), ) @transaction.atomic diff --git a/postcodes/management/commands/loadpostcodes.py b/postcodes/management/commands/loadpostcodes.py index 6ebd9f3..bbe3022 100644 --- a/postcodes/management/commands/loadpostcodes.py +++ b/postcodes/management/commands/loadpostcodes.py @@ -12,7 +12,10 @@ class Command(BaseCommand): - help = 'Imports a headerless CSV file with columns for code,latitude,longitude,locality,region. If no filename is given, reads from standard input.' + help = ( + 'Imports a headerless CSV file with columns for code,latitude,longitude,locality,region. ' + 'If no filename is given, reads from standard input.' + ) def add_arguments(self, parser): parser.add_argument('filename', nargs='?') diff --git a/postcodes/models.py b/postcodes/models.py index ceb00ca..92b04e3 100644 --- a/postcodes/models.py +++ b/postcodes/models.py @@ -104,7 +104,10 @@ def get_boundaries(self, sets=None): concordance_sets = set() if concordances: - q = ((models.Q(set=concordance.split('/')[0]) & models.Q(slug=concordance.split('/')[1])) for concordance in concordances) + q = ( + (models.Q(set=concordance.split('/')[0]) & models.Q(slug=concordance.split('/')[1])) + for concordance in concordances + ) boundaries = Boundary.objects.filter(reduce(lambda a, b: a | b, q)) boundaries = Boundary.prepare_queryset_for_get_dicts(boundaries) @@ -125,7 +128,9 @@ def get_boundaries(self, sets=None): boundaries = Boundary.prepare_queryset_for_get_dicts(boundaries) boundaries = Boundary.get_dicts(boundaries) - r['boundaries_centroid'] = [boundary for boundary in boundaries if boundary['related']['boundary_set_url'] not in concordance_sets] + r['boundaries_centroid'] = [ + boundary for boundary in boundaries if boundary['related']['boundary_set_url'] not in concordance_sets + ] return r diff --git a/setup.cfg b/setup.cfg index a00ed92..2ad743f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,7 +19,5 @@ install_requires = profile = black [flake8] +max-line-length = 119 exclude = postcodes/migrations -extend-ignore = - # E501 line too long (X > 79 characters) - E501