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

Configure rules in Standalone Mode #16

Open
2 tasks done
fourls opened this issue Mar 20, 2024 · 1 comment
Open
2 tasks done

Configure rules in Standalone Mode #16

fourls opened this issue Mar 20, 2024 · 1 comment
Labels
client Affects the DelphiLint client IDE plugin enhancement New feature or request server Affects the DelphiLint server

Comments

@fourls
Copy link
Collaborator

fourls commented Mar 20, 2024

Prerequisites

  • This improvement has not already been suggested.
  • This improvement would be generally useful, not specific to my code or setup.

Engine area

Delphi analysis

Improvement description

Add a way to configure the ruleset SonarDelphi uses when running standalone.

In terms of specific details, SonarLint's Standalone Mode rules configuration has the following behaviour:

  • The ruleset is configured on a user-level (i.e. not for individual projects).
  • Rules can be toggled on or off, but parameters cannot be changed from their default values.

DelphiLint's implementation could follow in SonarLint's footsteps, considering that for complex project management, we do really want to encourage the use of a SonarQube server and Connected Mode.

Rationale

When running standalone, DelphiLint currently uses the default ruleset (the "Sonar way" quality profile).
This includes some opinionated rules (following Delphi's Object Pascal Style Guide) such as enforcing classes beginning with T, PascalCase variable names, etc. These rules are noisy and unhelpful if the codebase intentionally doesn't follow the style guide.

In Connected Mode, the ruleset can be changed via the SonarQube UI. Having a similar functionality for Standalone Mode would be advantageous for users without a SonarQube server.

@fourls fourls added enhancement New feature or request client Affects the DelphiLint client IDE plugin server Affects the DelphiLint server labels Mar 20, 2024
@fourls
Copy link
Collaborator Author

fourls commented May 7, 2024

In terms of specific details, SonarLint's Standalone Mode rules configuration has the following behaviour:

  • The ruleset is configured on a user-level (i.e. not for individual projects).
  • Rules can be toggled on or off, but parameters cannot be changed from their default values.

I think that this is the best option, at least for now. The upfront dev cost is relatively minor compared to the other options, and it leaves the path open to future improvements in this area if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Affects the DelphiLint client IDE plugin enhancement New feature or request server Affects the DelphiLint server
Projects
None yet
Development

No branches or pull requests

1 participant