Browse Source

scripts: west_commands: completion: Fix linter issues

Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
pull/90432/head
Pieter De Gendt 2 months ago committed by Benjamin Cabé
parent
commit
476a8c2c39
  1. 4
      .ruff-excludes.toml
  2. 4
      scripts/west_commands/completion.py

4
.ruff-excludes.toml

@ -1086,10 +1086,6 @@ @@ -1086,10 +1086,6 @@
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
"UP032", # https://docs.astral.sh/ruff/rules/f-string
]
"./scripts/west_commands/completion.py" = [
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
"UP032", # https://docs.astral.sh/ruff/rules/f-string
]
"./scripts/west_commands/debug.py" = [
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
"UP008", # https://docs.astral.sh/ruff/rules/super-call-with-parameters

4
scripts/west_commands/completion.py

@ -88,7 +88,7 @@ class Completion(WestCommand): @@ -88,7 +88,7 @@ class Completion(WestCommand):
cf += '.' + self._EXT_MAPPING[args.shell[0]]
try:
with open(cf, 'r') as f:
with open(cf) as f:
print(f.read())
except FileNotFoundError as e:
self.die('Unable to find completion file: {}'.format(e))
self.die(f'Unable to find completion file: {e}')

Loading…
Cancel
Save