diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c704cb61d..55d54d58b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -54,3 +54,22 @@ repos: types: [python] require_serial: true files: ^xknx/.+\.py$ + + - repo: local + hooks: + - id: pylint-xknx + name: pylint-xknx + entry: pylint xknx examples + language: python + types: [python] + pass_filenames: true + files: ^(xknx/|examples/) + + - id: pylint-test + name: pylint-test + entry: pylint --disable=protected-access,abstract-class-instantiated + language: python + types: [python] + pass_filenames: true + files: ^test/ + diff --git a/pyproject.toml b/pyproject.toml index 73f8a269d..6b8c05ebe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,10 +61,11 @@ warn_unreachable = true [tool.pylint.master] -ignore = "test" +init-hook='import sys; sys.path.append(".")' persistent = "no" reports = "no" allow-reexport-from-package = true +jobs=0 [tool.pylint.message_control] # Reasons disabled: diff --git a/test/cemi_tests/__init__.py b/test/cemi_tests/__init__.py new file mode 100644 index 000000000..86ffb0e66 --- /dev/null +++ b/test/cemi_tests/__init__.py @@ -0,0 +1 @@ +"""Unit tests for the CEMI module.""" diff --git a/test/core_tests/__init__.py b/test/core_tests/__init__.py new file mode 100644 index 000000000..a0a5a2e6c --- /dev/null +++ b/test/core_tests/__init__.py @@ -0,0 +1 @@ +"""Unit tests for the Core Module.""" diff --git a/test/devices_tests/__init__.py b/test/devices_tests/__init__.py new file mode 100644 index 000000000..f86bbf8d1 --- /dev/null +++ b/test/devices_tests/__init__.py @@ -0,0 +1 @@ +"""Unit tests for the Devices module.""" diff --git a/test/dpt_tests/__init__.py b/test/dpt_tests/__init__.py new file mode 100644 index 000000000..0eee1b83b --- /dev/null +++ b/test/dpt_tests/__init__.py @@ -0,0 +1 @@ +"""Unit tests for the DPT module.""" diff --git a/test/io_tests/__init__.py b/test/io_tests/__init__.py new file mode 100644 index 000000000..4e4b4d1f4 --- /dev/null +++ b/test/io_tests/__init__.py @@ -0,0 +1 @@ +"""Unit tests for the IO Module.""" diff --git a/test/io_tests/request_response_tests/__init__.py b/test/io_tests/request_response_tests/__init__.py new file mode 100644 index 000000000..81072686a --- /dev/null +++ b/test/io_tests/request_response_tests/__init__.py @@ -0,0 +1 @@ +"""Unit tests for the Request_Response Module.""" diff --git a/test/io_tests/transport_tests/__init__.py b/test/io_tests/transport_tests/__init__.py new file mode 100644 index 000000000..0d3558129 --- /dev/null +++ b/test/io_tests/transport_tests/__init__.py @@ -0,0 +1 @@ +"""Unit tests for the Transport module.""" diff --git a/test/knxip_tests/__init__.py b/test/knxip_tests/__init__.py new file mode 100644 index 000000000..936771b1c --- /dev/null +++ b/test/knxip_tests/__init__.py @@ -0,0 +1 @@ +"""Unit tests for the KNXIP module.""" diff --git a/test/management_tests/__init__.py b/test/management_tests/__init__.py new file mode 100644 index 000000000..d9c208151 --- /dev/null +++ b/test/management_tests/__init__.py @@ -0,0 +1 @@ +"""Unit tests for the Management module.""" diff --git a/test/remote_value_tests/__init__.py b/test/remote_value_tests/__init__.py new file mode 100644 index 000000000..4f7e92407 --- /dev/null +++ b/test/remote_value_tests/__init__.py @@ -0,0 +1 @@ +"""Unit tests for the RemoteValue module.""" diff --git a/test/secure_tests/__init__.py b/test/secure_tests/__init__.py new file mode 100644 index 000000000..e8a4798e7 --- /dev/null +++ b/test/secure_tests/__init__.py @@ -0,0 +1 @@ +"""Unit tests for the Secure module.""" diff --git a/test/telegram_tests/__init__.py b/test/telegram_tests/__init__.py new file mode 100644 index 000000000..d0b6038ed --- /dev/null +++ b/test/telegram_tests/__init__.py @@ -0,0 +1 @@ +"""Unit tests for the Telegram module.""" diff --git a/test/tools_tests/__init__.py b/test/tools_tests/__init__.py new file mode 100644 index 000000000..0efe55224 --- /dev/null +++ b/test/tools_tests/__init__.py @@ -0,0 +1 @@ +"""Unit tests for the Tools module.""" diff --git a/tox.ini b/tox.ini index 665c5ee61..89cf36a26 100644 --- a/tox.ini +++ b/tox.ini @@ -28,8 +28,8 @@ commands = [testenv:pylint] basepython = python3 commands = - pylint --jobs=0 xknx examples - pylint --jobs=0 --disable=protected-access,abstract-class-instantiated test + pylint xknx examples + pylint --disable=protected-access,abstract-class-instantiated test [testenv:ruff] basepython = python3