Skip to content

Commit 796b8d3

Browse files
committed
Fix #117 Parent selector (&) not supported in variable declaration
1 parent d5f6b59 commit 796b8d3

File tree

7 files changed

+19
-14
lines changed

7 files changed

+19
-14
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ You feel like:
1414

1515
## Building / Testing / Releasing
1616
* Building and running unit tests: `mvn clean install`
17-
* 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`.
17+
* 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`.
1818
* Releasing on Maven Central: `mvn clean deploy -Possrh`

appveyor.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ install:
1212

1313
environment:
1414
matrix:
15-
- SQ_VERSION: "LTS"
16-
- SQ_VERSION: "LATEST_RELEASE"
15+
- SQ_VERSION: "LATEST_RELEASE[6.7]"
16+
- SQ_VERSION: "DEV"
1717

1818
platform:
1919
- x64

css-frontend/src/main/java/org/sonar/css/parser/scss/ScssGrammar.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ public Tree ANY_SASS_SCRIPT_EXPRESSION() {
148148
HASH(),
149149
UNICODE_RANGE(),
150150
IDENTIFIER(),
151-
SCSS_VARIABLE()));
151+
SCSS_VARIABLE(),
152+
SCSS_PARENT_REFERENCING_SELECTOR(),
153+
SCSS_PARENT_SELECTOR()));
152154
}
153155

154156
public Tree ANY_SASS_SCRIPT_EXPRESSION_WITHOUT_COMMA_SEPARATED_LIST() {
@@ -172,7 +174,9 @@ public Tree ANY_SASS_SCRIPT_EXPRESSION_WITHOUT_COMMA_SEPARATED_LIST() {
172174
HASH(),
173175
UNICODE_RANGE(),
174176
IDENTIFIER(),
175-
SCSS_VARIABLE()));
177+
SCSS_VARIABLE(),
178+
SCSS_PARENT_REFERENCING_SELECTOR(),
179+
SCSS_PARENT_SELECTOR()));
176180
}
177181

178182
// -----------------------

its/plugin/tests/src/test/java/org/sonar/css/Tests.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.sonar.orchestrator.Orchestrator;
2323
import com.sonar.orchestrator.build.SonarScanner;
2424
import com.sonar.orchestrator.locator.FileLocation;
25+
import com.sonar.orchestrator.locator.MavenLocation;
2526
import org.junit.ClassRule;
2627
import org.junit.runner.RunWith;
2728
import org.junit.runners.Suite;
@@ -53,8 +54,9 @@ public class Tests {
5354

5455
@ClassRule
5556
public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv()
56-
.addPlugin(FileLocation.byWildcardFilename(new File("../../../sonar-css-plugin/target"), "sonar-css-plugin-*-SNAPSHOT.jar"))
57-
.addPlugin(FileLocation.byWildcardFilename(new File("../plugins/css-custom-rules-plugin/target"), "css-custom-rules-plugin-*-SNAPSHOT.jar"))
57+
.setSonarVersion(System.getProperty("sonar.runtimeVersion", "DEV"))
58+
.addPlugin(FileLocation.byWildcardMavenFilename(new File("../../../sonar-css-plugin/target"), "sonar-css-plugin-*-SNAPSHOT.jar"))
59+
.addPlugin(MavenLocation.of("org.sonarsource.sonar-lits-plugin", "sonar-lits-plugin", "0.6"))
5860
.restoreProfileAtStartup(FileLocation.ofClasspath("/org/sonar/css/profiles/css-zero-units-only-profile.xml"))
5961
.restoreProfileAtStartup(FileLocation.ofClasspath("/org/sonar/css/profiles/less-zero-units-only-profile.xml"))
6062
.restoreProfileAtStartup(FileLocation.ofClasspath("/org/sonar/css/profiles/scss-zero-units-only-profile.xml"))

its/ruling/tests/src/test/java/org/sonar/css/its/CssTest.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.sonar.orchestrator.Orchestrator;
2424
import com.sonar.orchestrator.build.SonarScanner;
2525
import com.sonar.orchestrator.locator.FileLocation;
26+
import com.sonar.orchestrator.locator.MavenLocation;
2627
import org.junit.Before;
2728
import org.junit.ClassRule;
2829
import org.junit.Test;
@@ -39,9 +40,9 @@ public class CssTest {
3940

4041
@ClassRule
4142
public static Orchestrator orchestrator = Orchestrator.builderEnv()
43+
.setSonarVersion(System.getProperty("sonar.runtimeVersion", "DEV"))
4244
.addPlugin(FileLocation.byWildcardMavenFilename(new File("../../../sonar-css-plugin/target"), "sonar-css-plugin-*-SNAPSHOT.jar"))
43-
.setOrchestratorProperty("litsVersion", "0.6")
44-
.addPlugin("lits")
45+
.addPlugin(MavenLocation.of("org.sonarsource.sonar-lits-plugin", "sonar-lits-plugin", "0.6"))
4546
.build();
4647

4748
@Before
@@ -70,13 +71,11 @@ public void test() throws Exception {
7071
.setProjectKey("project")
7172
.setSourceDirs("./")
7273
.setSourceEncoding("UTF-8")
73-
.setProperty("sonar.import_unknown_files", "true")
7474
.setProperty("sonar.analysis.mode", "preview")
75-
.setProperty("sonar.issuesReport.html.enable", "true")
7675
.setProperty("dump.old", FileLocation.of("src/test/expected").getFile().getAbsolutePath())
7776
.setProperty("dump.new", FileLocation.of("target/actual").getFile().getAbsolutePath())
7877
.setProperty("lits.differences", litsDifferencesFile.getAbsolutePath())
79-
.setProperty("sonar.cpd.skip", "true");
78+
.setProperty("sonar.cpd.exclusions", "**/*");
8079
orchestrator.executeBuild(build);
8180

8281
assertThat(Files.asCharSource(litsDifferencesFile, StandardCharsets.UTF_8).read()).isEmpty();

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
<dependency>
128128
<groupId>org.sonarsource.orchestrator</groupId>
129129
<artifactId>sonar-orchestrator</artifactId>
130-
<version>3.15.2.1322</version>
130+
<version>3.22.0.1791</version>
131131
<exclusions>
132132
<exclusion>
133133
<groupId>com.oracle</groupId>

travis.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ git fetch --unshallow
66

77
mvn -B clean install -Pits -Dsonar.runtimeVersion=$SQ_VERSION
88

9-
if [ "$SQ_VERSION" == "LTS" ]; then
9+
if [ "$SQ_VERSION" == "DEV" ]; then
1010

1111
mvnCommand='mvn -B sonar:sonar'
1212
commonArgs="-Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -Dsonar.organization=racodond-github"

0 commit comments

Comments
 (0)