Skip to content

Per-project lint rule configuration #26

@JohnRDOrazio

Description

@JohnRDOrazio

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions