Skip to content

Commit

Permalink
Merge pull request #351 from 1c-syntax/develop
Browse files Browse the repository at this point in the history
Sync
  • Loading branch information
nixel2007 authored Dec 29, 2024
2 parents 5f50a77 + f6d523c commit 2c04994
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 11 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@v4
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v4.2.1
uses: actions/setup-java@v4.5.0
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
Expand Down
4 changes: 2 additions & 2 deletions .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@v4.2.1
uses: actions/setup-java@v4.5.0
with:
java-version: 17
distribution: 'adopt'
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Save current date
run: echo "PLUGIN_CURRENT_DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Deploy build
uses: WebFreak001/deploy-nightly@v3.1.0
uses: WebFreak001/deploy-nightly@v3.2.0
with:
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
release_id: 51033599 # same as above (id can just be taken out the upload_url, it's used to find old releases)
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 17
uses: actions/setup-java@v4.2.1
uses: actions/setup-java@v4.5.0
with:
java-version: 17
distribution: 'adopt'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4.2.1
uses: actions/setup-java@v4.5.0
with:
java-version: 17
distribution: 'adopt'
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ plugins {
jacoco
java
`maven-publish`
id("org.sonarqube") version "5.1.0.4882"
id("org.sonarqube") version "6.0.1.5171"
id("org.cadixdev.licenser") version "0.6.1"
id("com.github.johnrengelman.shadow") version ("7.0.0")
id("com.github.ben-manes.versions") version "0.51.0"
id("com.github.gradle-git-version-calculator") version "1.1.0"
id("io.freefair.lombok") version "8.6"
id("io.freefair.lombok") version "8.11"
}

group = "io.github.1c-syntax"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ private void saveCpd(InputFile inputFile, DocumentContext documentContext) {
line,
charPositionInLine,
line,
charPositionInLine + tokenText.length(),
charPositionInLine + (int) tokenText.codePoints().count(),
tokenText
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public void highlightToken(
line,
charPositionInLine,
line,
charPositionInLine + tokenText.length()
charPositionInLine + (int) tokenText.codePoints().count()
);

var data = new HighlightingData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void testComplexity() {
// todo надо как-то нормально ключ компонента определить
var componentKey = "moduleKey:" + FILE_NAME;
assertThat(context.measures(componentKey)).isNotEmpty();
assertThat(context.measure(componentKey, CoreMetrics.COMPLEXITY).value()).isEqualTo(3);
assertThat(context.measure(componentKey, CoreMetrics.COMPLEXITY).value()).isEqualTo(5);
assertThat(context.measure(componentKey, CoreMetrics.COGNITIVE_COMPLEXITY).value()).isEqualTo(1);

}
Expand All @@ -225,7 +225,7 @@ void testCPD() {
var componentKey = "moduleKey:" + FILE_NAME;
assertThat(context.cpdTokens(componentKey))
.isNotNull()
.hasSize(13);
.hasSize(19);
assertThat(context.cpdTokens(componentKey))
.filteredOn(tok -> tok.getValue().startsWith("ОставшийсяТокен"))
.hasSize(1);
Expand Down
8 changes: 8 additions & 0 deletions src/test/resources/examples/src/test.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
#КонецВставки
КонецПроцедуры

Функция ФункцияКотораяДолжнаНеУпасть()
Возврат "🟡";
КонецФункции

Функция ФункцияКотораяНеУпадет()
Возврат "✅";
КонецФункции

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

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

0 comments on commit 2c04994

Please sign in to comment.