-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rebased to make use of module updater extension point
- Loading branch information
Showing
16 changed files
with
115 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 0 additions & 72 deletions
72
src/main/java/de/gebit/plugins/autoconfig/handlers/sonarlint/SonarLintHandler.java
This file was deleted.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
src/main/java/de/gebit/plugins/autoconfig/handlers/sonarqube/SonarQubeModuleHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package de.gebit.plugins.autoconfig.handlers.sonarqube; | ||
|
||
import com.intellij.openapi.module.Module; | ||
import de.gebit.plugins.autoconfig.UpdateModuleHandler; | ||
import de.gebit.plugins.autoconfig.handlers.AbstractHandler; | ||
import de.gebit.plugins.autoconfig.model.SonarQubeConfiguration; | ||
import org.jetbrains.annotations.NonNls; | ||
import org.sonarlint.intellij.config.Settings; | ||
import org.sonarlint.intellij.config.module.SonarLintModuleSettings; | ||
import org.sonarlint.intellij.config.project.SonarLintProjectSettings; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Configuration handler used to synchronise SonarQube module bindings in projects. | ||
*/ | ||
public class SonarQubeModuleHandler extends AbstractHandler implements UpdateModuleHandler<SonarQubeConfiguration> { | ||
private static final @NonNls String CONFIG_SCHEMA_JSON = "/schema/sonarqubeModule.schema.json"; | ||
|
||
public static final @NonNls String CONFIG_FILE_NAME = "autoconfigSonarQubeModule.yaml"; | ||
|
||
@Override | ||
public String getFileName() { | ||
return CONFIG_FILE_NAME; | ||
} | ||
|
||
@Override | ||
public String getJsonSchema() { | ||
return CONFIG_SCHEMA_JSON; | ||
} | ||
|
||
@Override | ||
public String getUpdaterName() { | ||
return "SonarQube module configuration updater"; | ||
} | ||
|
||
@Override | ||
public Class<SonarQubeConfiguration> getConfigurationClass() { | ||
return SonarQubeConfiguration.class; | ||
} | ||
|
||
@Override | ||
public boolean acceptModule(SonarQubeConfiguration configuration, Module module) { | ||
return matchesAnyName(module, configuration.getModuleFilter()); | ||
} | ||
|
||
@Override | ||
public List<String> updateConfiguration(SonarQubeConfiguration configuration, Module module) { | ||
List<String> updatedConfigs = new ArrayList<>(); | ||
SonarLintProjectSettings projectSettings = Settings.getSettingsFor(module.getProject()); | ||
if (projectSettings.isBindingEnabled() && configuration.getProjectKey() != null) { | ||
SonarLintModuleSettings moduleSettings = Settings.getSettingsFor(module); | ||
applySetting(configuration.getProjectKey(), moduleSettings.getProjectKey(), moduleSettings::setProjectKey, | ||
updatedConfigs, "SonarQube module key"); | ||
} | ||
return updatedConfigs; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<idea-plugin> | ||
<depends>de.gebit.plugins.autoconfig</depends> | ||
<extensions defaultExtensionNs="de.gebit.plugins.autoconfig"> | ||
<moduleConfigurationUpdater implementation="de.gebit.plugins.autoconfig.handlers.sonarqube.SonarQubeModuleHandler"/> | ||
</extensions> | ||
</idea-plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.