mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-24 11:46:30 +01:00
freedays: pylint --fail-under=10, scoped to source, on pylint 4.0.8
The three import-error findings were the hook not having crdt-sync in its own venv; it is now pinned there as in pyproject.toml. The one source finding is the background sync's documented fail-open net, which must catch everything by design, so it carries the one suppression. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HHCbkJWXHjtTUaqvnHRAqA
This commit is contained in:
parent
1723df3885
commit
8128851e0b
@ -101,15 +101,18 @@ repos:
|
|||||||
- --disable-error-code=list-item
|
- --disable-error-code=list-item
|
||||||
|
|
||||||
- repo: https://github.com/pylint-dev/pylint
|
- repo: https://github.com/pylint-dev/pylint
|
||||||
rev: v3.3.2
|
rev: v4.0.8
|
||||||
hooks:
|
hooks:
|
||||||
- id: pylint
|
- id: pylint
|
||||||
args:
|
args:
|
||||||
- --rcfile=freedays/pyproject.toml
|
- --rcfile=freedays/pyproject.toml
|
||||||
- --fail-under=8.0
|
- --fail-under=10
|
||||||
- --jobs=4
|
- --jobs=4
|
||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
- pytest
|
- pytest
|
||||||
|
# Kept in step with pyproject.toml, so pylint resolves the crdt_sync
|
||||||
|
# imports instead of scoring every one of them as import-error.
|
||||||
|
- crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.1#subdirectory=crdt-sync
|
||||||
|
|
||||||
- repo: https://github.com/PyCQA/bandit
|
- repo: https://github.com/PyCQA/bandit
|
||||||
rev: 1.9.4
|
rev: 1.9.4
|
||||||
|
|||||||
@ -138,7 +138,7 @@ def sync_quietly(*, paths: Paths | None = None) -> bool:
|
|||||||
# this is normal on a laptop and must not fill the journal.
|
# this is normal on a laptop and must not fill the journal.
|
||||||
_logger.debug("free-day sync skipped: %s", exc)
|
_logger.debug("free-day sync skipped: %s", exc)
|
||||||
return False
|
return False
|
||||||
except Exception:
|
except Exception: # pylint: disable=broad-exception-caught
|
||||||
_logger.exception("free-day sync failed unexpectedly")
|
_logger.exception("free-day sync failed unexpectedly")
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|||||||
@ -90,11 +90,22 @@ color_output = true
|
|||||||
exclude = [".venv/"]
|
exclude = [".venv/"]
|
||||||
|
|
||||||
[tool.pylint.main]
|
[tool.pylint.main]
|
||||||
|
# The repo root on the path, so pylint resolves the package's own imports the
|
||||||
|
# same way pytest does instead of reporting import-error for them.
|
||||||
|
init-hook = "import sys; sys.path.insert(0, 'freedays')"
|
||||||
analyse-fallback-blocks = true
|
analyse-fallback-blocks = true
|
||||||
persistent = true
|
persistent = true
|
||||||
jobs = 0
|
jobs = 0
|
||||||
py-version = "3.14"
|
py-version = "3.14"
|
||||||
ignore = [".venv", "__pycache__"]
|
ignore = [".venv", "__pycache__"]
|
||||||
|
# Test suites intentionally use patterns (protected-access, fixture-arg
|
||||||
|
# shadowing) that don't apply to source code; ruff's per-file-ignores carry
|
||||||
|
# the equivalent exemptions, so tests stay linted -- by ruff. This is the same
|
||||||
|
# source-only pylint scope wake-alarm / diet-guard / testsAndMisc use. It has
|
||||||
|
# to be `ignore-paths`, not `ignore = ["tests"]`: `ignore` only matches the
|
||||||
|
# basename of what pylint is *given*, and pre-commit hands it explicit file
|
||||||
|
# paths, so a directory name in `ignore` never fires under the hook.
|
||||||
|
ignore-paths = ["^(.*/)?tests/.*$"]
|
||||||
ignore-patterns = [".*\\.pyi$"]
|
ignore-patterns = [".*\\.pyi$"]
|
||||||
|
|
||||||
[tool.pylint.messages_control]
|
[tool.pylint.messages_control]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user