From 376aafc83e75662968ec88283558e08536d40ec1 Mon Sep 17 00:00:00 2001 From: Sid <27780930+autinerd@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:43:58 +0200 Subject: [PATCH] Enable Ruff INP001 (#115082) --- homeassistant/components/knx/helpers/__init__.py | 1 + .../components/recorder/auto_repairs/states/__init__.py | 1 + pylint/ruff.toml | 5 +++++ pyproject.toml | 1 + script/scaffold/templates/ruff.toml | 6 ++++++ tests/testing_config/custom_components/ruff.toml | 6 ++++++ 6 files changed, 20 insertions(+) create mode 100644 homeassistant/components/knx/helpers/__init__.py create mode 100644 homeassistant/components/recorder/auto_repairs/states/__init__.py create mode 100644 script/scaffold/templates/ruff.toml create mode 100644 tests/testing_config/custom_components/ruff.toml diff --git a/homeassistant/components/knx/helpers/__init__.py b/homeassistant/components/knx/helpers/__init__.py new file mode 100644 index 00000000000..25d84406d03 --- /dev/null +++ b/homeassistant/components/knx/helpers/__init__.py @@ -0,0 +1 @@ +"""Helpers for KNX.""" diff --git a/homeassistant/components/recorder/auto_repairs/states/__init__.py b/homeassistant/components/recorder/auto_repairs/states/__init__.py new file mode 100644 index 00000000000..0429e0cab12 --- /dev/null +++ b/homeassistant/components/recorder/auto_repairs/states/__init__.py @@ -0,0 +1 @@ +"""States repairs for Recorder.""" diff --git a/pylint/ruff.toml b/pylint/ruff.toml index ebf53daa903..4e1a0388f31 100644 --- a/pylint/ruff.toml +++ b/pylint/ruff.toml @@ -1,6 +1,11 @@ # This extend our general Ruff rules specifically for tests extend = "../pyproject.toml" +[lint] +extend-ignore = [ + "INP001", # File is part of an implicit namespace package. Add an `__init__.py`. +] + [lint.isort] known-third-party = [ "pylint", diff --git a/pyproject.toml b/pyproject.toml index f6c7acb0a97..bcd0320d6f1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -627,6 +627,7 @@ select = [ "F", # pyflakes/autoflake "G", # flake8-logging-format "I", # isort + "INP", # flake8-no-pep420 "ISC", # flake8-implicit-str-concat "ICN001", # import concentions; {name} should be imported as {asname} "LOG", # flake8-logging diff --git a/script/scaffold/templates/ruff.toml b/script/scaffold/templates/ruff.toml new file mode 100644 index 00000000000..00a6d7ef849 --- /dev/null +++ b/script/scaffold/templates/ruff.toml @@ -0,0 +1,6 @@ +extend = "../../ruff.toml" + +[lint] +extend-ignore = [ + "INP001", # File is part of an implicit namespace package. Add an `__init__.py`. +] diff --git a/tests/testing_config/custom_components/ruff.toml b/tests/testing_config/custom_components/ruff.toml new file mode 100644 index 00000000000..00a6d7ef849 --- /dev/null +++ b/tests/testing_config/custom_components/ruff.toml @@ -0,0 +1,6 @@ +extend = "../../ruff.toml" + +[lint] +extend-ignore = [ + "INP001", # File is part of an implicit namespace package. Add an `__init__.py`. +]