Skip to content

Commit 2c04994

Browse files
authored
Merge pull request #351 from 1c-syntax/develop
Sync
2 parents 5f50a77 + f6d523c commit 2c04994

File tree

9 files changed

+19
-11
lines changed

9 files changed

+19
-11
lines changed

.github/workflows/gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515
- name: Set up JDK ${{ matrix.java_version }}
16-
uses: actions/setup-java@v4.2.1
16+
uses: actions/setup-java@v4.5.0
1717
with:
1818
java-version: ${{ matrix.java_version }}
1919
distribution: 'adopt'

.github/workflows/night_build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
ref: nigth_build
1919
- name: Set up JDK
20-
uses: actions/setup-java@v4.2.1
20+
uses: actions/setup-java@v4.5.0
2121
with:
2222
java-version: 17
2323
distribution: 'adopt'
@@ -28,7 +28,7 @@ jobs:
2828
- name: Save current date
2929
run: echo "PLUGIN_CURRENT_DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
3030
- name: Deploy build
31-
uses: WebFreak001/deploy-nightly@v3.1.0
31+
uses: WebFreak001/deploy-nightly@v3.2.0
3232
with:
3333
upload_url: https://uploads.github.com/repos/1c-syntax/sonar-bsl-plugin-community/releases/51033599/assets{?name,label} # find out this value by opening https://api.github.com/repos/<owner>/<repo>/releases in your browser and copy the full "upload_url" value including the {?name,label} part
3434
release_id: 51033599 # same as above (id can just be taken out the upload_url, it's used to find old releases)

.github/workflows/qa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- run: |
1818
git fetch --prune --unshallow
1919
- name: Set up JDK 17
20-
uses: actions/setup-java@v4.2.1
20+
uses: actions/setup-java@v4.5.0
2121
with:
2222
java-version: 17
2323
distribution: 'adopt'

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Checkout source
1515
uses: actions/checkout@v4
1616
- name: Set up JDK
17-
uses: actions/setup-java@v4.2.1
17+
uses: actions/setup-java@v4.5.0
1818
with:
1919
java-version: 17
2020
distribution: 'adopt'

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ plugins {
55
jacoco
66
java
77
`maven-publish`
8-
id("org.sonarqube") version "5.1.0.4882"
8+
id("org.sonarqube") version "6.0.1.5171"
99
id("org.cadixdev.licenser") version "0.6.1"
1010
id("com.github.johnrengelman.shadow") version ("7.0.0")
1111
id("com.github.ben-manes.versions") version "0.51.0"
1212
id("com.github.gradle-git-version-calculator") version "1.1.0"
13-
id("io.freefair.lombok") version "8.6"
13+
id("io.freefair.lombok") version "8.11"
1414
}
1515

1616
group = "io.github.1c-syntax"

src/main/java/com/github/_1c_syntax/bsl/sonar/BSLCoreSensor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ private void saveCpd(InputFile inputFile, DocumentContext documentContext) {
227227
line,
228228
charPositionInLine,
229229
line,
230-
charPositionInLine + tokenText.length(),
230+
charPositionInLine + (int) tokenText.codePoints().count(),
231231
tokenText
232232
);
233233
}

src/main/java/com/github/_1c_syntax/bsl/sonar/BSLHighlighter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public void highlightToken(
201201
line,
202202
charPositionInLine,
203203
line,
204-
charPositionInLine + tokenText.length()
204+
charPositionInLine + (int) tokenText.codePoints().count()
205205
);
206206

207207
var data = new HighlightingData(

src/test/java/com/github/_1c_syntax/bsl/sonar/BSLCoreSensorTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void testComplexity() {
205205
// todo надо как-то нормально ключ компонента определить
206206
var componentKey = "moduleKey:" + FILE_NAME;
207207
assertThat(context.measures(componentKey)).isNotEmpty();
208-
assertThat(context.measure(componentKey, CoreMetrics.COMPLEXITY).value()).isEqualTo(3);
208+
assertThat(context.measure(componentKey, CoreMetrics.COMPLEXITY).value()).isEqualTo(5);
209209
assertThat(context.measure(componentKey, CoreMetrics.COGNITIVE_COMPLEXITY).value()).isEqualTo(1);
210210

211211
}
@@ -225,7 +225,7 @@ void testCPD() {
225225
var componentKey = "moduleKey:" + FILE_NAME;
226226
assertThat(context.cpdTokens(componentKey))
227227
.isNotNull()
228-
.hasSize(13);
228+
.hasSize(19);
229229
assertThat(context.cpdTokens(componentKey))
230230
.filteredOn(tok -> tok.getValue().startsWith("ОставшийсяТокен"))
231231
.hasSize(1);

src/test/resources/examples/src/test.bsl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
#КонецВставки
1616
КонецПроцедуры
1717

18+
Функция ФункцияКотораяДолжнаНеУпасть()
19+
Возврат "🟡";
20+
КонецФункции
21+
22+
Функция ФункцияКотораяНеУпадет()
23+
Возврат "✅";
24+
КонецФункции
25+
1826
#Область Тест
1927

2028
Проверка = Истина;

0 commit comments

Comments
 (0)