Skip to content

Commit 92a277f

Browse files
committed
ruff: Enable E5 check
... to enforce maximum line length, to keep consistent code format. Note that E501 check is disabled in test code now, until we decide how to update ~50 lines violating the limit due to too long names. Change-Id: I122c8b9035d6381dafb34438517c26b01e5201f5 Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
1 parent f8effe9 commit 92a277f

File tree

10 files changed

+41
-23
lines changed

10 files changed

+41
-23
lines changed

hacking/checks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ def assert_no_duplicated_setup(logical_line, filename):
6969
return
7070
yield (
7171
0,
72-
f"O401: client_manager.{service} mocks are already provided by "
73-
f"the {service} service's FakeClientMixin class",
72+
f"O401: client_manager.{service} mocks are already provided "
73+
f"by the {service} service's FakeClientMixin class",
7474
)
7575

7676

@@ -89,7 +89,7 @@ def assert_use_of_client_aliases(logical_line):
8989
yield (0, f"0402: prefer {service}_client to sdk_connection.{service}")
9090

9191
if match := re.match(
92-
r'(self\.app\.client_manager\.(compute|network|image)+\.[a-z_]+) = mock.Mock',
92+
r'(self\.app\.client_manager\.(compute|network|image)+\.[a-z_]+) = mock.Mock', # noqa: E501
9393
logical_line,
9494
):
9595
yield (

openstackclient/api/object_store_v1.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,10 @@ def object_create(
256256
# object's name in the container.
257257
object_name_str = name if name else object
258258

259-
full_url = f"{urllib.parse.quote(container)}/{urllib.parse.quote(object_name_str)}"
259+
full_url = (
260+
f"{urllib.parse.quote(container)}/"
261+
f"{urllib.parse.quote(object_name_str)}"
262+
)
260263
with open(object, 'rb') as f:
261264
response = self.create(
262265
full_url,

openstackclient/identity/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ def find_service_sdk(identity_client, name_type_or_id):
9999

100100
if next(services, None):
101101
msg = _(
102-
"Multiple service matches found for '%(query)s', use an ID to be more specific."
102+
"Multiple service matches found for '%(query)s', "
103+
"use an ID to be more specific."
103104
) % {"query": name_type_or_id}
104105
raise exceptions.CommandError(msg)
105106

openstackclient/identity/v3/group.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,9 @@ def take_action(self, parsed_args):
315315
parsed_args.user_domain,
316316
)
317317
if domain:
318-
# NOTE(0weng): The API doesn't actually support filtering additionally by domain_id,
319-
# so this doesn't really do anything.
318+
# NOTE(0weng): The API doesn't actually support filtering
319+
# additionally by domain_id, so this doesn't really do
320+
# anything.
320321
data = identity_client.user_groups(user, domain_id=domain)
321322
else:
322323
data = identity_client.user_groups(user)

openstackclient/identity/v3/user.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,8 @@ def get_parser(self, prog_name):
420420
dest='is_enabled',
421421
default=None,
422422
help=_(
423-
'List only enabled users, does nothing with --project and --group'
423+
'List only enabled users, does nothing with '
424+
'--project and --group'
424425
),
425426
)
426427
parser.add_argument(
@@ -429,7 +430,8 @@ def get_parser(self, prog_name):
429430
dest='is_enabled',
430431
default=None,
431432
help=_(
432-
'List only disabled users, does nothing with --project and --group'
433+
'List only disabled users, does nothing with '
434+
'--project and --group'
433435
),
434436
)
435437
return parser

openstackclient/image/v2/metadef_properties.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ def get_parser(self, prog_name):
127127
nargs="*",
128128
help=_(
129129
"Metadef properties to delete (name) "
130-
"(omit this argument to delete all properties in the namespace)"
130+
"(omit this argument to delete all properties "
131+
"in the namespace)"
131132
),
132133
)
133134
return parser

