integrated-application-development / delphilint

Delphi IDE package providing on-the-fly code analysis and linting, powered by SonarDelphi
GNU Lesser General Public License v3.0
87 stars 13 forks source link

Configure rules in Standalone Mode #16

Closed fourls closed 6 months ago

fourls commented 8 months ago

Prerequisites

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:

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 commented 6 months ago

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.