Quality Enforcement Setup
For humans setting up the development environment. AI agents see AGENTS.md instead. This document explains how to set up automated enforcement of code quality standards.Overview
This document explains how to set up automated enforcement of code quality standards, including:- Pre-commit hooks (block commits that don’t meet standards)
- CI/CD checks (verify on every push)
- IDE integration (catch issues early)
Pre-Commit Hooks
Installation
Configuration
Create.pre-commit-config.yaml in project root:
Scripts
Createscripts/check_file_sizes.py:
Backend Enforcement (Python)
Ruff Configuration
Createruff.toml:
pytest Configuration
Already inbackend/pyproject.toml:
interrogate Configuration
Already inbackend/pyproject.toml:
mypy Configuration
Createbackend/mypy.ini:
Frontend Enforcement (TypeScript)
ESLint Configuration
Createfrontend/.eslintrc.cjs:
TypeScript Configuration
Updatefrontend/tsconfig.json:
Vitest Configuration
Updatefrontend/vitest.config.ts:
CI/CD Integration
GitHub Actions
Create.github/workflows/quality-checks.yml:
IDE Integration
VS Code
Create.vscode/settings.json:
.vscode/extensions.json:
Setup Instructions
Initial Setup
Daily Workflow
Pre-commit hooks will automatically run ongit commit:
Manual Checks
Run checks without committing:Bypassing Hooks (Emergency Only)
NEVER bypass hooks unless absolutely necessary:- Emergency production hotfix
- Reverting a broken commit
- Merging auto-generated files
- “I’ll fix it later”
- “Tests are annoying”
- “Deadline pressure”
Troubleshooting
Pre-commit hooks not running
Hooks failing on unchanged files
Coverage below threshold
Docstring coverage below threshold
iOS (Hard Gates)
SwiftLint is integrated into the Xcode build and CI. The configuration lives atios/sideBar/.swiftlint.yml.
Doc comment coverage for public ViewModels/Services is enforced via:
scripts/ios_architecture_boundaries_baseline.json.
CI fails if a new prohibited dependency appears or if the baseline contains stale entries.
Deterministic iOS/macOS test execution is enforced in CI across:
- iPad Pro 13-inch (M5), iPadOS 26
- iPhone 17 Pro, iOS 26
- macOS 26
sideBar.app >= 40%sideBarShared.framework >= 80%ShareExtension.appex >= 20%sideBarWidgetsExtension.appex >= 15%sideBar Safari Extension.appex >= 15%- minimum
12deterministic UI journey tests (template launch/example tests excluded) - coverage may not regress by more than
1.0percentage point below baseline - scoped warnings for first-party iOS targets must be
0(warning_gate.max_warnings)
Summary
Enforcement Levels:| Check | Pre-commit | CI/CD | Blocks Commit |
|---|---|---|---|
| Ruff (lint/format) | ✅ | ✅ | ✅ Yes |
| mypy (type check) | ✅ | ✅ | ✅ Yes |
| interrogate (docstrings) | ✅ | ✅ | ✅ Yes |
| pytest (tests) | ❌ | ✅ | ❌ No (CI only) |
| ESLint | ✅ | ✅ | ✅ Yes |
| Svelte check | ✅ | ✅ | ✅ Yes |
| Vitest (tests) | ❌ | ✅ | ❌ No (CI only) |
| File size limits | ✅ | ✅ | ✅ Yes |
| No console.log | ✅ | ✅ | ✅ Yes |
| No debugger | ✅ | ✅ | ✅ Yes |
- ✅ Code formatting (Ruff, ESLint)
- ✅ Type safety (mypy, TypeScript)
- ✅ Documentation (interrogate, JSDoc)
- ✅ File size limits (custom script)
- ✅ No debugging artifacts
- ✅ Test coverage (CI only, warnings in dev)
For more details on code quality standards, see AGENTS.md