Skip to content

Commit 3a6489b

Browse files
committed
Run pylint explicitly on specific directories
Instead of relying on pre-commit to pass all filenames, call pylint explicitly on the directories we want to check. This avoids that pylint potentially adds directories to the Python path, leading to unexpected imports (e.g. Module 'json' has no 'load' member, when pylint gets called with `pylint matter_server/server/ota/__init__.py matter_server/common/helpers/util.py`).
1 parent 7499a7b commit 3a6489b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ repos:
8585
name: 🌟 Starring code with pylint
8686
language: system
8787
types: [python]
88-
entry: scripts/run-in-env.sh pylint
88+
entry: scripts/run-in-env.sh pylint matter_server/ tests/
89+
require_serial: true
90+
pass_filenames: false
8991
- id: trailing-whitespace
9092
name: ✄ Trim Trailing Whitespace
9193
language: system

0 commit comments

Comments
 (0)