feat(config): support exclude_rules in .fragjan project config #15

Closed
opened 2026-05-19 15:52:53 +02:00 by michael · 1 comment
Owner

Problem

Some projects legitimately do not follow all rules in a pack.
Example: daw-lua-common is a library without config/module.conf --
the module-conf-exists rule does not apply.

Currently there is no way to exclude specific rules per project.

Solution

Add exclude_rules to .fragjan [check] section:

[check]
exclude = lib/, test/, .temp/
exclude_rules = module-conf-exists, some-other-rule

Runner skips rules listed in exclude_rules before executing them.

Affected Files

  • core/runner.lua: check exclude_rules from project config
  • core/detect.lua: get_excluded_rules(dir) function
  • templates/config/.fragjan.example: document exclude_rules

Notes

exclude_rules is comma-separated, same pattern as exclude.
Rule IDs must match rule_id in the rule YAML exactly.

## Problem Some projects legitimately do not follow all rules in a pack. Example: daw-lua-common is a library without config/module.conf -- the module-conf-exists rule does not apply. Currently there is no way to exclude specific rules per project. ## Solution Add exclude_rules to .fragjan [check] section: ```ini [check] exclude = lib/, test/, .temp/ exclude_rules = module-conf-exists, some-other-rule ``` Runner skips rules listed in exclude_rules before executing them. ## Affected Files - core/runner.lua: check exclude_rules from project config - core/detect.lua: get_excluded_rules(dir) function - templates/config/.fragjan.example: document exclude_rules ## Notes exclude_rules is comma-separated, same pattern as exclude. Rule IDs must match rule_id in the rule YAML exactly.
michael added this to the Basic Version milestone 2026-05-30 16:08:29 +02:00
Author
Owner

Implemented exclude_rules in .fragjan [check] section.

  • detect.get_excluded_rules(dir) reads comma-separated rule IDs
  • runner/init.lua skips rules listed in exclude_rules before execution
  • Same pattern as existing get_project_excludes / exclude

Tested: exclude_rules = no-unprotected-require reduces fragjan warnings
from 62 to 24.

Implemented exclude_rules in .fragjan [check] section. - detect.get_excluded_rules(dir) reads comma-separated rule IDs - runner/init.lua skips rules listed in exclude_rules before execution - Same pattern as existing get_project_excludes / exclude Tested: exclude_rules = no-unprotected-require reduces fragjan warnings from 62 to 24.
michael 2026-05-30 19:16:04 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/fragjan#15
No description provided.