integrated-application-development / sonar-delphi

Delphi language plugin for SonarQube
GNU Lesser General Public License v3.0
94 stars 13 forks source link

Interface for checking current compiler version in rules #206

Open zaneduffield opened 6 months ago

zaneduffield commented 6 months ago

Prerequisites

Engine area

Rules API

Improvement description

Provide a way to check what the configured Delphi compiler version is from the perspective of a descendant of DelphiCheck. I'd imagine this would become part of the interface for DelphiCheckContext.

Rationale

Currently (as far as I can tell) there is no way for a rule to check what the configured Delphi compiler version is.

Several kinds of rules would benefit from this knowledge, including

Cirras commented 6 months ago

Agreed.

Equivalent APIs in sonar-java:

fourls commented 4 months ago

It is worth noting that unlike Java projects, Delphi projects are often designed to target a wide range of versions. There might be a value loss if we threw out all issues that don't match the specified compiler version.

Could we make the configuration a bit more granular to handle these cases?