Text · maintainability
commented-out-config
text:commented-out-config commented-out config syntax
- Code
- SARJ301
- Default
- error
- Fix
- none
- Languages
- config
Why
Disabled configuration becomes stale while version control already preserves its history.
Fix
Delete disabled configuration; document a default or constraint when that information remains useful.
Before / after
Executed by this rule’s unit tests.
Before
A commented-out assignment is stale configuration
# timeout = 30
timeout = 10
After
An explicitly labeled default is documentation
# Default:
# timeout = 30
timeout = 10
Limits
- Directive, rationale, documented-example, and YAML block-scalar comments are intentionally excluded.
Files
**/*.{yaml,yml,toml,jsonc,ini,cfg,conf,properties,sh,zsh,bash}