Skip to content

Commit

Permalink
Merge pull request #2018 from guwirth/SonarCFamily-support
Browse files Browse the repository at this point in the history
SonarCFamily support
  • Loading branch information
guwirth authored Dec 31, 2020
2 parents c3e65f8 + 050d2da commit 2d2206c
Show file tree
Hide file tree
Showing 33 changed files with 35 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private static NSObject require(@Nullable NSObject object, String errorMsg) {
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX Clang Static Analyzer report import")
.onlyOnLanguage("cxx")
.onlyOnLanguages("cxx","cpp", "c")
.createIssuesForRuleRepository(getRuleRepositoryKey())
.onlyWhenConfiguration(conf -> conf.hasKey(getReportPathsKey()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ protected static String[] splitRuleId(String info, String defaultRuleId) {
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX Clang-Tidy report import")
.onlyOnLanguage("cxx")
.onlyOnLanguages("cxx","cpp", "c")
.createIssuesForRuleRepository(getRuleRepositoryKey())
.onlyWhenConfiguration(conf -> conf.hasKey(getReportPathsKey()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static List<PropertyDefinition> properties() {
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX GCC compiler report import")
.onlyOnLanguage("cxx")
.onlyOnLanguages("cxx", "cpp", "c")
.createIssuesForRuleRepositories(getRuleRepositoryKey())
.onlyWhenConfiguration(conf -> conf.hasKey(getReportPathsKey()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static List<PropertyDefinition> properties() {
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX Visual Studio compiler report import")
.onlyOnLanguage("cxx")
.onlyOnLanguages("cxx", "cpp", "c")
.createIssuesForRuleRepositories(getRuleRepositoryKey())
.onlyWhenConfiguration(conf -> conf.hasKey(getReportPathsKey()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public CxxCoverageBullseyeSensor() {
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX Bullseye coverage report import")
.onlyOnLanguage("cxx")
.onlyOnLanguages("cxx", "cpp", "c")
.onlyWhenConfiguration(conf -> conf.hasKey(REPORT_PATH_KEY));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public CxxCoverageCoberturaSensor() {
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX Cobertura XML coverage report import")
.onlyOnLanguage("cxx")
.onlyOnLanguages("cxx", "cpp", "c")
.onlyWhenConfiguration(conf -> conf.hasKey(REPORT_PATH_KEY));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public CxxCoverageTestwellCtcTxtSensor() {
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX Testwell CTC++ TXT coverage report import")
.onlyOnLanguage("cxx")
.onlyOnLanguages("cxx", "cpp", "c")
.onlyWhenConfiguration(conf -> conf.hasKey(REPORT_PATH_KEY));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public CxxCoverageVisualStudioSensor() {
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX Visual Studio XML coverage report import")
.onlyOnLanguage("cxx")
.onlyOnLanguages("cxx", "cpp", "c")
.onlyWhenConfiguration(conf -> conf.hasKey(REPORT_PATH_KEY));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static List<PropertyDefinition> properties() {
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX Cppcheck report import")
.onlyOnLanguage("cxx")
.onlyOnLanguages("cxx", "cpp", "c")
.createIssuesForRuleRepository(getRuleRepositoryKey())
.onlyWhenConfiguration(conf -> conf.hasKey(getReportPathsKey()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private static String getFrameText(Location frame, int frameNr) {
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX Dr. Memory report import")
.onlyOnLanguage("cxx")
.onlyOnLanguages("cxx", "cpp", "c")
.createIssuesForRuleRepository(getRuleRepositoryKey())
.onlyWhenConfiguration(conf -> conf.hasKey(getReportPathsKey()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static List<PropertyDefinition> properties() {
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX Infer report import")
.onlyOnLanguage("cxx")
.onlyOnLanguages("cxx", "cpp", "c")
.createIssuesForRuleRepository(getRuleRepositoryKey())
.onlyWhenConfiguration(conf -> conf.hasKey(getReportPathsKey()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static List<PropertyDefinition> properties() {
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX external analyser report import")
.onlyOnLanguage("cxx")
.onlyOnLanguages("cxx", "cpp", "c")
.createIssuesForRuleRepository(getRuleRepositoryKey())
.onlyWhenConfiguration(conf -> conf.hasKey(getReportPathsKey()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static List<PropertyDefinition> properties() {
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX PC-lint report import")
.onlyOnLanguage("cxx")
.onlyOnLanguages("cxx", "cpp", "c")
.createIssuesForRuleRepository(getRuleRepositoryKey())
.onlyWhenConfiguration(conf -> conf.hasKey(getReportPathsKey()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private static String getVulnerabilityType(@Nullable Element child) {
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX RATS report import")
.onlyOnLanguage("cxx")
.onlyOnLanguages("cxx", "cpp", "c")
.createIssuesForRuleRepository(getRuleRepositoryKey())
.onlyWhenConfiguration(conf -> conf.hasKey(getReportPathsKey()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX VSTest/xUnit/NUnit Test report import")
.onlyWhenConfiguration(conf -> new UnitTestConfiguration(conf).hasUnitTestResultsProperty())
.onlyOnLanguage("cxx");
.onlyOnLanguages("cxx", "cpp", "c");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static List<PropertyDefinition> properties() {
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX xUnit Test report import")
//.onlyOnLanguage(getLanguage().getKey())
//.onlyOnLanguages("cxx","cpp", "c")
.onlyWhenConfiguration(conf -> conf.hasKey(REPORT_PATH_KEY));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static String createErrorMsg(ValgrindError error, ValgrindStack stack, i
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX Valgrind report import")
.onlyOnLanguage("cxx")
.onlyOnLanguages("cxx", "cpp", "c")
.createIssuesForRuleRepository(getRuleRepositoryKey())
.onlyWhenConfiguration(conf -> conf.hasKey(REPORT_PATH_KEY));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static List<PropertyDefinition> properties() {
public void describe(SensorDescriptor descriptor) {
descriptor
.name("CXX Vera++ report import")
.onlyOnLanguage("cxx")
.onlyOnLanguages("cxx", "cpp", "c")
.createIssuesForRuleRepository(getRuleRepositoryKey())
.onlyWhenConfiguration(conf -> conf.hasKey(getReportPathsKey()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public void sensorDescriptor() {

var softly = new SoftAssertions();
softly.assertThat(descriptor.name()).isEqualTo("CXX Clang Static Analyzer report import");
softly.assertThat(descriptor.languages()).containsOnly("cxx");
softly.assertThat(descriptor.languages()).containsOnly("cxx", "cpp", "c");
softly.assertThat(descriptor.ruleRepositories()).containsOnly(CxxClangSARuleRepository.KEY);
softly.assertAll();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public void sensorDescriptor() {

var softly = new SoftAssertions();
softly.assertThat(descriptor.name()).isEqualTo("CXX Clang-Tidy report import");
softly.assertThat(descriptor.languages()).containsOnly("cxx");
softly.assertThat(descriptor.languages()).containsOnly("cxx", "cpp", "c");
softly.assertThat(descriptor.ruleRepositories()).containsOnly(CxxClangTidyRuleRepository.KEY);
softly.assertAll();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void sensorDescriptorGcc() {
sensor.describe(descriptor);
var softly = new SoftAssertions();
softly.assertThat(descriptor.name()).isEqualTo("CXX GCC compiler report import");
softly.assertThat(descriptor.languages()).containsOnly("cxx");
softly.assertThat(descriptor.languages()).containsOnly("cxx", "cpp", "c");
softly.assertThat(descriptor.ruleRepositories())
.containsOnly(CxxCompilerGccRuleRepository.KEY);
softly.assertAll();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void sensorDescriptorVc() {
sensor.describe(descriptor);
var softly = new SoftAssertions();
softly.assertThat(descriptor.name()).isEqualTo("CXX Visual Studio compiler report import");
softly.assertThat(descriptor.languages()).containsOnly("cxx");
softly.assertThat(descriptor.languages()).containsOnly("cxx", "cpp", "c");
softly.assertThat(descriptor.ruleRepositories())
.containsOnly(CxxCompilerVcRuleRepository.KEY);
softly.assertAll();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public void sensorDescriptor() {

var softly = new SoftAssertions();
softly.assertThat(descriptor.name()).isEqualTo("CXX Visual Studio XML coverage report import");
softly.assertThat(descriptor.languages()).containsOnly("cxx");
softly.assertThat(descriptor.languages()).containsOnly("cxx", "cpp", "c");
softly.assertAll();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void sensorDescriptor() {

var softly = new SoftAssertions();
softly.assertThat(descriptor.name()).isEqualTo("CXX Cppcheck report import");
softly.assertThat(descriptor.languages()).containsOnly("cxx");
softly.assertThat(descriptor.languages()).containsOnly("cxx", "cpp", "c");
softly.assertThat(descriptor.ruleRepositories()).containsOnly(CxxCppCheckRuleRepository.KEY);
softly.assertAll();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void sensorDescriptor() {

var softly = new SoftAssertions();
softly.assertThat(descriptor.name()).isEqualTo("CXX Dr. Memory report import");
softly.assertThat(descriptor.languages()).containsOnly("cxx");
softly.assertThat(descriptor.languages()).containsOnly("cxx", "cpp", "c");
softly.assertThat(descriptor.ruleRepositories()).containsOnly(CxxDrMemoryRuleRepository.KEY);
softly.assertAll();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void sensorDescriptor() {

var softly = new SoftAssertions();
softly.assertThat(descriptor.name()).isEqualTo("CXX Infer report import");
softly.assertThat(descriptor.languages()).containsOnly("cxx");
softly.assertThat(descriptor.languages()).containsOnly("cxx", "cpp", "c");
softly.assertThat(descriptor.ruleRepositories()).containsOnly(CxxInferRuleRepository.KEY);
softly.assertAll();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public void sensorDescriptor() {

var softly = new SoftAssertions();
softly.assertThat(descriptor.name()).isEqualTo("CXX external analyser report import");
softly.assertThat(descriptor.languages()).containsOnly("cxx");
softly.assertThat(descriptor.languages()).containsOnly("cxx", "cpp", "c");
softly.assertThat(descriptor.ruleRepositories()).containsOnly(CxxOtherRepository.KEY);
softly.assertAll();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public void sensorDescriptor() {

var softly = new SoftAssertions();
softly.assertThat(descriptor.name()).isEqualTo("CXX PC-lint report import");
softly.assertThat(descriptor.languages()).containsOnly("cxx");
softly.assertThat(descriptor.languages()).containsOnly("cxx", "cpp", "c");
softly.assertThat(descriptor.ruleRepositories()).containsOnly(CxxPCLintRuleRepository.KEY);
softly.assertAll();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void sensorDescriptor() {

var softly = new SoftAssertions();
softly.assertThat(descriptor.name()).isEqualTo("CXX RATS report import");
softly.assertThat(descriptor.languages()).containsOnly("cxx");
softly.assertThat(descriptor.languages()).containsOnly("cxx", "cpp", "c");
softly.assertThat(descriptor.ruleRepositories()).containsOnly(CxxRatsRuleRepository.KEY);
softly.assertAll();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void sensorDescriptor() {

var softly = new SoftAssertions();
softly.assertThat(descriptor.name()).isEqualTo("CXX VSTest/xUnit/NUnit Test report import");
softly.assertThat(descriptor.languages()).containsOnly("cxx");
softly.assertThat(descriptor.languages()).containsOnly("cxx", "cpp", "c");
softly.assertAll();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ public void executeImpl() {

@Override
public void describe(SensorDescriptor descriptor) {
descriptor.onlyOnLanguage("cxx").name("CxxReportSensorTest");
descriptor
.name("CxxReportSensorTest")
.onlyOnLanguages("cxx", "cpp", "c");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void sensorDescriptor() {

var softly = new SoftAssertions();
softly.assertThat(descriptor.name()).isEqualTo("CXX Valgrind report import");
softly.assertThat(descriptor.languages()).containsOnly("cxx");
softly.assertThat(descriptor.languages()).containsOnly("cxx", "cpp", "c");
softly.assertThat(descriptor.ruleRepositories()).containsOnly(CxxValgrindRuleRepository.KEY);
softly.assertAll();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void sensorDescriptor() {

var softly = new SoftAssertions();
softly.assertThat(descriptor.name()).isEqualTo("CXX Vera++ report import");
softly.assertThat(descriptor.languages()).containsOnly("cxx");
softly.assertThat(descriptor.languages()).containsOnly("cxx", "cpp", "c");
softly.assertThat(descriptor.ruleRepositories()).containsOnly(CxxVeraxxRuleRepository.KEY);
softly.assertAll();
}
Expand Down

0 comments on commit 2d2206c

Please sign in to comment.