mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 11:07:33 +00:00
[core] Enable ruff RSE (flake8-raise) lint family (#16649)
This commit is contained in:
@@ -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")))
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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:]
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -125,6 +125,7 @@ select = [
|
||||
"PERF", # performance
|
||||
"PL", # pylint
|
||||
"Q", # flake8-quotes
|
||||
"RSE", # flake8-raise
|
||||
"SIM", # flake8-simplify
|
||||
"SLOT", # flake8-slots
|
||||
"RET", # flake8-ret
|
||||
|
||||
Reference in New Issue
Block a user