openstackclient/volume/v2/volume_type.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ def get_parser(self, prog_name):
171171
default=False,
172172
help=_(
173173
"Enabled replication for this volume type "
174-
"(this is an alias for '--property replication_enabled=<is> True') "
174+
"(this is an alias for "
175+
"'--property replication_enabled=<is> True') "
175176
"(requires driver support)"
176177
),
177178
)
@@ -181,7 +182,8 @@ def get_parser(self, prog_name):
181182
dest='availability_zones',
182183
help=_(
183184
"Set an availability zone for this volume type "
184-
"(this is an alias for '--property RESKEY:availability_zones:<az>') "
185+
"(this is an alias for "
186+
"'--property RESKEY:availability_zones:<az>') "
185187
"(repeat option to set multiple availability zones)"
186188
),
187189
)
@@ -534,7 +536,8 @@ def get_parser(self, prog_name):
534536
default=False,
535537
help=_(
536538
"Enabled replication for this volume type "
537-
"(this is an alias for '--property replication_enabled=<is> True') "
539+
"(this is an alias for "
540+
"'--property replication_enabled=<is> True') "
538541
"(requires driver support)"
539542
),
540543
)
@@ -544,7 +547,8 @@ def get_parser(self, prog_name):
544547
dest='availability_zones',
545548
help=_(
546549
"Set an availability zone for this volume type "
547-
"(this is an alias for '--property RESKEY:availability_zones:<az>') "
550+
"(this is an alias for "
551+
"'--property RESKEY:availability_zones:<az>') "
548552
"(repeat option to set multiple availability zones)"
549553
),
550554
)

openstackclient/volume/v3/volume_attachment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ def take_action(self, parsed_args):
458458
}
459459
# Update search option with `filters`
460460
# if AppendFilters.filters:
461-
# search_opts.update(shell_utils.extract_filters(AppendFilters.filters))
461+
# search_opts.update(shell_utils.extract_filters(AppendFilters.filters)) # noqa: E501
462462

463463
# TODO(stephenfin): Implement sorting
464464
attachments = volume_client.attachments(

openstackclient/volume/v3/volume_type.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ def get_parser(self, prog_name):
172172
default=False,
173173
help=_(
174174
"Enabled replication for this volume type "
175-
"(this is an alias for '--property replication_enabled=<is> True') "
175+
"(this is an alias for "
176+
"'--property replication_enabled=<is> True') "
176177
"(requires driver support)"
177178
),
178179
)
@@ -182,7 +183,8 @@ def get_parser(self, prog_name):
182183
dest='availability_zones',
183184
help=_(
184185
"Set an availability zone for this volume type "
185-
"(this is an alias for '--property RESKEY:availability_zones:<az>') "
186+
"(this is an alias for "
187+
"'--property RESKEY:availability_zones:<az>') "
186188
"(repeat option to set multiple availability zones)"
187189
),
188190
)
@@ -447,7 +449,8 @@ def get_parser(self, prog_name):
447449
default=False,
448450
help=_(
449451
"List only volume types with replication enabled "
450-
"(this is an alias for '--property replication_enabled=<is> True') "
452+
"(this is an alias for "
453+
"'--property replication_enabled=<is> True') "
451454
"(supported by --os-volume-api-version 3.52 or above)"
452455
),
453456
)
@@ -457,7 +460,8 @@ def get_parser(self, prog_name):
457460
dest='availability_zones',
458461
help=_(
459462
"List only volume types with this availability configured "
460-
"(this is an alias for '--property RESKEY:availability_zones:<az>') "
463+
"(this is an alias for "
464+
"'--property RESKEY:availability_zones:<az>') "
461465
"(repeat option to filter on multiple availability zones)"
462466
),
463467
)
@@ -616,7 +620,8 @@ def get_parser(self, prog_name):
616620
default=False,
617621
help=_(
618622
"Enabled replication for this volume type "
619-
"(this is an alias for '--property replication_enabled=<is> True') "
623+
"(this is an alias for "
624+
"'--property replication_enabled=<is> True') "
620625
"(requires driver support)"
621626
),
622627
)
@@ -626,7 +631,8 @@ def get_parser(self, prog_name):
626631
dest='availability_zones',
627632
help=_(
628633
"Set an availability zone for this volume type "
629-
"(this is an alias for '--property RESKEY:availability_zones:<az>') "
634+
"(this is an alias for "
635+
"'--property RESKEY:availability_zones:<az>') "
630636
"(repeat option to set multiple availability zones)"
631637
),
632638
)

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ quote-style = "preserve"
749749
docstring-code-format = true
750750

751751
[tool.ruff.lint]
752-
select = ["E4", "E7", "E9", "F", "S", "UP"]
752+
select = ["E4", "E5", "E7", "E9", "F", "S", "UP"]
753753

754754
[tool.ruff.lint.per-file-ignores]
755-
"openstackclient/tests/*" = ["S"]
755+
"openstackclient/tests/*" = ["E501", "S"]

0 commit comments

Comments
 (0)