Skip to content

Commit 476a8c2

Browse files
pdgendtkartben
authored andcommitted
scripts: west_commands: completion: Fix linter issues
Fix issues reported by ruff. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
1 parent eba1203 commit 476a8c2

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

.ruff-excludes.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,10 +1086,6 @@
10861086
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
10871087
"UP032", # https://docs.astral.sh/ruff/rules/f-string
10881088
]
1089-
"./scripts/west_commands/completion.py" = [
1090-
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
1091-
"UP032", # https://docs.astral.sh/ruff/rules/f-string
1092-
]
10931089
"./scripts/west_commands/debug.py" = [
10941090
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
10951091
"UP008", # https://docs.astral.sh/ruff/rules/super-call-with-parameters

scripts/west_commands/completion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def do_run(self, args, unknown_args):
8888
cf += '.' + self._EXT_MAPPING[args.shell[0]]
8989

9090
try:
91-
with open(cf, 'r') as f:
91+
with open(cf) as f:
9292
print(f.read())
9393
except FileNotFoundError as e:
94-
self.die('Unable to find completion file: {}'.format(e))
94+
self.die(f'Unable to find completion file: {e}')

0 commit comments

Comments
 (0)