-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Have you tried to resolve this issue yourself first?
- I confirm I have gone through the above steps and still have an issue to report.
Bug Description
When I recreated the config file with the line sf code-analyzer config --include-unmodified-rules --rule-selector all --config-file code-analyzer.yml --output-file code-analyzer.yml last week, it removed the disabled: true tags.
This week, it removes the rule entirely from the config file, which does not disable the rule.
Additionally, my ignores section was completely removed.
Separately, it is interesting that entire sections are rearranged, making diffs difficult to analyze. (The flow section was moved.)
Losing customizations can be exremely costly.
Output / Logs
Steps To Reproduce
- Create a
code-analyzer.ymlfile by whatever means you like - Add an
ignoresarray - Set a rule to disabled by inserting a line
disabled: truebelow the rule severity - Run
sf code-analyzer config --include-unmodified-rules --rule-selector all --config-file code-analyzer.yml --output-file code-analyzer.yml - Note that the disabled tag is gone and so is the ignores array
Expected Behavior
disabled attributes should be retained
ignores should be retained
Operating System
Tahoe 26.3.1
Salesforce CLI Version
@salesforce/cli/2.127.2 darwin-arm64 node-v22.22.0
Code Analyzer Plugin (code-analyzer) Version
code-analyzer 5.10.2 (5.10.2)
Node Version
v24.13.0
Java Version
openjdk version "21.0.6" 2025-01-21 LTS
Python Version
zsh: command not found: python
Additional Context (Screenshots, Files, etc)
No response
Workaround
Run the command, then copy/paste any new rules back to the original file, or use the diff in VS Code.
Urgency
High