Skip to content

Fall back to sonar-project.properties for the project key - #118

Open
Bazooper-blip wants to merge 1 commit into
integrated-application-development:masterfrom
Bazooper-blip:project-key-from-properties
Open

Fall back to sonar-project.properties for the project key#118
Bazooper-blip wants to merge 1 commit into
integrated-application-development:masterfrom
Bazooper-blip:project-key-from-properties

Conversation

@Bazooper-blip

Copy link
Copy Markdown

Fixes #58.

When no project key is set in the DelphiLint project options, the key is now read from sonar.projectKey in sonar-project.properties (respecting the existing "Read sonar-project.properties if present" project option, since the fallback goes through ProjectPropertiesPath).

  • TLintProjectOptions.EffectiveSonarHostProjectKey returns the configured key, falling back to a minimal parse of the properties file (comments, blank lines, and whitespace handled; first sonar.projectKey wins).
  • Both Connected Mode consumers in DelphiLint.Analyzer (analysis options and rule retrieval, including token lookup) use the effective key.
  • The Project Options form accepts a blank project key in Connected Mode when the properties file provides one, and the token display/Manage Tokens enablement reflect the effective key. The edit box itself still shows only the explicitly configured key, so the .delphilint file remains the single source of truth for what the user has set.

Testing: new DelphiLintTest.ProjectOptions DUnitX fixture with six tests covering precedence, the fallback, the read-properties toggle, and parser edge cases (comments, whitespace, similarly named keys). Full client suite passes at the same rate as master.

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.

Read project key from sonar-project.properties

1 participant