Drop lint, coverage and line-cap gates
Some checks are pending
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , dependency-freshness) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / lock-popup-safety (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (0) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (1) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (2) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (3) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (4) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (5) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (6) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (7) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (8) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (9) (push) Waiting to run
Tests / web-coverage (push) Waiting to run
repo-contract / repo contract (push) Waiting to run

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:
Krzysztof Rudnicki 2026-11-28 08:19:03 +01:00
parent 6d8c97f0d7
commit 55d155d7c8
5 changed files with 5 additions and 321 deletions

View File

@ -18,20 +18,10 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- group: mypy
hooks: mypy
skip: ""
# Both pylint hooks (source and tests) share the id `pylint`.
- group: pylint
hooks: pylint
skip: ""
- group: flutter
hooks: flutter-analyze
skip: ""
# dependency-freshness is local only (pre-commit hook), never in CI. # dependency-freshness is local only (pre-commit hook), never in CI.
- group: rest - group: rest
hooks: "" hooks: ""
skip: mypy,pylint,flutter-analyze,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

View File

@ -105,27 +105,6 @@ jobs:
- name: flutter test --coverage, bucket ${{ matrix.shard }} - name: flutter test --coverage, bucket ${{ matrix.shard }}
run: bash scripts/check_flutter_coverage.sh --shard "${{ matrix.shard }}/$FLUTTER_SHARDS" run: bash scripts/check_flutter_coverage.sh --shard "${{ matrix.shard }}/$FLUTTER_SHARDS"
- uses: actions/upload-artifact@v4
with:
name: flutter-lcov-${{ matrix.shard }}
path: stronglift_replacement/workout_app/coverage/lcov.info
if-no-files-found: error
retention-days: 1
flutter-coverage:
needs: flutter-shard
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: flutter-lcov-*
path: lcov-shards
- name: flutter test --coverage, 100% of lib/ (workout app)
run: bash scripts/check_flutter_coverage.sh --merged "$FLUTTER_SHARDS" lcov-shards/*/lcov.info
web-coverage: web-coverage:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -143,4 +122,4 @@ jobs:
- name: vitest --coverage, 100% (status web UI) - name: vitest --coverage, 100% (status web UI)
run: | run: |
pnpm --dir web install --frozen-lockfile pnpm --dir web install --frozen-lockfile
pnpm --dir web run coverage pnpm --dir web run test

View File

@ -30,12 +30,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, non-test helpers (fixtures, factories) imported by the
# real test modules — deliberately not collected as tests, hence the
# leading underscore rather than a test_/*_test name.
exclude: ^screen_locker/tests/_[a-z][a-z_]*\.py$
- id: check-ast - id: check-ast
- id: mixed-line-ending - id: mixed-line-ending
args: [--fix=lf] args: [--fix=lf]
@ -71,122 +65,9 @@ repos:
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.17.1 rev: v0.17.1
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
# The hook runs in its own isolated venv, so stubs installed into the
# project venv are invisible to it. Without this, the Firebase session
# recovery's `import requests` fails as import-untyped here while
# type-checking cleanly everywhere else.
additional_dependencies:
- types-requests>=2.31.0
- repo: https://github.com/pylint-dev/pylint
# Same release as requirements.txt. No --jobs here: pyproject.toml holds
# it at 1, because parallel pylint pickles through dill, which crashes on
# Python 3.15 (see the comment on `jobs` there).
rev: v4.1.4
hooks:
# Two hooks, because the three checks below are not defects in a test
# suite -- they are how pytest and unit-testing private mixins work --
# while in SOURCE they are real findings that must still fail:
# protected-access tests drive private mixin methods directly; those
# methods ARE the unit under test (ruff already
# exempts the same thing via SLF001 for tests).
# unused-argument pytest fixtures must be REQUESTED in the signature
# to take effect but are never referenced in the body.
# duplicate-code near-identical `with patch(...)` preambles; a test
# should read top-to-bottom without chasing a fixture.
# Splitting also removes the old failure mode where the score depended on
# what else happened to be staged alongside. Both are a hard 10.00.
- id: pylint
name: pylint (source, 10.00)
alias: pylint-source
exclude: ^screen_locker/tests/
args:
- --rcfile=pyproject.toml
- --fail-under=10
additional_dependencies:
- pytest
# 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.1#subdirectory=gatelock
- crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.11.1#subdirectory=crdt-sync
- earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.24.0#subdirectory=earned_time
- freedays @ git+https://github.com/kuhyx/utils@freedays-v0.4.4#subdirectory=freedays
- sickdays @ git+https://github.com/kuhyx/utils@sickdays-v0.5.9#subdirectory=sickdays
- kuhy-credit @ git+https://github.com/kuhyx/utils@kuhy-credit-v0.3.2#subdirectory=kuhy_credit
# Same pin as workout_app/tools/render_finish_chime.sh installs.
- music_theory @ git+https://github.com/kuhyx/utils@music-theory-v0.1.0#subdirectory=music_theory
- mcp>=2,<3
- pydantic
- id: pylint
name: pylint (tests, 10.00)
alias: pylint-tests
files: ^screen_locker/tests/
args:
- --rcfile=pyproject.toml
- --fail-under=10
- --disable=protected-access,unused-argument,duplicate-code
additional_dependencies:
- pytest
# 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.1#subdirectory=gatelock
- crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.11.1#subdirectory=crdt-sync
- earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.24.0#subdirectory=earned_time
- freedays @ git+https://github.com/kuhyx/utils@freedays-v0.4.4#subdirectory=freedays
- sickdays @ git+https://github.com/kuhyx/utils@sickdays-v0.5.9#subdirectory=sickdays
- kuhy-credit @ git+https://github.com/kuhyx/utils@kuhy-credit-v0.3.2#subdirectory=kuhy_credit
- mcp>=2,<3
- pydantic
- 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:
# The CI mirror, one step per hook so each call stays under the 60 s # The CI mirror, one step per hook so each call stays under the 60 s
@ -203,30 +84,6 @@ repos:
always_run: true always_run: true
require_serial: true require_serial: true
stages: [manual] stages: [manual]
- id: ci-precommit-pylint-source
name: "CI mirror (pre-commit --all-files: pylint source)"
entry: bash scripts/ci_mirror.sh precommit pylint-source
language: system
pass_filenames: false
always_run: true
require_serial: true
stages: [manual]
- id: ci-precommit-pylint-tests
name: "CI mirror (pre-commit --all-files: pylint tests)"
entry: bash scripts/ci_mirror.sh precommit pylint-tests
language: system
pass_filenames: false
always_run: true
require_serial: true
stages: [manual]
- id: ci-precommit-flutter-web
name: "CI mirror (pre-commit --all-files: flutter analyze + web lint/typecheck)"
entry: bash scripts/ci_mirror.sh precommit flutter-web
language: system
pass_filenames: false
always_run: true
require_serial: true
stages: [manual]
- id: ci-precommit-rest - id: ci-precommit-rest
name: "CI mirror (pre-commit --all-files: every other hook)" name: "CI mirror (pre-commit --all-files: every other hook)"
entry: bash scripts/ci_mirror.sh precommit rest entry: bash scripts/ci_mirror.sh precommit rest
@ -244,14 +101,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,*pnpm-lock.yaml,.git,__pycache__,.venv
- --ignore-words-list=als,ans,ect,nd,som,sur,te,nam,numer,lew,sie,wil,postion,clen,ther,folow,derrive,ony,tje,noe,theses,crate,doubleclick,wile,tabel,pary,blok,bloc,proces,serwer,parametr,adres,hart,dout,metod,tekst,synonim,grup,mosty,lokal,skalar,milion,nowe,tre,hel,alph
- 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
@ -262,24 +111,6 @@ repos:
language: system language: system
pass_filenames: false pass_filenames: false
always_run: true always_run: true
- id: shellcheck
name: shellcheck
entry: bash -c 'printf "%s\0" "$@" | xargs -0 -n 40 shellcheck --severity=warning' --
language: system
types: [shell]
- id: max-file-length
name: Max file length (250 lines)
entry: python3 scripts/check_file_length.py
language: system
# Dart was missing here until 2026-08-15, so the cap had never looked at
# a single file in workout_app/ — the whole Flutter app was exempt from
# the gate it was being refactored to satisfy. ts/tsx joined on
# 2026-08-29 with web/, for exactly the same reason: a language absent
# from this list is a directory the cap silently does not apply to.
# c/c++ and markdown joined on 2026-11-01 (the Linux runner had grown
# to 258; prose is under the same cap per the 250-line rule).
types_or: [python, shell, dart, ts, tsx, c, c++, markdown]
exclude: '^web/(node_modules|dist|coverage)/'
- id: no-silent-failures - id: no-silent-failures
name: Block silent failures (swallowed exceptions and silent sys.exit(0) must say why) name: Block silent failures (swallowed exceptions and silent sys.exit(0) must say why)
entry: python3 -m scripts.check_silent_failures entry: python3 -m scripts.check_silent_failures
@ -307,116 +138,6 @@ repos:
files: '^(screen_locker|scripts)/.*\.py$' files: '^(screen_locker|scripts)/.*\.py$'
pass_filenames: false pass_filenames: false
require_serial: true require_serial: true
- id: flutter-analyze
name: flutter analyze (workout app)
# env -u GIT_DIR: git exports it to hooks, and flutter shells out to
# git to identify its own SDK -- with it set, flutter reads THIS repo
# as the SDK and pub resolves every constraint against 0.0.0-unknown.
entry: bash -c 'cd stronglift_replacement/workout_app &&
env -u GIT_DIR -u GIT_WORK_TREE -u GIT_INDEX_FILE flutter analyze'
language: system
files: '^stronglift_replacement/workout_app/.*\.(dart|yaml)$'
pass_filenames: false
- id: flutter-test-coverage-shard-0
name: flutter test bucket 0/8 (workout app, local gate)
entry: bash scripts/check_flutter_coverage.sh --gate-shard 0
language: system
pass_filenames: false
always_run: true
require_serial: true
stages: [manual]
- id: flutter-test-coverage-shard-1
name: flutter test bucket 1/8 (workout app, local gate)
entry: bash scripts/check_flutter_coverage.sh --gate-shard 1
language: system
pass_filenames: false
always_run: true
require_serial: true
stages: [manual]
- id: flutter-test-coverage-shard-2
name: flutter test bucket 2/8 (workout app, local gate)
entry: bash scripts/check_flutter_coverage.sh --gate-shard 2
language: system
pass_filenames: false
always_run: true
require_serial: true
stages: [manual]
- id: flutter-test-coverage-shard-3
name: flutter test bucket 3/8 (workout app, local gate)
entry: bash scripts/check_flutter_coverage.sh --gate-shard 3
language: system
pass_filenames: false
always_run: true
require_serial: true
stages: [manual]
- id: flutter-test-coverage-shard-4
name: flutter test bucket 4/8 (workout app, local gate)
entry: bash scripts/check_flutter_coverage.sh --gate-shard 4
language: system
pass_filenames: false
always_run: true
require_serial: true
stages: [manual]
- id: flutter-test-coverage-shard-5
name: flutter test bucket 5/8 (workout app, local gate)
entry: bash scripts/check_flutter_coverage.sh --gate-shard 5
language: system
pass_filenames: false
always_run: true
require_serial: true
stages: [manual]
- id: flutter-test-coverage-shard-6
name: flutter test bucket 6/8 (workout app, local gate)
entry: bash scripts/check_flutter_coverage.sh --gate-shard 6
language: system
pass_filenames: false
always_run: true
require_serial: true
stages: [manual]
- id: flutter-test-coverage-shard-7
name: flutter test bucket 7/8 (workout app, local gate)
entry: bash scripts/check_flutter_coverage.sh --gate-shard 7
language: system
pass_filenames: false
always_run: true
require_serial: true
stages: [manual]
# Fails unless every shard above passed on THIS tree, then applies the
# unchanged 100% bar and every-lib-file guard to their union.
- id: flutter-test-coverage-merge
name: flutter coverage 100% (union of the 8 buckets)
entry: bash scripts/check_flutter_coverage.sh --gate-merge
language: system
pass_filenames: false
always_run: true
require_serial: true
stages: [manual]
# web/ gates. steam-backlog-enforcer, which this app was copied from, has
# only a coverage hook -- its lint and typecheck are unenforced, so both
# can rot without anything failing. All three run here.
- id: web-lint
name: eslint (status web UI)
entry: pnpm --dir web run lint
language: system
files: '^web/(src/.*\.(ts|astro)|eslint\.config\.js|package\.json)$'
pass_filenames: false
require_serial: true
- id: web-typecheck
name: astro check + build (status web UI)
entry: pnpm --dir web run build
language: system
files: '^web/(src/.*\.(ts|astro)|tsconfig\.json|astro\.config\.mjs|vitest\.config\.ts)$'
pass_filenames: false
require_serial: true
- id: web-coverage
name: vitest --coverage 100% (status web UI)
entry: pnpm --dir web run coverage
language: system
files: '^web/src/'
pass_filenames: false
require_serial: true
stages: [manual]
# Four markdown namespaces (README / CLAUDE* / DOCS* / TODO*), plus the # Four markdown namespaces (README / CLAUDE* / DOCS* / TODO*), plus the
# rule that a TODO carries "REMOVE ME AFTER FINISH" and nothing else may. # rule that a TODO carries "REMOVE ME AFTER FINISH" and nothing else may.

View File

@ -123,9 +123,9 @@ wait, and tests pin the retry to 0.
- run: `./run.sh` (locks the screen; never launch on the live display for checks) - run: `./run.sh` (locks the screen; never launch on the live display for checks)
- test: `python -m pytest -n auto -p no:sugar -q` - test: `python -m pytest -n auto -p no:sugar -q`
- test-changed: `scripts/test_changed.sh` - test-changed: `scripts/test_changed.sh`
- lint: `pre-commit run ruff --all-files` - lint: n/a: dropped (kuhy, 2026-11-27)
- coverage: `python -m pytest -n auto -p no:sugar -q` - coverage: n/a: dropped (kuhy, 2026-11-27)
- coverage-gaps: `coverage-gaps coverage.lcov` - coverage-gaps: n/a: dropped (kuhy, 2026-11-27)
- deploy: `git -C ~/src/screen-locker pull --ff-only && bash ~/src/screen-locker/scripts/deploy.sh` (reinstalls, restarts web/poke/runnerup units, health-checks them, then release-deploys the workout app (skipped when its source tree matches the last phone install, `~/.local/state/screen-locker/phone_app_tree`); exit 46 from the phone guard means kuhy reruns it with `PHONE_PROTECT_ALLOW=com.kuhy.workout_app`) - deploy: `git -C ~/src/screen-locker pull --ff-only && bash ~/src/screen-locker/scripts/deploy.sh` (reinstalls, restarts web/poke/runnerup units, health-checks them, then release-deploys the workout app (skipped when its source tree matches the last phone install, `~/.local/state/screen-locker/phone_app_tree`); exit 46 from the phone guard means kuhy reruns it with `PHONE_PROTECT_ALLOW=com.kuhy.workout_app`)
## Pre-push gate (<=60 s) ## Pre-push gate (<=60 s)

View File

@ -9,12 +9,6 @@ export default getViteConfig({
provider: 'v8', provider: 'v8',
include: ['src/**/*.ts'], include: ['src/**/*.ts'],
exclude: ['src/**/*.test.ts', 'src/test/**', 'src/env.d.ts'], exclude: ['src/**/*.test.ts', 'src/test/**', 'src/env.d.ts'],
thresholds: {
statements: 100,
branches: 100,
functions: 100,
lines: 100,
},
}, },
}, },
}) })