mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-27 20:29:12 +01:00
Give pylint the repo root, so a script outside the package lints on its own
pylint infers sys.path from the files it is handed, so a file in scripts/ resolves its package imports only when a package file happens to be in the same batch -- passing or failing by what else was staged. Sibling repos hit exactly that in CI today. An init-hook puts the repo root on the path unconditionally. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BsXnTHyuuCUZsqetTaajcF
This commit is contained in:
parent
4a5e350baf
commit
af81136861
@ -91,6 +91,12 @@ color_output = true
|
|||||||
exclude = [".venv/"]
|
exclude = [".venv/"]
|
||||||
|
|
||||||
[tool.pylint.main]
|
[tool.pylint.main]
|
||||||
|
# The repo root on the path, so a file outside the package (scripts/) can be
|
||||||
|
# linted on its own. pylint otherwise infers the path from the files it is
|
||||||
|
# given, so a script resolved its package imports only when a package file
|
||||||
|
# happened to be in the same batch -- passing or failing by what else was
|
||||||
|
# staged.
|
||||||
|
init-hook = "import sys; sys.path.insert(0, '.')"
|
||||||
analyse-fallback-blocks = true
|
analyse-fallback-blocks = true
|
||||||
persistent = true
|
persistent = true
|
||||||
jobs = 0
|
jobs = 0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user