-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Milestone
Description
Problem
Currently, robocop format --select ... completely replaces the default ENABLED formatters. Users who want to depend on the default formatters and enable one or two extras must either manually list all default formatters, or use the somewhat verbose --configure option, which is not ideal.
A. Example (with select):
[tool.robocop.format]
# Must list all ~20 default formatters just to enable additional formatters
select = [
"AddMissingEnd",
"NormalizeSeparators",
"DiscardEmptySections",
# ... the rest ...
# The only ones we actually want to enable
"AlignKeywordsSection",
"AlignTestCasesSection"
]This breaks when robocop's default formatters change.
B. Example (with configure):
select = [
# defaults
]
configure = [
"AlignKeywordsSection.enabled=True",
"AlignTestCasesSection.enabled=True"
]This would not break when robocop's default formatters change, but is verbose nonetheless.
Proposed Feature
Add --extend-select / extend-select option that augments formatters instead of replacing them.
CLI:
robocop format --extend-select AlignKeywordsSection --extend-select AlignTestCasesSectionTOML:
[tool.robocop.format]
extend-select = [
"AlignKeywordsSection",
"AlignTestCasesSection"
]Behavior
| Configuration | Result |
|---|---|
extend-select = ["F1"] |
All defaults + F1 |
select = ["F1"] + extend-select = ["F2"] |
F1 + F2 (no defaults) |
| No select or extend-select | All defaults (unchanged) |
Benefits
- Reduces configuration verbosity for common use case
- Future-proof: automatically includes new default formatters
- No breaking changes to existing
--selectbehavior - Follows precedent from Ruff's linter configuration (See extend-select)
Notes
- Custom formatters (via
--custom-formatters) should continue to appear last --force-ordershould affect--extend-selectsame as--select- When neither
--selectnor--extend-selectis specified, behavior should remain unchanged (all defaults)
Metadata
Metadata
Assignees
Labels
No labels