mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-28 22:19:04 +01:00
Drop lint, coverage and line-cap gates
Bug-class-check: none — gate policy change (kuhy 2026-11-27) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WzxdWZDq7ef5JyQd7Rx3Ju
This commit is contained in:
parent
fab0c937cf
commit
be478a8c81
33
.github/workflows/file-length.yml
vendored
33
.github/workflows/file-length.yml
vendored
@ -1,33 +0,0 @@
|
|||||||
name: file-length
|
|
||||||
|
|
||||||
# The 250-line cap, enforced on push as well as at commit time. The local
|
|
||||||
# pre-commit hook can be skipped (a fresh clone that never ran `pre-commit
|
|
||||||
# install` has no hooks at all), so the cap needs a second gate that no one
|
|
||||||
# can forget to install.
|
|
||||||
#
|
|
||||||
# Deliberately a SEPARATE workflow from release-apk.yml: a file that grew too
|
|
||||||
# long should fail lint, not block publishing an APK.
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
pull_request:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
file-length:
|
|
||||||
name: file length <= 250 lines
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
# The gate and its exemption list live in the shared utils repo so every
|
|
||||||
# repo enforces the same cap. Checking it out beats vendoring a copy
|
|
||||||
# here, which is exactly how a gate and a survey start disagreeing.
|
|
||||||
- name: Check out the shared gate
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
repository: kuhyx/utils
|
|
||||||
path: .utils
|
|
||||||
|
|
||||||
- name: Enforce the cap
|
|
||||||
run: bash .utils/scripts/check_file_length.sh --all
|
|
||||||
8
.github/workflows/pre-commit.yml
vendored
8
.github/workflows/pre-commit.yml
vendored
@ -17,15 +17,9 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- group: mypy
|
|
||||||
hooks: mypy
|
|
||||||
skip: ""
|
|
||||||
- group: pylint
|
|
||||||
hooks: pylint
|
|
||||||
skip: ""
|
|
||||||
- group: rest
|
- group: rest
|
||||||
hooks: ""
|
hooks: ""
|
||||||
skip: mypy,pylint,dependency-freshness
|
skip: "dependency-freshness"
|
||||||
name: pre-commit (${{ matrix.group }})
|
name: pre-commit (${{ matrix.group }})
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|||||||
@ -25,11 +25,6 @@ repos:
|
|||||||
- id: check-merge-conflict
|
- id: check-merge-conflict
|
||||||
- id: detect-private-key
|
- id: detect-private-key
|
||||||
- id: debug-statements
|
- id: debug-statements
|
||||||
- id: name-tests-test
|
|
||||||
args: [--pytest-test-first]
|
|
||||||
# Shared fakes and fixtures, not test modules. Split out of conftest.py
|
|
||||||
# and test_sync.py only because those files passed the 250-line cap.
|
|
||||||
exclude: ^diet_guard/tests/_(tk_fakes(_containers|_canvas)?|gate_layout_probe|gate_focus_probe|gate_measurement|gate_keyboard_probe|gate_fixtures|sync_fakes|kuchnia_fakes|state_redirects|claude_redirects|claude_fakes|claude_worker_fakes)\.py$
|
|
||||||
- id: check-ast
|
- id: check-ast
|
||||||
- id: mixed-line-ending
|
- id: mixed-line-ending
|
||||||
args: [--fix=lf]
|
args: [--fix=lf]
|
||||||
@ -57,88 +52,9 @@ repos:
|
|||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.15.2
|
rev: v0.15.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
|
||||||
args: [--fix, --unsafe-fixes, --exit-non-zero-on-fix, --show-fixes]
|
|
||||||
types_or: [python, pyi]
|
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
types_or: [python, pyi]
|
types_or: [python, pyi]
|
||||||
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
||||||
rev: v1.13.0
|
|
||||||
hooks:
|
|
||||||
- id: mypy
|
|
||||||
args:
|
|
||||||
- --ignore-missing-imports
|
|
||||||
- --no-error-summary
|
|
||||||
- --disable-error-code=no-untyped-def
|
|
||||||
- --disable-error-code=no-untyped-call
|
|
||||||
- --disable-error-code=var-annotated
|
|
||||||
- --disable-error-code=no-any-unimported
|
|
||||||
- --disable-error-code=type-arg
|
|
||||||
- --disable-error-code=no-any-return
|
|
||||||
- --disable-error-code=misc
|
|
||||||
- --disable-error-code=unused-ignore
|
|
||||||
- --disable-error-code=unreachable
|
|
||||||
- --disable-error-code=assignment
|
|
||||||
- --disable-error-code=no-redef
|
|
||||||
- --disable-error-code=attr-defined
|
|
||||||
- --disable-error-code=arg-type
|
|
||||||
- --disable-error-code=union-attr
|
|
||||||
- --disable-error-code=call-overload
|
|
||||||
- --disable-error-code=return-value
|
|
||||||
- --disable-error-code=redundant-cast
|
|
||||||
- --disable-error-code=empty-body
|
|
||||||
- --disable-error-code=list-item
|
|
||||||
additional_dependencies:
|
|
||||||
- types-requests
|
|
||||||
|
|
||||||
- repo: https://github.com/pylint-dev/pylint
|
|
||||||
rev: v3.3.2
|
|
||||||
hooks:
|
|
||||||
- id: pylint
|
|
||||||
# pre-commit itself runs on 3.15 and `python3` resolves to it; this
|
|
||||||
# pylint's --jobs=4 pickles with dill, which crashes there
|
|
||||||
# (no `co_lnotab`). The repo targets 3.14.
|
|
||||||
language_version: python3.14
|
|
||||||
args:
|
|
||||||
- --rcfile=pyproject.toml
|
|
||||||
- --fail-under=10
|
|
||||||
- --jobs=4
|
|
||||||
additional_dependencies:
|
|
||||||
- pytest
|
|
||||||
- requests
|
|
||||||
# Kept in step with pyproject.toml: pip refuses two different
|
|
||||||
# direct URLs for one distribution, so any pin that drifts from
|
|
||||||
# the manifest becomes an unresolvable hook environment rather
|
|
||||||
# than merely an old one.
|
|
||||||
- gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.16.0#subdirectory=gatelock
|
|
||||||
- crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.11.1#subdirectory=crdt-sync
|
|
||||||
- freedays @ git+https://github.com/kuhyx/utils@freedays-v0.4.3#subdirectory=freedays
|
|
||||||
- sickdays @ git+https://github.com/kuhyx/utils@sickdays-v0.5.8#subdirectory=sickdays
|
|
||||||
- kuhy-credit @ git+https://github.com/kuhyx/utils@kuhy-credit-v0.3.1#subdirectory=kuhy_credit
|
|
||||||
- rtdb-relay @ git+https://github.com/kuhyx/utils@rtdb-relay-v0.2.1#subdirectory=rtdb_relay
|
|
||||||
- claude-agent-sdk==0.2.184
|
|
||||||
- httpx==0.28.1
|
|
||||||
- mcp>=2,<3
|
|
||||||
- pydantic
|
|
||||||
- defusedxml==0.7.1
|
|
||||||
# Test suites intentionally use patterns (protected-access, magic-value
|
|
||||||
# comparisons) that don't belong in the source-code 10/10 gate.
|
|
||||||
exclude: ^(\.venv/)|(^|/)(tests/|conftest\.py)
|
|
||||||
|
|
||||||
- repo: https://github.com/PyCQA/bandit
|
|
||||||
rev: 1.7.10
|
|
||||||
hooks:
|
|
||||||
- id: bandit
|
|
||||||
args:
|
|
||||||
- -c
|
|
||||||
- pyproject.toml
|
|
||||||
- --severity-level=high
|
|
||||||
- --confidence-level=medium
|
|
||||||
- --skip=B113
|
|
||||||
additional_dependencies: ["bandit[toml]"]
|
|
||||||
exclude: ^(tests/|.*test.*\.py$)
|
|
||||||
|
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
# Split into <60 s steps (run in this order); no-arg ci_mirror.sh is the CI form.
|
# Split into <60 s steps (run in this order); no-arg ci_mirror.sh is the CI form.
|
||||||
@ -166,14 +82,6 @@ repos:
|
|||||||
always_run: true
|
always_run: true
|
||||||
require_serial: true
|
require_serial: true
|
||||||
stages: [manual]
|
stages: [manual]
|
||||||
- id: ci-mirror-flutter-analyze
|
|
||||||
name: CI mirror 4 (flutter analyze)
|
|
||||||
entry: bash scripts/ci_mirror.sh flutter-analyze
|
|
||||||
language: system
|
|
||||||
pass_filenames: false
|
|
||||||
always_run: true
|
|
||||||
require_serial: true
|
|
||||||
stages: [manual]
|
|
||||||
- id: ci-mirror-flutter-test-1
|
- id: ci-mirror-flutter-test-1
|
||||||
name: CI mirror 5 (flutter test 1/12)
|
name: CI mirror 5 (flutter test 1/12)
|
||||||
entry: bash scripts/ci_mirror.sh flutter-test --shard 0/12
|
entry: bash scripts/ci_mirror.sh flutter-test --shard 0/12
|
||||||
@ -271,15 +179,6 @@ repos:
|
|||||||
require_serial: true
|
require_serial: true
|
||||||
stages: [manual]
|
stages: [manual]
|
||||||
|
|
||||||
- repo: https://github.com/codespell-project/codespell
|
|
||||||
rev: v2.3.0
|
|
||||||
hooks:
|
|
||||||
- id: codespell
|
|
||||||
args:
|
|
||||||
- --skip=*.json,*.lock,.git,__pycache__,.venv
|
|
||||||
# Devine: the 1974 ideal-body-weight formula's author, not "define".
|
|
||||||
- --ignore-words-list=devine
|
|
||||||
|
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
# Fails a commit that still points crdt_sync at a local path. Local
|
# Fails a commit that still points crdt_sync at a local path. Local
|
||||||
@ -300,29 +199,6 @@ repos:
|
|||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
always_run: true
|
always_run: true
|
||||||
require_serial: true
|
require_serial: true
|
||||||
- id: shellcheck
|
|
||||||
name: shellcheck
|
|
||||||
entry: bash -c 'printf "%s\0" "$@" | xargs -0 -n 40 shellcheck --severity=warning' --
|
|
||||||
language: system
|
|
||||||
types: [shell]
|
|
||||||
# A PKGBUILD is a makepkg manifest, not a standalone script: it has no
|
|
||||||
# shebang (SC2148) and its variables are read by makepkg rather than by
|
|
||||||
# the file itself (SC2034). namcap is what actually lints these.
|
|
||||||
exclude: '^packaging/aur/PKGBUILD$'
|
|
||||||
# The shared 250-line cap. Checks only the files in the commit, so an
|
|
||||||
# unrelated commit never breaks; exits 1 rather than warning. No
|
|
||||||
# baseline and no allowlist -- those are suppressions. The exemption
|
|
||||||
# list (generated/vendored/data files) lives with the checker in
|
|
||||||
# ~/src/utils/file_length/config.py so the gate and the survey cannot
|
|
||||||
# disagree.
|
|
||||||
#
|
|
||||||
# Deliberately unfiltered: no types_or and no files. The cap applies to
|
|
||||||
# Dart and prose too, and a type filter here is what would silently
|
|
||||||
# exempt the whole Flutter app and every .md.
|
|
||||||
- id: file-length
|
|
||||||
name: file length <= 250 lines
|
|
||||||
entry: scripts/check_file_length.sh
|
|
||||||
language: system
|
|
||||||
|
|
||||||
# unittest.mock.patch fails OPEN: once a refactor moves a name, a patch
|
# unittest.mock.patch fails OPEN: once a refactor moves a name, a patch
|
||||||
# target that still imports redirects nothing, the test passes, and the
|
# target that still imports redirects nothing, the test passes, and the
|
||||||
|
|||||||
@ -20,10 +20,10 @@ show adherence, streaks, a YTD tally and weekly/monthly averages, all derived fr
|
|||||||
- run: `python -m diet_guard gate --demo`
|
- run: `python -m diet_guard gate --demo`
|
||||||
- test: `python -m pytest -n auto -p no:sugar -q` (python, 100% branch bar from pyproject) then `cd app && flutter test --reporter=compact`
|
- test: `python -m pytest -n auto -p no:sugar -q` (python, 100% branch bar from pyproject) then `cd app && flutter test --reporter=compact`
|
||||||
- test-changed: `scripts/test_changed.sh` (maps py and app/ dart changes to their tests, no coverage)
|
- test-changed: `scripts/test_changed.sh` (maps py and app/ dart changes to their tests, no coverage)
|
||||||
- lint: `pre-commit run --all-files`
|
- lint: n/a: dropped (kuhy, 2026-11-27)
|
||||||
- coverage: `python -m pytest -n auto -p no:sugar -q` (writes coverage.lcov)
|
- coverage: n/a: dropped (kuhy, 2026-11-27)
|
||||||
- deploy: `bash scripts/deploy.sh` (pull ~/src/diet-guard, system-Python install, desktop app; health-checked)
|
- deploy: `bash scripts/deploy.sh` (pull ~/src/diet-guard, system-Python install, desktop app; health-checked)
|
||||||
- coverage-gaps: `coverage-gaps coverage.lcov`
|
- coverage-gaps: n/a: dropped (kuhy, 2026-11-27)
|
||||||
|
|
||||||
## Scheduling
|
## Scheduling
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ name: diet_guard_app
|
|||||||
description: "Companion phone app for diet_guard: log meals on the go."
|
description: "Companion phone app for diet_guard: log meals on the go."
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 1.0.194+1
|
version: 1.0.195+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.12.2
|
sdk: ^3.12.2
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user