mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-28 19:39:05 +01:00
Fix pre-existing CI failures (deps, lint, whitespace)
CI on main was already red before the crdt_sync migration. Make the pre-commit --all-files run and the test job green: - requirements.txt: add crdt-sync (now a runtime dep) and mcp so CI's `pip install -r requirements.txt` can import diet_guard._sync and collect test_mcp.py (both were ModuleNotFoundError in CI). - .pre-commit-config.yaml: add mcp + pydantic to the pylint hook deps so it can resolve diet_guard._mcp's imports (was E0401). - pyproject.toml: raise pylint min-similarity-lines to 8 — the shared nutrition-field keys in _foodbank/_mcp mirror one domain schema, not real duplicate code. - scripts/setup_mcp.sh: split declare/assign for SCRIPT_DIR/REPO_DIR (shellcheck SC2155). - codespell: fix "packge"/"unparseable" typos; trailing-whitespace auto-fixes across app/.agents/skills docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017RRCdR4D8SaVrN2xraMQxM
This commit is contained in:
parent
59d1c29dd2
commit
e6812f7b4f
@ -94,6 +94,8 @@ repos:
|
||||
- requests
|
||||
- gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.1.0#subdirectory=gatelock
|
||||
- crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.1.0#subdirectory=crdt-sync
|
||||
- mcp
|
||||
- pydantic
|
||||
# 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)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
---
|
||||
name: dart-collect-coverage
|
||||
description: Collect coverage using the coverage packge and create an LCOV report
|
||||
description: Collect coverage using the coverage package and create an LCOV report
|
||||
metadata:
|
||||
model: models/gemini-3.1-pro-preview
|
||||
last_modified: Fri, 24 Apr 2026 15:14:32 GMT
|
||||
|
||||
@ -976,7 +976,7 @@ void main() {
|
||||
);
|
||||
|
||||
testWidgets(
|
||||
'_formatDay falls back to raw key for an unparseable date (line 245)',
|
||||
'_formatDay falls back to raw key for an unparsable date (line 245)',
|
||||
(tester) async {
|
||||
await tester.runAsync(() async {
|
||||
// The day key is e.time.substring(0, 10). Writing an entry whose
|
||||
|
||||
@ -82,7 +82,7 @@ void main() {
|
||||
expect(AppSettingsService.dailyKcalGoal, 2200);
|
||||
});
|
||||
|
||||
test('keeps default 2200 on unparseable JSON', () async {
|
||||
test('keeps default 2200 on unparsable JSON', () async {
|
||||
await File(
|
||||
'${tempDir.path}/app_settings.json',
|
||||
).writeAsString('not json at all');
|
||||
|
||||
@ -127,6 +127,13 @@ min-public-methods = 0
|
||||
max-module-lines = 1000
|
||||
max-attributes = 10
|
||||
|
||||
[tool.pylint.similarities]
|
||||
# _foodbank's BankRecord and _mcp's response dict both list the same five
|
||||
# nutrition fields (kcal/protein_g/carbs_g/fat_g/grams) because they mirror the
|
||||
# same domain schema, then diverge (desc/count vs source). Raise the threshold
|
||||
# so pylint doesn't flag this intentional structural overlap as duplicate-code.
|
||||
min-similarity-lines = 8
|
||||
|
||||
[tool.pylint.typecheck]
|
||||
generated-members = [
|
||||
".*\\.assert_called_once_with",
|
||||
|
||||
@ -3,7 +3,9 @@
|
||||
bandit>=1.7.0
|
||||
codespell>=2.2.0
|
||||
coverage>=7.4.0
|
||||
crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.1.0#subdirectory=crdt-sync
|
||||
gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.1.0#subdirectory=gatelock
|
||||
mcp>=1.9
|
||||
mypy>=1.8.0
|
||||
pre-commit>=3.6.0
|
||||
pylint>=3.0.0
|
||||
|
||||
@ -17,8 +17,10 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
readonly REPO_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
readonly SCRIPT_DIR
|
||||
REPO_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||
readonly REPO_DIR
|
||||
readonly VENV_DIR="${HOME}/.venvs/diet-guard-mcp"
|
||||
|
||||
main() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user