Skip to content

Commit

Permalink
Release v1.11.0-RC.2
Browse files Browse the repository at this point in the history
  • Loading branch information
theshadowco committed Apr 17, 2022
2 parents 241779f + cf5d6a2 commit f2c9bae
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v3.0.0
uses: actions/setup-java@v3.1.1
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/night_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
ref: nigth_build
- name: Set up JDK
uses: actions/setup-java@v3.0.0
uses: actions/setup-java@v3.1.1
with:
java-version: 11
distribution: 'adopt'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- run: |
git fetch --prune --unshallow
- name: Set up JDK 11
uses: actions/setup-java@v3.0.0
uses: actions/setup-java@v3.1.1
with:
java-version: 11
distribution: 'adopt'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
- name: Checkout source
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3.0.0
uses: actions/setup-java@v3.1.1
with:
java-version: 11
distribution: 'adopt'
- name: Build with Gradle
run: ./gradlew build
- name: Upload jar to release
uses: AButler/upload-release-assets@v1.0
uses: AButler/upload-release-assets@v2.0
with:
files: './build/libs/*.jar'
repo-token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
id("com.github.johnrengelman.shadow") version("7.0.0")
id("com.github.ben-manes.versions") version "0.42.0"
id("com.github.gradle-git-version-calculator") version "1.1.0"
id("io.freefair.lombok") version "6.4.1"
id("io.freefair.lombok") version "6.4.2"
}

group = "io.github.1c-syntax"
Expand All @@ -36,7 +36,7 @@ dependencies {
implementation("io.github.1c-syntax", "bsl-language-server", "0.20.0-rc.2")

implementation("org.apache.commons:commons-lang3:3.12.0")
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.1")
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.2.2")

// https://mvnrepository.com/artifact/org.sonarsource.analyzer-commons/sonar-analyzer-commons
implementation("org.sonarsource.analyzer-commons:sonar-analyzer-commons:1.24.0.965")
Expand All @@ -55,7 +55,7 @@ dependencies {
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", "5.8.0")

testImplementation("org.assertj:assertj-core:3.22.0")
testImplementation("org.mockito:mockito-core:4.3.1")
testImplementation("org.mockito:mockito-core:4.4.0")

testImplementation("org.sonarsource.sonarqube", "sonar-testing-harness", sonarQubeVersion)
testImplementation("org.sonarsource.sonarqube", "sonar-core", sonarQubeVersion)
Expand Down
14 changes: 11 additions & 3 deletions src/main/java/com/github/_1c_syntax/bsl/sonar/BSLCoreSensor.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;
Expand All @@ -78,7 +79,7 @@ public class BSLCoreSensor implements Sensor {
private final FileLinesContextFactory fileLinesContextFactory;

private final boolean langServerEnabled;
private final List<String> sourcesList;
private final List<String> sourcesList = new ArrayList<>();
private final IssuesLoader issuesLoader;
private final BSLHighlighter highlighter;

Expand All @@ -89,12 +90,19 @@ public BSLCoreSensor(SensorContext context, FileLinesContextFactory fileLinesCon
langServerEnabled = context.config().getBoolean(BSLCommunityProperties.LANG_SERVER_ENABLED_KEY)
.orElse(BSLCommunityProperties.LANG_SERVER_ENABLED_DEFAULT_VALUE);

sourcesList = context.config().get("sonar.sources")
sourcesList.addAll(context.config().get("sonar.sources")
.map(sources ->
Arrays.stream(StringUtils.split(sources, ","))
.map(String::strip)
.collect(Collectors.toList()))
.orElse(Collections.singletonList("."));
.orElse(Collections.singletonList(".")));

sourcesList.addAll(context.config().get("sonar.tests")
.map(sources ->
Arrays.stream(StringUtils.split(sources, ","))
.map(String::strip)
.collect(Collectors.toList()))
.orElse(Collections.emptyList()));

issuesLoader = new IssuesLoader(context);
highlighter = new BSLHighlighter(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class BSLCoreSensorTest {

private final String BASE_PATH = "src/test/resources/examples";
private final File BASE_DIR = new File(BASE_PATH).getAbsoluteFile();
private final String FILE_NAME = "test.bsl";
private final String FILE_NAME = "src/test.bsl";
private final Version SONAR_VERSION = Version.create(7, 9);
private final SensorContextTester context = SensorContextTester.create(BASE_DIR);
private final SensorContextTester context = createSensorContext();

@Test
void testDescriptor() {
Expand Down Expand Up @@ -240,6 +240,8 @@ private SensorContextTester createSensorContext() {
var context = SensorContextTester.create(BASE_DIR);
context.fileSystem().setEncoding(StandardCharsets.UTF_8);
context.setRuntime(sonarRuntime);
context.settings().setProperty("sonar.sources", "src");
context.settings().setProperty("sonar.tests", "test");

var inputFile = Tools.inputFileBSL(FILE_NAME, BASE_DIR);
context.fileSystem().add(inputFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class BSLHighlighterTest {

private final String BASE_PATH = "src/test/resources/src";
private final File BASE_DIR = new File(BASE_PATH).getAbsoluteFile();
private final String FILE_NAME = "test.bsl";
private final String FILE_NAME = "src/test.bsl";

private SensorContextTester context;
private BSLHighlighter highlighter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class IssuesLoaderTest {

private final String BASE_PATH = "src/test/resources/examples";
private final File BASE_DIR = new File(BASE_PATH).getAbsoluteFile();
private final String FILE_NAME = "test.bsl";
private final String FILE_NAME = "src/test.bsl";

@Test
void test_createExtIssue() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void test_describe() {
@Test
void test_execute() {

var FILE_NAME = "test.bsl";
var FILE_NAME = "src/test.bsl";
var inputFile = Tools.inputFileBSL(FILE_NAME, BASE_DIR);

var sonarRuntime = SonarRuntimeImpl.forSonarLint(Version.create(7, 9));
Expand Down
File renamed without changes.
16 changes: 16 additions & 0 deletions src/test/resources/examples/test/test.bsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Функция Обработчик(Параметр1, Параметр2, Отказ, Параметр4)
Отказ = Истина;
Возврат А; Возврат А;

Для Каждого Элемент Из Новый Массив Цикл
Сообщить("Да")
КонецЦикла;
КонецФункции

#Область Тест

Проверка = Истина;
Число = 0.01;
// Комментарий?

#КонецОбласти

0 comments on commit f2c9bae

Please sign in to comment.