Skip to content

Commit

Permalink
manual ruff check fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kdaily committed Dec 20, 2024
1 parent 1e6f1d2 commit d241c33
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion awscli/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _check_value(self, action, value):
for i in range(len(action.choices))[::self.ChoicesPerLine]:
current = []
for choice in action.choices[i:i+self.ChoicesPerLine]:
current.append('%-40s' % choice)
current.append(f'{choice:<40s}')
msg.append(' | '.join(current))
possible = get_close_matches(value, action.choices, cutoff=0.8)
if possible:
Expand Down
11 changes: 5 additions & 6 deletions awscli/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import shlex
import os
import os.path
import platform
import zipfile
import signal
import contextlib
Expand Down Expand Up @@ -418,11 +417,11 @@ def _parse_release_file(firstline):
return tuple(m.groups())

# Unknown format... take the first two words
l = firstline.strip().split()
if l:
version = l[0]
if len(l) > 1:
id = l[1]
line = firstline.strip().split()
if line:
version = line[0]
if len(line) > 1:
id = line[1]
return '', version, id

_distributor_id_file_re = re.compile(r"(?:DISTRIB_ID\s*=)\s*(.*)", re.I)
Expand Down
9 changes: 5 additions & 4 deletions awscli/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,11 @@ def assert_contains(self, contains):
def assert_contains_with_count(self, contains, count):
r_count = self.renderer.rendered_contents.count(contains)
if r_count != count:
self.fail("The expected contents:\n%s\n, with the "
"count:\n%d\nwere not in the actual rendered "
" contents:\n%s\nwith count:\n%d" % (
contains, count, self.renderer.rendered_contents, r_count))
self.fail(
f"The expected contents:\n{contains}\n, with the "
f"count:\n{count:d}\nwere not in the actual rendered "
f" contents:\n{self.renderer.rendered_contents}\nwith count:\n{r_count:d}"
)

def assert_not_contains(self, contents):
if contents in self.renderer.rendered_contents:
Expand Down

0 comments on commit d241c33

Please sign in to comment.