Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add pre-commit hook for pylint #1630

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions test/cemi_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Unit tests for the CEMI module."""
1 change: 1 addition & 0 deletions test/core_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Unit tests for the Core Module."""
1 change: 1 addition & 0 deletions test/devices_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Unit tests for the Devices module."""
1 change: 1 addition & 0 deletions test/dpt_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Unit tests for the DPT module."""
1 change: 1 addition & 0 deletions test/io_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Unit tests for the IO Module."""
1 change: 1 addition & 0 deletions test/io_tests/request_response_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Unit tests for the Request_Response Module."""
1 change: 1 addition & 0 deletions test/io_tests/transport_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Unit tests for the Transport module."""
1 change: 1 addition & 0 deletions test/knxip_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Unit tests for the KNXIP module."""
1 change: 1 addition & 0 deletions test/management_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Unit tests for the Management module."""
1 change: 1 addition & 0 deletions test/remote_value_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Unit tests for the RemoteValue module."""
1 change: 1 addition & 0 deletions test/secure_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Unit tests for the Secure module."""
1 change: 1 addition & 0 deletions test/telegram_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Unit tests for the Telegram module."""
1 change: 1 addition & 0 deletions test/tools_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Unit tests for the Tools module."""
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading