Add posibility to disable entire rules via config file#279
Add posibility to disable entire rules via config file#279AndreiDurlea merged 17 commits intobemanproject:mainfrom
Conversation
(including missing tests for file ignoring logic)
|
@neatudarius cool logging update, used it here as well |
|
I'm thinking about whether to mark the run as failed if a certain number of rules are ignored, or to make a parameter that makes the run without ignoring rules (and one that does the same for fies) |
neatudarius
left a comment
There was a problem hiding this comment.
LGTM overall - please check logs from tools from root README.md
Co-authored-by: Darius Neațu <[email protected]>
Do we want this? |
Co-Authored-By: Darius Neațu <[email protected]>
You should just disabled the rule. And updates stats from end of run in the tool. |
|
Alright, I'll leave it at just that |
6a81761 to
ec9796a
Compare
There was a problem hiding this comment.
Pull request overview
Adds repository-configurable disabling of entire beman-tidy rules (including glob-style patterns), integrates disabled-rule handling into the pipeline output/coverage, and documents/tests the new behavior to support use cases like selectively skipping readme checks (e.g., beman.exemplar).
Changes:
- Add
disabled_rulesconfig validation + pattern expansion logic inbeman_tidy.lib.utils.config. - Update the pipeline to skip disabled checks, report them in the summary, and exclude them from coverage calculations.
- Add unit tests for ignored-path matching and for disabled-rules validation/expansion; document the new config option in README.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
beman_tidy/lib/utils/config.py |
Adds disabled_rules validation and glob expansion helpers. |
beman_tidy/lib/pipeline.py |
Skips disabled checks; updates summary + coverage calculations to account for disabled checks. |
tests/lib/utils/test_config_disabled_rules.py |
Adds tests for disabled_rules validation, expansion, and load behavior. |
tests/lib/utils/test_config_ignored_files.py |
Adds tests for ignored_paths matching behavior. |
README.md |
Documents disabled_rules configuration usage and examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
phew, this should be it. shall we get this merged? @neatudarius |
#278
also intended to provide a clean way to solve #241 (disabling readme.title on beman.exemplar)
Designed it as such:
(from
README.md)beman-tidyattempts to read configuration for each source file from a.beman-tidy.yamlfile located in the root of your repository. You can also specify a custom configuration file path using the--configoption.The following configuration options may be used in a
.beman-tidy.yamlfile:[...]
disabled_rules- A list of rule names (or patterns) to be completely skipped during checks.readme.title).*(e.g.,readme.*to skip all readme checks).*.rule_name(e.g.,*.title).Example: