[core] Enable ruff RSE (flake8-raise) lint family (#16649)

This commit is contained in:
J. Nick Koston
2026-05-25 20:06:34 -05:00
committed by GitHub
parent f1839489dd
commit bbc24ab546
6 changed files with 6 additions and 5 deletions

View File

@@ -81,7 +81,7 @@ def _process_single_config(config: dict[str, Any]) -> None:
elif conf[CONF_TYPE] == TYPE_LOCAL:
components_dir = Path(CORE.relative_config_path(conf[CONF_PATH]))
else:
raise NotImplementedError()
raise NotImplementedError
if config[CONF_COMPONENTS] == "all":
num_components = len(list(components_dir.glob("*/__init__.py")))

View File

@@ -236,7 +236,7 @@ async def to_code(config):
rhs = model.new()
var = cg.Pvariable(config[CONF_ID], rhs, model)
else:
raise NotImplementedError()
raise NotImplementedError
await display.register_display(var, config)
await spi.register_spi_device(var, config, write_only=True)

View File

@@ -1862,7 +1862,7 @@ def extract_keys(schema):
elif isinstance(skey, vol.Marker) and isinstance(skey.schema, str):
keys.append(skey.schema)
else:
raise ValueError()
raise ValueError
keys.sort()
return keys

View File

@@ -893,7 +893,7 @@ class MockObj(Expression):
def __getattr__(self, attr: str) -> "MockObj":
# prevent python dunder methods being replaced by mock objects
if attr.startswith("__"):
raise AttributeError()
raise AttributeError
next_op = "."
if attr.startswith("P") and self.op not in ["::", ""]:
attr = attr[1:]

View File

@@ -55,7 +55,7 @@ ESPHOME_DATA_EXTRA_CMAKE_KEY = "EXTRA_CMAKE"
class Source:
def download(self, dir_suffix: str, force: bool = False) -> Path:
raise NotImplementedError()
raise NotImplementedError
class URLSource(Source):

View File

@@ -125,6 +125,7 @@ select = [
"PERF", # performance
"PL", # pylint
"Q", # flake8-quotes
"RSE", # flake8-raise
"SIM", # flake8-simplify
"SLOT", # flake8-slots
"RET", # flake8-ret