|
| 1 | +# OpenSPP Lint Configuration |
| 2 | +# See scripts/lint/README.md for documentation |
| 3 | + |
| 4 | +# Module-specific overrides |
| 5 | +modules: |
| 6 | + # Example: Allow non-standard patterns for specific modules |
| 7 | + # spp_api: |
| 8 | + # allow_model_patterns: |
| 9 | + # - "spp_api.*" |
| 10 | + |
| 11 | +# Rule configurations |
| 12 | +rules: |
| 13 | + naming: |
| 14 | + # Additional Boolean field exceptions (beyond is_*/has_* prefix) |
| 15 | + boolean_exceptions: |
| 16 | + - "bidirectional" |
| 17 | + - "recurring" |
| 18 | + - "active" # Standard Odoo field |
| 19 | + # Additional verb prefixes for Boolean fields |
| 20 | + boolean_verb_prefixes: |
| 21 | + - "compute_" |
| 22 | + - "generate_" |
| 23 | + # Additional Many2one exceptions (fields that don't need _id suffix) |
| 24 | + # Built-in exceptions: parent, company, currency, country, state, |
| 25 | + # partner, user, categ, id_type, kind, |
| 26 | + # source, destination, relation, |
| 27 | + # disabled_by, created_by, approved_by, rejected_by, |
| 28 | + # district, region, province, city, village |
| 29 | + many2one_exceptions: [] |
| 30 | + |
| 31 | + # Model namespace exceptions (models that don't need spp.* namespace) |
| 32 | + # Built-in exceptions include: |
| 33 | + # - Standard Odoo models (res.partner, res.users, etc.) |
| 34 | + # - Third-party models (queue.job, fastapi.endpoint, res.users.role, etc.) |
| 35 | + # Add any additional models here that should be excluded from the spp.* check |
| 36 | + namespace_exceptions: [] |
| 37 | + # Example: |
| 38 | + # namespace_exceptions: |
| 39 | + # - "my.custom.model" |
| 40 | + # - "external.lib.model" |
| 41 | + |
| 42 | + xml_ids: |
| 43 | + # Allow legacy patterns during migration |
| 44 | + allow_legacy_patterns: false |
| 45 | + |
| 46 | + performance: |
| 47 | + # N+1 detection is Odoo-aware: |
| 48 | + # - Skips methods with @api.depends (Odoo prefetches automatically) |
| 49 | + # - Detects .mapped() prefetch patterns |
| 50 | + # - Skips ORM method calls on related objects (write, update, etc.) |
| 51 | + # - Tracks nested loops correctly |
| 52 | + n_plus_one_threshold: 1 |
| 53 | + |
| 54 | + ui: |
| 55 | + # Models likely to have >1k records (require list limit="80") |
| 56 | + large_models: |
| 57 | + - "res.partner" # Registry |
| 58 | + - "spp.payment" # Transactional |
| 59 | + - "spp.entitlement" # Transactional |
| 60 | + - "spp.event.data" # Transactional |
| 61 | + - "spp.program.membership" # Relationship |
| 62 | + - "spp.group.membership" # Relationship |
| 63 | + - "spp.change.request" # Workflow (high volume) |
| 64 | + |
| 65 | + # Search panel threshold (disable if records exceed this count) |
| 66 | + search_panel_max_records: 100000 |
| 67 | + |
| 68 | + # O2M fields that can be editable (exceptions to large O2M rule) |
| 69 | + # Add fields known to have <100 records |
| 70 | + allow_editable_o2m: |
| 71 | + - "line_ids" # Generic line items (typically <20) |
| 72 | + - "manager_ids" # Program managers (typically <10) |
| 73 | + - "approver_ids" # Approval workflow (typically <5) |
| 74 | + |
| 75 | +# Severity overrides (change default severity for rules) |
| 76 | +# Valid values: error, warning, info |
| 77 | +severity: |
| 78 | + # Naming checks as warnings (common during migration) |
| 79 | + naming.boolean_prefix: warning |
| 80 | + naming.many2one_suffix: warning |
| 81 | + |
| 82 | + # UI pattern checks |
| 83 | + ui.xpath_class: error # Error for @class (Odoo 19 incompatible) |
| 84 | + ui.statusbar_location: error # Error for statusbar in wrong location |
| 85 | + ui.extension_points: info # Info for missing extension points |
| 86 | + ui.large_o2m_editable: warning # Warn for editable large O2M fields |
| 87 | + |
| 88 | + # Example: Downgrade performance checks during migration |
| 89 | + # performance.offset_pagination: info |
| 90 | + # performance.n_plus_one: info |
| 91 | + |
| 92 | +# Patterns to ignore (glob patterns) |
| 93 | +ignore: |
| 94 | + - "**/migrations/**" |
| 95 | + - "**/tests/**" |
| 96 | + - "**/__pycache__/**" |
| 97 | + # Demo data generators - one-time operations where N+1 queries are acceptable |
| 98 | + - "**/wizard/*demo_generator.py" |
0 commit comments