From f8c68f1841cef9840aa8d5db73e50b872b572471 Mon Sep 17 00:00:00 2001 From: David RACODON Date: Mon, 15 Oct 2018 13:36:54 +0200 Subject: [PATCH] Fix #117 Parent selector (&) not supported in variable declaration --- .travis.yml | 4 +- CONTRIBUTING.md | 2 +- appveyor.yml | 4 +- .../org/sonar/css/parser/LexicalGrammar.java | 6 +- .../sonar/css/parser/scss/ScssGrammar.java | 36 +++++++++++- .../scss/ScssVariableDeclarationTreeImpl.java | 4 +- ...eferencingSelectorWithSpacingTreeTest.java | 56 +++++++++++++++++++ ...ScssParentSelectorWithSpacingTreeTest.java | 47 ++++++++++++++++ .../ScssSassScriptExpressionTreeTest.java | 3 + .../scss/ScssVariableDeclarationTreeTest.java | 5 ++ .../src/test/java/org/sonar/css/Tests.java | 12 ++-- .../test/java/org/sonar/css/its/CssTest.java | 9 ++- pom.xml | 2 +- travis.sh | 2 +- 14 files changed, 170 insertions(+), 22 deletions(-) create mode 100644 css-frontend/src/test/java/org/sonar/css/parser/scss/ScssParentReferencingSelectorWithSpacingTreeTest.java create mode 100644 css-frontend/src/test/java/org/sonar/css/parser/scss/ScssParentSelectorWithSpacingTreeTest.java diff --git a/.travis.yml b/.travis.yml index 61583a18..2ad00dab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,8 @@ env: - secure: "HJzMrBMjJ9+H1UroodSLo0tiUrBytZQz1EqGykWqU/PcgwVjVSTPqvLmFkfPbIZm3on9GElblUQqXV3/J9X2UTu4a/ZmWL5v09Tk2O12jKGbFV71LtlDFvvIoy8DtIIfnE0r642wyu6ii3VVt1J6FI/oixNmF25S6DdWDaA+q3NWlA+MZEae3n1YuQmhkpgoMkWe6xC3H6Oxdo0XgTn0SfqfBES8IM+3hG4FCU6tYfOVoffVEUd1eq3J9W7aGfMQ4zTEAorwroyWuFRDbG+W+PK8uMUJpSDDzjq3271yJAFPtLlGL2f+JPZO5GUui1IW+VM4Ju9YhQ5MiYzQXpdIUKFtBQZr480PrmTL9hP0zZFJA/QkBYr6otyBvaDOEkM1Bv/I9v2EjiutfVKVP09FKIEMNASdCCvtJ6p+BS3r2a74MZNcFtqcjXPd8ROxrh49n6hrkt99jvwsybgTpsgayTxT0N6Pdd1ni6sAiQ3LtXo6vFCi2apJ1v1hBoOXRfNvIdq00inyQI/P3LNcQzXLTou63oh2Z+I7UJcQHnl0pc4pndQMQm4A+22fFUrXRByPJK2dZpd7l/PSIEl0reirzk3UIUw1qmJlZyabAmPJPzPjvodjbH3pH5mK0S050UNDXi6G1u+F91td5gMrXxq3sA4/GIp1RpyoovSrOzIZEf4=" - secure: "P3gRgSFJNUfku81Yl61Fh5QbkH5E4ccFSv9zbwNwQQkTVNTXd3Zv5TVTjt/eXI/wM7PZnDrhWxz8y7D4J1vZjqvbIGnmXyjsm/jX83HTDt70aE/4N4oKCZcEr783H2xlXcUnrxPXW87vV4Bw/JU7EVF26jC1tAIrnfVUMfNxYMpxCi19S7Qg72nOGcNgDJbQj/Unl7UEmbEPV4POiytwF6oVDWLp+Ys8JjujeS9rCtd6vzKxBR08WLAlqG07SSLb98UxCZA+p+D7uFfQMOAkp91L9S+vXXn0FIDczmEEYaAnPRJYszDfaEr6aQSvIQVyaWVqLYBKuSFZpnXPqyczgtXgNVk1H01gRtXPjF18kAD8e/UT/n4x9YvsN7FRDr5mXO0wd/XPmbZ9D2ZrOqDNKNzFv3LdnzpWL1BJsgAbI/nhUqjz1WJ+WVUXDq6jNMegJOXGRia04D05XKBgW71ULmMZrKNufab1l9Hy2gEVpZ0AgUlSxRLNmvYLh1TZTS9Tp2ONHEBkVEFo3tbt7hP8MeTM/6sqwhhY27CGv9yfmEMBLNURDodaXAyUQEBBbCF6KLIkX+RoQsvho2+TZE1jxheY1MffL+MlWtmbVCpK46W7yeB1Gk+AptY7vJ5JsRa+RWrrwFEChfgymWJfIwPiFVRm947XAv6QirsWNJV9fqw=" matrix: - - SQ_VERSION=LTS - - SQ_VERSION=LATEST_RELEASE + - SQ_VERSION=LATEST_RELEASE[6.7] + - SQ_VERSION=DEV cache: directories: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 19db6c4e..b70bc996 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,5 +14,5 @@ You feel like: ## Building / Testing / Releasing * Building and running unit tests: `mvn clean install` -* Building and running unit tests and running integration tests: `mvn clean install -Pits -Dsonar.runtimeVersion=$VERSION` ($VERSION = 'LTS' or 'LATEST_RELEASE'). Behind a proxy, add `-Dhttps.proxyHost=localhost -Dhttps.proxyPort=3128 -Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128`. +* Building and running unit tests and running integration tests: `mvn clean install -Pits -Dsonar.runtimeVersion=$VERSION` ($VERSION = 'LATEST_RELEASE[X.X]' or 'DEV'). Behind a proxy, add `-Dhttps.proxyHost=localhost -Dhttps.proxyPort=3128 -Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128`. * Releasing on Maven Central: `mvn clean deploy -Possrh` diff --git a/appveyor.yml b/appveyor.yml index 8ab915db..bc5712b0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,8 +12,8 @@ install: environment: matrix: - - SQ_VERSION: "LTS" - - SQ_VERSION: "LATEST_RELEASE" + - SQ_VERSION: "LATEST_RELEASE[6.7]" + - SQ_VERSION: "DEV" platform: - x64 diff --git a/css-frontend/src/main/java/org/sonar/css/parser/LexicalGrammar.java b/css-frontend/src/main/java/org/sonar/css/parser/LexicalGrammar.java index ca201d09..72409b99 100644 --- a/css-frontend/src/main/java/org/sonar/css/parser/LexicalGrammar.java +++ b/css-frontend/src/main/java/org/sonar/css/parser/LexicalGrammar.java @@ -197,10 +197,13 @@ public enum LexicalGrammar implements GrammarRuleKey { SCSS_MIXIN_BLOCK, - SCSS_PARENT_SELECTOR, SCSS_PARENT_SELECTOR_KEYWORD, + SCSS_PARENT_SELECTOR_KEYWORD_WITH_SPACING, + SCSS_PARENT_SELECTOR, + SCSS_PARENT_SELECTOR_WITH_SPACING, SCSS_PARENT_SELECTOR_COMBINATOR, SCSS_PARENT_REFERENCING_SELECTOR, + SCSS_PARENT_REFERENCING_SELECTOR_WITH_SPACING, SCSS_PLACEHOLDER_SELECTOR, SCSS_EXTEND, @@ -594,6 +597,7 @@ private static void scss(LexerlessGrammarBuilder b) { b.rule(SCSS_DOLLAR).is(b.token(GenericTokenType.LITERAL, "$")); b.rule(SCSS_ELLIPSIS).is(b.token(GenericTokenType.LITERAL, "...")); b.rule(SCSS_PARENT_SELECTOR_KEYWORD).is("&"); + b.rule(SCSS_PARENT_SELECTOR_KEYWORD_WITH_SPACING).is(SPACING, "&"); b.rule(SCSS_VARIABLE_PREFIX).is(SPACING, SCSS_DOLLAR); b.rule(SCSS_DEFAULT_KEYWORD).is(SPACING, b.token(GenericTokenType.LITERAL, "!default")); diff --git a/css-frontend/src/main/java/org/sonar/css/parser/scss/ScssGrammar.java b/css-frontend/src/main/java/org/sonar/css/parser/scss/ScssGrammar.java index a3015f4c..595b5b58 100644 --- a/css-frontend/src/main/java/org/sonar/css/parser/scss/ScssGrammar.java +++ b/css-frontend/src/main/java/org/sonar/css/parser/scss/ScssGrammar.java @@ -26,7 +26,23 @@ import org.sonar.css.tree.impl.SeparatedList; import org.sonar.css.tree.impl.css.InternalSyntaxToken; import org.sonar.plugins.css.api.tree.Tree; -import org.sonar.plugins.css.api.tree.css.*; +import org.sonar.plugins.css.api.tree.css.AttributeMatcherExpressionTree; +import org.sonar.plugins.css.api.tree.css.AttributeSelectorTree; +import org.sonar.plugins.css.api.tree.css.ClassSelectorTree; +import org.sonar.plugins.css.api.tree.css.CompoundSelectorTree; +import org.sonar.plugins.css.api.tree.css.DeclarationTree; +import org.sonar.plugins.css.api.tree.css.DelimiterTree; +import org.sonar.plugins.css.api.tree.css.IdSelectorTree; +import org.sonar.plugins.css.api.tree.css.IdentifierTree; +import org.sonar.plugins.css.api.tree.css.PropertyTree; +import org.sonar.plugins.css.api.tree.css.PseudoIdentifierTree; +import org.sonar.plugins.css.api.tree.css.SelectorCombinatorTree; +import org.sonar.plugins.css.api.tree.css.SelectorTree; +import org.sonar.plugins.css.api.tree.css.StatementBlockTree; +import org.sonar.plugins.css.api.tree.css.StyleSheetTree; +import org.sonar.plugins.css.api.tree.css.TypeSelectorTree; +import org.sonar.plugins.css.api.tree.css.ValueCommaSeparatedListTree; +import org.sonar.plugins.css.api.tree.css.ValueTree; import org.sonar.plugins.css.api.tree.scss.*; /** @@ -129,6 +145,8 @@ public Tree ANY_WITHOUT_COMMA_SEPARATED_LIST() { public Tree ANY_SASS_SCRIPT_EXPRESSION() { return b.nonterminal().is( b.firstOf( + SCSS_PARENT_REFERENCING_SELECTOR_WITH_SPACING(), + SCSS_PARENT_SELECTOR_WITH_SPACING(), VALUE_COMMA_SEPARATED_LIST(), IMPORTANT_FLAG(), SCSS_GLOBAL_FLAG(), @@ -154,6 +172,8 @@ public Tree ANY_SASS_SCRIPT_EXPRESSION() { public Tree ANY_SASS_SCRIPT_EXPRESSION_WITHOUT_COMMA_SEPARATED_LIST() { return b.nonterminal().is( b.firstOf( + SCSS_PARENT_REFERENCING_SELECTOR_WITH_SPACING(), + SCSS_PARENT_SELECTOR_WITH_SPACING(), IMPORTANT_FLAG(), SCSS_GLOBAL_FLAG(), SCSS_DEFAULT_FLAG(), @@ -353,6 +373,11 @@ public ScssParentSelectorTree SCSS_PARENT_SELECTOR() { f.scssParentSelector(b.token(LexicalGrammar.SCSS_PARENT_SELECTOR_KEYWORD))); } + public ScssParentSelectorTree SCSS_PARENT_SELECTOR_WITH_SPACING() { + return b.nonterminal(LexicalGrammar.SCSS_PARENT_SELECTOR_WITH_SPACING).is( + f.scssParentSelector(b.token(LexicalGrammar.SCSS_PARENT_SELECTOR_KEYWORD_WITH_SPACING))); + } + public ScssParentReferencingSelectorTree SCSS_PARENT_REFERENCING_SELECTOR() { return b.nonterminal(LexicalGrammar.SCSS_PARENT_REFERENCING_SELECTOR).is( f.scssParentReferencingSelector( @@ -362,6 +387,15 @@ public ScssParentReferencingSelectorTree SCSS_PARENT_REFERENCING_SELECTOR() { IDENTIFIER_NO_WS()))); } + public ScssParentReferencingSelectorTree SCSS_PARENT_REFERENCING_SELECTOR_WITH_SPACING() { + return b.nonterminal(LexicalGrammar.SCSS_PARENT_REFERENCING_SELECTOR_WITH_SPACING).is( + f.scssParentReferencingSelector( + SCSS_PARENT_SELECTOR_WITH_SPACING(), + b.firstOf( + SCSS_INTERPOLATED_IDENTIFIER_NO_WS(), + IDENTIFIER_NO_WS()))); + } + public ScssPlaceholderSelectorTree SCSS_PLACEHOLDER_SELECTOR() { return b.nonterminal(LexicalGrammar.SCSS_PLACEHOLDER_SELECTOR).is( f.scssPlaceholderSelector( diff --git a/css-frontend/src/main/java/org/sonar/css/tree/impl/scss/ScssVariableDeclarationTreeImpl.java b/css-frontend/src/main/java/org/sonar/css/tree/impl/scss/ScssVariableDeclarationTreeImpl.java index 6067d762..bf5619b3 100644 --- a/css-frontend/src/main/java/org/sonar/css/tree/impl/scss/ScssVariableDeclarationTreeImpl.java +++ b/css-frontend/src/main/java/org/sonar/css/tree/impl/scss/ScssVariableDeclarationTreeImpl.java @@ -82,14 +82,14 @@ public ValueTree value() { @Nullable public ScssDefaultFlagTree defaultFlag() { Optional defaultFlag = value.firstValueElementOfType(ScssDefaultFlagTree.class); - return defaultFlag.isPresent() ? defaultFlag.get() : null; + return defaultFlag.orElse(null); } @Override @Nullable public ScssGlobalFlagTree globalFlag() { Optional globalFlag = value.firstValueElementOfType(ScssGlobalFlagTree.class); - return globalFlag.isPresent() ? globalFlag.get() : null; + return globalFlag.orElse(null); } @Override diff --git a/css-frontend/src/test/java/org/sonar/css/parser/scss/ScssParentReferencingSelectorWithSpacingTreeTest.java b/css-frontend/src/test/java/org/sonar/css/parser/scss/ScssParentReferencingSelectorWithSpacingTreeTest.java new file mode 100644 index 00000000..2602f5a7 --- /dev/null +++ b/css-frontend/src/test/java/org/sonar/css/parser/scss/ScssParentReferencingSelectorWithSpacingTreeTest.java @@ -0,0 +1,56 @@ +/* + * SonarQube CSS / SCSS / Less Analyzer + * Copyright (C) 2013-2017 David RACODON + * mailto: david.racodon@gmail.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.css.parser.scss; + +import org.junit.Test; +import org.sonar.css.parser.LexicalGrammar; +import org.sonar.plugins.css.api.tree.scss.ScssParentReferencingSelectorTree; + +import static org.fest.assertions.Assertions.assertThat; + +public class ScssParentReferencingSelectorWithSpacingTreeTest extends ScssTreeTest { + + public ScssParentReferencingSelectorWithSpacingTreeTest() { + super(LexicalGrammar.SCSS_PARENT_REFERENCING_SELECTOR_WITH_SPACING); + } + + @Test + public void scssParentReferencingSelector() { + checkParsed("&-bar", "-bar"); + checkParsed(" &-bar", "-bar"); + checkParsed("&bar", "bar"); + checkParsed(" &bar", "bar"); + } + + @Test + public void notScssParentReferencingSelector() { + checkNotParsed("&"); + checkNotParsed("& bar"); + } + + private void checkParsed(String toParse, String expectedIdentifier) { + ScssParentReferencingSelectorTree tree = (ScssParentReferencingSelectorTree) parser().parse(toParse); + assertThat(tree).isNotNull(); + assertThat(tree.parent()).isNotNull(); + assertThat(tree.append()).isNotNull(); + assertThat(tree.text()).isEqualTo(expectedIdentifier); + } + +} diff --git a/css-frontend/src/test/java/org/sonar/css/parser/scss/ScssParentSelectorWithSpacingTreeTest.java b/css-frontend/src/test/java/org/sonar/css/parser/scss/ScssParentSelectorWithSpacingTreeTest.java new file mode 100644 index 00000000..5a34151d --- /dev/null +++ b/css-frontend/src/test/java/org/sonar/css/parser/scss/ScssParentSelectorWithSpacingTreeTest.java @@ -0,0 +1,47 @@ +/* + * SonarQube CSS / SCSS / Less Analyzer + * Copyright (C) 2013-2017 David RACODON + * mailto: david.racodon@gmail.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.css.parser.scss; + +import org.junit.Test; +import org.sonar.css.parser.LexicalGrammar; +import org.sonar.plugins.css.api.tree.scss.ScssParentSelectorTree; + +import static org.fest.assertions.Assertions.assertThat; + +public class ScssParentSelectorWithSpacingTreeTest extends ScssTreeTest { + + public ScssParentSelectorWithSpacingTreeTest() { + super(LexicalGrammar.SCSS_PARENT_SELECTOR_WITH_SPACING); + } + + @Test + public void sscsParentSelector() { + checkParsed("&"); + checkParsed(" &"); + } + + private void checkParsed(String toParse) { + ScssParentSelectorTree tree = (ScssParentSelectorTree) parser().parse(toParse); + assertThat(tree).isNotNull(); + assertThat(tree.parentSelector()).isNotNull(); + assertThat(tree.parentSelector().text()).isEqualTo("&"); + } + +} diff --git a/css-frontend/src/test/java/org/sonar/css/parser/scss/ScssSassScriptExpressionTreeTest.java b/css-frontend/src/test/java/org/sonar/css/parser/scss/ScssSassScriptExpressionTreeTest.java index e53c5122..b2e3185a 100644 --- a/css-frontend/src/test/java/org/sonar/css/parser/scss/ScssSassScriptExpressionTreeTest.java +++ b/css-frontend/src/test/java/org/sonar/css/parser/scss/ScssSassScriptExpressionTreeTest.java @@ -37,6 +37,9 @@ public void scssSassScriptExpression() { checkParsed("1 + 2"); checkParsed("(a: 2, b: 3)"); checkParsed("abc((a: 2, b: 3))"); + checkParsed("&"); + checkParsed("&-name"); + checkParsed("&-name abc"); } private ValueTree checkParsed(String toParse) { diff --git a/css-frontend/src/test/java/org/sonar/css/parser/scss/ScssVariableDeclarationTreeTest.java b/css-frontend/src/test/java/org/sonar/css/parser/scss/ScssVariableDeclarationTreeTest.java index 57e766a3..1e8f9a44 100644 --- a/css-frontend/src/test/java/org/sonar/css/parser/scss/ScssVariableDeclarationTreeTest.java +++ b/css-frontend/src/test/java/org/sonar/css/parser/scss/ScssVariableDeclarationTreeTest.java @@ -56,6 +56,11 @@ public void scssVariableDeclaration() { checkParsed(" $abc : 123"); checkParsed(" $abc : 123;"); checkParsed(" $abc: 10, $def"); + checkParsed(" $abc:&"); + checkParsed(" $abc:&-name"); + checkParsed(" $abc: &"); + checkParsed(" $abc: &-name"); + checkParsed(" $abc: &-name abc"); checkParsed("$grid-gutter-widths: (\n" + " xs: $grid-gutter-width-base,\n" + diff --git a/its/plugin/tests/src/test/java/org/sonar/css/Tests.java b/its/plugin/tests/src/test/java/org/sonar/css/Tests.java index 54c48855..9eb9eb70 100644 --- a/its/plugin/tests/src/test/java/org/sonar/css/Tests.java +++ b/its/plugin/tests/src/test/java/org/sonar/css/Tests.java @@ -53,7 +53,8 @@ public class Tests { @ClassRule public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() - .addPlugin(FileLocation.byWildcardFilename(new File("../../../sonar-css-plugin/target"), "sonar-css-plugin-*-SNAPSHOT.jar")) + .setSonarVersion(System.getProperty("sonar.runtimeVersion", "DEV")) + .addPlugin(FileLocation.byWildcardMavenFilename(new File("../../../sonar-css-plugin/target"), "sonar-css-plugin-*-SNAPSHOT.jar")) .addPlugin(FileLocation.byWildcardFilename(new File("../plugins/css-custom-rules-plugin/target"), "css-custom-rules-plugin-*-SNAPSHOT.jar")) .restoreProfileAtStartup(FileLocation.ofClasspath("/org/sonar/css/profiles/css-zero-units-only-profile.xml")) .restoreProfileAtStartup(FileLocation.ofClasspath("/org/sonar/css/profiles/less-zero-units-only-profile.xml")) @@ -68,11 +69,10 @@ public class Tests { .build(); public static SonarScanner createSonarScannerBuild() { - SonarScanner build = SonarScanner.create(); - build.setProjectVersion("1.0"); - build.setSourceEncoding("UTF-8"); - build.setSourceDirs("src"); - return build; + return SonarScanner.create() + .setProjectVersion("1.0") + .setSourceEncoding("UTF-8") + .setSourceDirs("src"); } public static void setCssProfile(String profileName, String projectKey) { diff --git a/its/ruling/tests/src/test/java/org/sonar/css/its/CssTest.java b/its/ruling/tests/src/test/java/org/sonar/css/its/CssTest.java index 44c32162..5101d7b8 100644 --- a/its/ruling/tests/src/test/java/org/sonar/css/its/CssTest.java +++ b/its/ruling/tests/src/test/java/org/sonar/css/its/CssTest.java @@ -23,6 +23,7 @@ import com.sonar.orchestrator.Orchestrator; import com.sonar.orchestrator.build.SonarScanner; import com.sonar.orchestrator.locator.FileLocation; +import com.sonar.orchestrator.locator.MavenLocation; import org.junit.Before; import org.junit.ClassRule; import org.junit.Test; @@ -39,9 +40,9 @@ public class CssTest { @ClassRule public static Orchestrator orchestrator = Orchestrator.builderEnv() + .setSonarVersion(System.getProperty("sonar.runtimeVersion", "DEV")) .addPlugin(FileLocation.byWildcardMavenFilename(new File("../../../sonar-css-plugin/target"), "sonar-css-plugin-*-SNAPSHOT.jar")) - .setOrchestratorProperty("litsVersion", "0.6") - .addPlugin("lits") + .addPlugin(MavenLocation.of("org.sonarsource.sonar-lits-plugin", "sonar-lits-plugin", "0.6")) .build(); @Before @@ -70,13 +71,11 @@ public void test() throws Exception { .setProjectKey("project") .setSourceDirs("./") .setSourceEncoding("UTF-8") - .setProperty("sonar.import_unknown_files", "true") .setProperty("sonar.analysis.mode", "preview") - .setProperty("sonar.issuesReport.html.enable", "true") .setProperty("dump.old", FileLocation.of("src/test/expected").getFile().getAbsolutePath()) .setProperty("dump.new", FileLocation.of("target/actual").getFile().getAbsolutePath()) .setProperty("lits.differences", litsDifferencesFile.getAbsolutePath()) - .setProperty("sonar.cpd.skip", "true"); + .setProperty("sonar.cpd.exclusions", "**/*"); orchestrator.executeBuild(build); assertThat(Files.asCharSource(litsDifferencesFile, StandardCharsets.UTF_8).read()).isEmpty(); diff --git a/pom.xml b/pom.xml index 9e2cb109..c745aca4 100644 --- a/pom.xml +++ b/pom.xml @@ -127,7 +127,7 @@ org.sonarsource.orchestrator sonar-orchestrator - 3.15.2.1322 + 3.22.0.1791 com.oracle diff --git a/travis.sh b/travis.sh index 623ffeef..17d2c065 100755 --- a/travis.sh +++ b/travis.sh @@ -6,7 +6,7 @@ git fetch --unshallow mvn -B clean install -Pits -Dsonar.runtimeVersion=$SQ_VERSION -if [ "$SQ_VERSION" == "LTS" ]; then +if [ "$SQ_VERSION" == "DEV" ]; then mvnCommand='mvn -B sonar:sonar' commonArgs="-Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -Dsonar.organization=racodond-github"