project: Fix assert-false (B011)
Derived from flake8-bugbear, see https://docs.astral.sh/ruff/rules/assert-false/ Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
parent
8127067c63
commit
e05251a797
|
@ -920,7 +920,7 @@ class Alias(WestCommand):
|
|||
return parser
|
||||
|
||||
def do_run(self, args, ignored):
|
||||
assert False
|
||||
raise AssertionError("Alias command can't run directly")
|
||||
|
||||
class WestHelpAction(argparse.Action):
|
||||
|
||||
|
|
|
@ -294,7 +294,7 @@ class Configuration:
|
|||
self._system.set(option, value)
|
||||
else:
|
||||
# Shouldn't happen.
|
||||
assert False, configfile
|
||||
raise AssertionError(configfile)
|
||||
|
||||
@staticmethod
|
||||
def _create(path: Path) -> _InternalCF:
|
||||
|
|
|
@ -464,11 +464,12 @@ def _update_disabled_groups(disabled_groups: set[str],
|
|||
else:
|
||||
# We should never get here. This private helper is only
|
||||
# meant to be invoked on valid data.
|
||||
assert False, \
|
||||
(f"Unexpected group filter item {item}. "
|
||||
"This is a west bug. Please report it to the developers "
|
||||
"along with as much information as you can, such as the "
|
||||
"stack trace that preceded this message.")
|
||||
raise AssertionError(
|
||||
f"Unexpected group filter item {item}. "
|
||||
"This is a west bug. Please report it to the developers "
|
||||
"along with as much information as you can, such as the "
|
||||
"stack trace that preceded this message."
|
||||
)
|
||||
|
||||
def _is_submodule_dict_ok(subm: Any) -> bool:
|
||||
# Check whether subm is a dict that contains the expected
|
||||
|
|
|
@ -546,7 +546,7 @@ def test_update_tag_to_tag(west_init_tmpdir):
|
|||
p.revision = 'v2.0'
|
||||
break
|
||||
else:
|
||||
assert False, 'no tagged_repo'
|
||||
raise AssertionError('no tagged_repo')
|
||||
with open(west_init_tmpdir / 'zephyr' / 'west.yml', 'w') as f:
|
||||
f.write(manifest.as_yaml()) # NOT as_frozen_yaml().
|
||||
|
||||
|
|
Loading…
Reference in New Issue