Description:
Describe the Feature
Currently, developers must define exclude paths for each rule individually:
rules:
- id: no-console-log
paths: ["**/*.js"]
exclude: ["node_modules/**", "dist/**", "vendor/**"]
check: "becwright run forbid --pattern 'console.log'"
- id: no-debugger
paths: ["**/*.js"]
exclude: ["node_modules/**", "dist/**", "vendor/**"]
check: "becwright run forbid --pattern 'debugger'"
In larger codebases with many rules, this leads to significant configuration boilerplate and duplication. If a new folder needs to be ignored (e.g., build/), the developer has to update every single rule's exclude list.
We should introduce a global_exclude configuration block at the root of .bec/rules.yaml to define ignore patterns globally.
Proposed Design
Add support for a top-level global_exclude key in .bec/rules.yaml containing a list of glob patterns:
schema_version: 1
global_exclude:
- "node_modules/**"
- "dist/**"
- "vendor/**"
- "build/**"
rules:
- id: no-console-log
paths: ["**/*.js"]
check: "becwright run forbid --pattern 'console.log'"
- id: no-debugger
paths: ["**/*.js"]
check: "becwright run forbid --pattern 'debugger'"
Execution Flow / Rules Logic
- During execution, the engine compiles rules and file lists.
- For each rule, a file is matching if:
- It matches one of the rule's
paths globs.
- It does not match any of the rule's local
exclude globs.
- It does not match any of the
global_exclude globs defined at the file root.
- Update the YAML schema file (
schema/rules.schema.json) to validate the new global_exclude key.
Description:
Describe the Feature
Currently, developers must define
excludepaths for each rule individually:In larger codebases with many rules, this leads to significant configuration boilerplate and duplication. If a new folder needs to be ignored (e.g.,
build/), the developer has to update every single rule'sexcludelist.We should introduce a
global_excludeconfiguration block at the root of.bec/rules.yamlto define ignore patterns globally.Proposed Design
Add support for a top-level
global_excludekey in.bec/rules.yamlcontaining a list of glob patterns:Execution Flow / Rules Logic
pathsglobs.excludeglobs.global_excludeglobs defined at the file root.schema/rules.schema.json) to validate the newglobal_excludekey.