Context
A rule's paths is include-only. To skip a subdirectory you have to enumerate
includes (e.g. src/becwright/*.py to avoid checks/). An exclude list would
be cleaner and would directly address the "self-reference" scoping problem (a
text check cannot run over its own source — see
documentation/writing-checks.md).
Proposed approach
- Add an optional
exclude: [globs] field to the Rule model in rules.py.
- In
engine.py, after matching a file against paths, drop it if it matches any
exclude glob.
- Reuse the existing
matches() / _glob_to_regex() helpers in engine.py.
Acceptance criteria
- A rule with
paths + exclude runs only on (included minus excluded) files.
- Tests cover the exclusion.
- Documented in
documentation/usage.md (and its Spanish variant).
Notes
This adds a field to the rules format — please confirm the design in this issue
before implementing.
Relevant files
src/becwright/rules.py, src/becwright/engine.py, documentation/usage.md.
Context
A rule's
pathsis include-only. To skip a subdirectory you have to enumerateincludes (e.g.
src/becwright/*.pyto avoidchecks/). Anexcludelist wouldbe cleaner and would directly address the "self-reference" scoping problem (a
text check cannot run over its own source — see
documentation/writing-checks.md).
Proposed approach
exclude: [globs]field to theRulemodel inrules.py.engine.py, after matching a file againstpaths, drop it if it matches anyexcludeglob.matches()/_glob_to_regex()helpers inengine.py.Acceptance criteria
paths+excluderuns only on (included minus excluded) files.documentation/usage.md(and its Spanish variant).Notes
This adds a field to the rules format — please confirm the design in this issue
before implementing.
Relevant files
src/becwright/rules.py,src/becwright/engine.py,documentation/usage.md.