Skip to content

Start from the default ruleset when configuring custom rules - #119

Open
Bazooper-blip wants to merge 1 commit into
integrated-application-development:masterfrom
Bazooper-blip:standalone-default-ruleset
Open

Start from the default ruleset when configuring custom rules#119
Bazooper-blip wants to merge 1 commit into
integrated-application-development:masterfrom
Bazooper-blip:standalone-default-ruleset

Conversation

@Bazooper-blip

Copy link
Copy Markdown

Addresses the core request in #80: switching to "Use a custom ruleset" in the Standalone Mode settings now starts from SonarDelphi's default ruleset instead of selecting every rule, so the default set can be fine-tuned by adding/removing rules.

Changes:

  • Server: RemoteRule and the rule-retrieval response (RuleData) carry a defaultEnabled flag. Standalone hosts populate it from SonarLintRuleDefinition.isActiveByDefault() — the same source already used to decide the default-ruleset analysis behaviour. Rules from a SonarQube server report true, since everything retrieved there belongs to the active quality profile (the flag is only consumed by the standalone settings UI).
  • Client: TRule parses the new optional defaultEnabled field (defaulting to false for older servers).
  • Settings UI: when the rule checklist is populated and no custom ruleset has ever been configured (saved settings are "use default ruleset" with no disabled-rules list), the checklist is initialised from the default ruleset. An existing custom selection is preserved exactly as before, and "Enable all"/"Disable all" still work.

The follow-up suggestions in the issue's comments (a search bar and friendlier list ordering) are not included — they're UI work that seems better as a separate change.

Testing: server Maven suite passes; client suite passes with a new TRule.CreateFromJson test for defaultEnabled (present and absent). The settings-frame behaviour compiles and follows the existing populate/save flow, but I could not exercise the dialog in a live IDE — a manual check of switching between default/custom rulesets before merge would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant