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

Allow setting of SonarQube module key bindings by applying a pattern #15

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

swesteme
Copy link
Collaborator

A new SonarLintHandler has been added, allowing a module name pattern matching to set a SonarQube project key.

Example autoconfigSonarLint.yaml:

bindings: 
  - modulePattern: base-module-name-.*
    projectKey: module-sonarqube-project

Closes #8

@swesteme swesteme linked an issue Nov 18, 2024 that may be closed by this pull request
@swesteme swesteme requested a review from nailujx86 November 18, 2024 10:21
Copy link
Member

@nailujx86 nailujx86 left a comment

Choose a reason for hiding this comment

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

Changelog and version bump are missing.

// create a dummy list for the purpose of collecting the number of changes only
List<String> changedModuleConfigs = new ArrayList<>();
for (Binding binding : configuration.getBindings()) {
moduleMap.entrySet().stream().filter(e -> e.getKey().matches(binding.getModulePattern())).forEach(e -> {
Copy link
Member

Choose a reason for hiding this comment

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

moduleMap.entrySet().stream().filter(moduleEntry -> modukeEntry.getKey().matches(binding.getModulePattern())).forEach(moduleEntry -> {

Copy link
Member

Choose a reason for hiding this comment

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

Descriptive lambda names are better here because not every editor displays type inferences.

try {
return updateHandler.updateConfiguration(extensionConfiguration.get(), project);
} catch (Exception e) {
LOG.error("An error occurred trying to process configuration updates for \"{}\"", e,
Copy link
Member

Choose a reason for hiding this comment

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

Should the exception really be the first logger argument here?

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.

Feature SonarQube Binding Configuration in Multi-Project setup
2 participants