Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support standalone mode rule configuration #37

Merged
merged 14 commits into from
May 24, 2024
Merged

Support standalone mode rule configuration #37

merged 14 commits into from
May 24, 2024

Conversation

fourls
Copy link
Collaborator

@fourls fourls commented May 16, 2024

This PR adds a new user-level configuration setting to configure which rules are applied in standalone mode:

image

By default, DelphiLint is configured to use SonarDelphi's default ruleset (the Sonar way profile), preserving existing behaviour. Users can opt-in to configure their own ruleset, at which point they can enable or disable which rules they like. Under the hood, only disabled rules are stored, meaning that any new rules that appear as a result of a SonarDelphi upgrade will be automatically enabled.

As tends to happen with these sorts of paradigm-shift changes, this PR also includes a few collateral improvements:

  • Some Sonar issues have been fixed
  • The settings form has been redesigned as a tabbed view
  • SonarDelphi version configuration now only queries GitHub when a new "Edit" button is clicked, rather than upon form show
  • SonarDelphi version configuration now queries GitHub in a background thread
  • Rule retrieval in Standalone Mode now includes security hotspots and excludes template rules
  • The SonarHostTokens settings item is no longer capped at 2048 characters

Fixes #16

@fourls fourls requested a review from Cirras May 16, 2024 06:13
@fourls
Copy link
Collaborator Author

fourls commented May 17, 2024

Implemented compatibility with the new features in the VS Code companion - while you can't customise the rules from within VSCode, it will honour the disabled rules configuration.

Copy link
Collaborator

@Cirras Cirras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great bit of work here, love the new settings panel.
A few minor comments, but overall code looks good. I'll be doing some additional user testing as well before approving.

client/source/DelphiLint.Analyzer.pas Outdated Show resolved Hide resolved
client/source/DelphiLint.SettingsFrame.pas Outdated Show resolved Hide resolved
client/source/DelphiLint.SettingsFrame.pas Outdated Show resolved Hide resolved
client/source/DelphiLint.SettingsFrame.pas Outdated Show resolved Hide resolved
client/source/DelphiLint.SettingsFrame.pas Show resolved Hide resolved
Copy link
Collaborator

@Cirras Cirras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@fourls fourls merged commit f8f7a01 into master May 24, 2024
4 checks passed
@fourls fourls deleted the standalone-rules branch May 24, 2024 04:23
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.

Configure rules in Standalone Mode
2 participants