Summary
Add per-project lint rule configuration so project owners/admins can enable or disable specific linting rules and optionally select a progressive lint level (similar to PHPStan's levels 1–10).
Background
The OntologyLinter already supports an enabled_rules: set[str] field and get_linter() accepts an enabled_rules parameter, but:
- No database model persists per-project lint configuration
worker.py calls get_linter() without any project-specific rules — always runs all 16 rules
- Projects with large or legacy ontologies get overwhelmed with hundreds of issues
Requirements
Database
- New
project_lint_config table (or column on projects) storing:
- Enabled/disabled state per rule
- Optional: a lint level preset (e.g., level 1 = critical structural rules only, level 5 = all rules)
API Endpoints
GET /api/v1/projects/{id}/lint/config — return current lint configuration for a project
PUT /api/v1/projects/{id}/lint/config — update lint configuration (owner/admin only)
- Existing
GET /api/v1/projects/lint/rules already returns available rules with metadata
Worker Integration
run_lint_task() should load the project's lint config and pass enabled_rules to get_linter()
Progressive Lint Levels
Define preset levels that progressively include more rules, e.g.:
- Level 1 (Critical): undefined-parent, circular-hierarchy, undefined-prefix
- Level 2 (Structural): + orphan-class, duplicate-triple, disjoint-violation
- Level 3 (Labels): + missing-label, empty-label, duplicate-label, missing-english-label
- Level 4 (Quality): + missing-comment, label-per-language
- Level 5 (All): + domain-violation, range-violation, cardinality-violation, inverse-property-inconsistency
Projects can either pick a level or customize individual rules.
Related
Summary
Add per-project lint rule configuration so project owners/admins can enable or disable specific linting rules and optionally select a progressive lint level (similar to PHPStan's levels 1–10).
Background
The
OntologyLinteralready supports anenabled_rules: set[str]field andget_linter()accepts anenabled_rulesparameter, but:worker.pycallsget_linter()without any project-specific rules — always runs all 16 rulesRequirements
Database
project_lint_configtable (or column onprojects) storing:API Endpoints
GET /api/v1/projects/{id}/lint/config— return current lint configuration for a projectPUT /api/v1/projects/{id}/lint/config— update lint configuration (owner/admin only)GET /api/v1/projects/lint/rulesalready returns available rules with metadataWorker Integration
run_lint_task()should load the project's lint config and passenabled_rulestoget_linter()Progressive Lint Levels
Define preset levels that progressively include more rules, e.g.:
Projects can either pick a level or customize individual rules.
Related