Skip to content

Commit

Permalink
Merge commit '009f67b48bde505a62494ab406ca7c26460da915'
Browse files Browse the repository at this point in the history
# Conflicts:
#	docs/en/index.md
#	docs/index.md
  • Loading branch information
theshadowco committed Jun 5, 2024
2 parents 510ac7e + 009f67b commit 0114fc6
Show file tree
Hide file tree
Showing 44 changed files with 471 additions and 283 deletions.
6 changes: 4 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
Expand All @@ -11,6 +9,10 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "daily"
groups:
freefair:
patterns:
- "io.freefair.*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ jobs:
java_version: ['17', '19']
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v3.12.0
uses: actions/setup-java@v4.2.1
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
- name: Build with Gradle
run: ./gradlew check --stacktrace
- name: Archive test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: junit_report_${{ matrix.os }}_${{ matrix.java_version }}
path: build/reports/tests/test
8 changes: 3 additions & 5 deletions .github/workflows/night_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: nigth_build
- name: Set up JDK
uses: actions/setup-java@v3.12.0
uses: actions/setup-java@v4.2.1
with:
java-version: 17
distribution: 'adopt'
Expand All @@ -28,9 +28,7 @@ jobs:
- name: Save current date
run: echo "PLUGIN_CURRENT_DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Deploy build
uses: WebFreak001/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: WebFreak001/[email protected]
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
4 changes: 2 additions & 2 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.event.repository.full_name
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: ''
- run: |
git fetch --prune --unshallow
- name: Set up JDK 17
uses: actions/setup-java@v3.12.0
uses: actions/setup-java@v4.2.1
with:
java-version: 17
distribution: 'adopt'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ jobs:

steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3.12.0
uses: actions/setup-java@v4.2.1
with:
java-version: 17
distribution: 'adopt'
- name: Build with Gradle
run: ./gradlew build
- name: Upload jar to release
uses: AButler/upload-release-assets@v2.0
uses: AButler/upload-release-assets@v3.0
with:
files: './build/libs/*.jar'
repo-token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ gen/
/.idea/compiler.xml
/.idea/inspectionProfiles/Project_Default.xml
/.idea/misc.xml
/.idea/material_theme_project_new.xml
45 changes: 14 additions & 31 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 "4.3.0.3225"
id("org.sonarqube") version "5.0.0.4638"
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.47.0"
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.1.0"
id("io.freefair.lombok") version "8.6"
}

group = "io.github.1c-syntax"
Expand All @@ -20,7 +20,7 @@ repositories {
mavenLocal()
mavenCentral()
maven {
url = URI("https://s01.oss.sonatype.org/content/repositories/snapshots")
url = URI("https://s01.oss.sonatype.org/content/repositories/snapshots")
}
maven {
url = URI("https://jitpack.io")
Expand All @@ -32,45 +32,28 @@ val sonarQubeVersion = "9.9.0.65466"
dependencies {
implementation("org.sonarsource.api.plugin", "sonar-plugin-api", "9.14.0.375")

// в jitpack лежат в группе com.github.1c-syntax, в централе - io.github.1c-syntax
implementation("io.github.1c-syntax", "bsl-language-server", "0.22.0") {
exclude("com.github.1c-syntax", "utils")
implementation("io.github.1c-syntax", "bsl-language-server", "0.23.0") {
exclude("com.contrastsecurity", "java-sarif")
exclude("io.sentry", "sentry-logback")
exclude("org.springframework.boot", "spring-boot-starter-websocket")
}
implementation("com.github.1c-syntax", "utils", "0.5.1")

implementation("org.apache.commons:commons-lang3:3.13.0")
implementation("com.fasterxml.jackson.core:jackson-databind:2.15.2")

// https://mvnrepository.com/artifact/org.sonarsource.analyzer-commons/sonar-analyzer-commons
implementation("org.sonarsource.analyzer-commons:sonar-analyzer-commons:2.5.0.1358")
implementation("org.sonarsource.analyzer-commons", "sonar-analyzer-commons", "2.5.0.1358")

// MD to HTML converter of BSL LS rule descriptions
implementation("org.commonmark", "commonmark", "0.21.0")
implementation("org.commonmark", "commonmark-ext-gfm-tables", "0.21.0")
implementation("org.commonmark", "commonmark-ext-autolink", "0.21.0")
implementation("org.commonmark", "commonmark-ext-heading-anchor", "0.21.0")

implementation("me.tongfei:progressbar:0.9.5")

compileOnly("com.google.code.findbugs:jsr305:3.0.2")

testImplementation("org.junit.jupiter", "junit-jupiter-api", "5.8.0")
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", "5.8.0")

testImplementation("org.assertj:assertj-core:3.24.2")
testImplementation("org.mockito:mockito-core:5.4.0")

testImplementation("org.assertj", "assertj-core", "3.25.1")
testImplementation("org.mockito", "mockito-core", "5.8.0")
testImplementation("org.sonarsource.sonarqube", "sonar-testing-harness", sonarQubeVersion)
testImplementation("org.sonarsource.sonarqube", "sonar-core", sonarQubeVersion)
testImplementation("org.reflections", "reflections", "0.9.12")

// CONSTRAINTS

implementation("com.google.guava:guava") {
version {
strictly("32.0.1-jre")
}
}
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", "5.8.0")
}

java {
Expand Down Expand Up @@ -136,6 +119,7 @@ tasks.jar {
attributes["Plugin-Class"] = "com.github._1c_syntax.bsl.sonar.BSLPlugin"
attributes["Plugin-Name"] = "1C (BSL) Community Plugin"
attributes["Plugin-Version"] = "${project.version}"
attributes["Plugin-RequiredForLanguages"] = "bsl"

attributes["Plugin-License"] = "GNU LGPL v3"

Expand All @@ -151,7 +135,6 @@ tasks.jar {
attributes["Plugin-OrganizationUrl"] = "https://github.com/1c-syntax"
}


enabled = false
dependsOn(tasks.shadowJar)
}
Expand Down
8 changes: 4 additions & 4 deletions docs/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@

SonarQube Version | Plugin Version | JAVA version
------------------|----------------|------------------
9.9+ | 1.13.0+ | 17
8.9+ | 1.11.0...1.12.0| 11
7.9+ | 0.7.0....1.10.0| 11
7.4 - 7.8 | 0.1.0....0.6.0 | 8
9.9+ | 1.13.0+ | 17
8.9+ | 1.11.0...1.12.0| 11
7.9+ | 0.7.0...1.10.0 | 11
7.4 - 7.8 | 0.1.0...0.6.0 | 8

## Run analysis

Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
-----------------|----------------|------------------
9.9+ | 1.13.0+ | 17
8.9+ | 1.11.0...1.12.0| 11
7.9+ | 0.7.0....1.10.0| 11
7.4 - 7.8 | 0.1.0....0.6.0 | 8
7.9+ | 0.7.0...1.10.0 | 11
7.4 - 7.8 | 0.1.0...0.6.0 | 8

## Запуск анализа

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of SonarQube 1C (BSL) Community Plugin.
*
* Copyright (c) 2018-2023
* Copyright (c) 2018-2024
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]>
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down Expand Up @@ -30,7 +30,6 @@
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors;
import java.util.stream.Stream;


Expand All @@ -54,89 +53,70 @@ public final class BSLCommunityProperties {
public static final String BSL_FILE_EXTENSIONS_DEFAULT_VALUE = ".bsl,.os";

public static final String BSL_CATEGORY = "1C (BSL)";
private static final String EXTERNAL_ANALYZERS_CATEGORY = "External Analyzers";
private static final String BSL_SUBCATEGORY = "1C (BSL) Community";

private static final String BSL_SUBCATEGORY = "1C (BSL) Community";

private BSLCommunityProperties() {
// only statics
}

public static List<PropertyDefinition> getProperties() {
return Arrays.asList(
PropertyDefinition.builder(LANG_SERVER_DIAGNOSTIC_LANGUAGE_KEY)
.name("BSL Language server rule names and messages language")
.description(
"Defines the language of the rules names (on APP level) and language of rules message (on PROJECT level)"
)
.defaultValue(LANG_SERVER_DIAGNOSTIC_LANGUAGE_DEFAULT_VALUE)
PropertyDefinitionUtils.newPropertyBuilderBSL(0,
LANG_SERVER_DIAGNOSTIC_LANGUAGE_KEY,
"diagnosticLanguage",
LANG_SERVER_DIAGNOSTIC_LANGUAGE_DEFAULT_VALUE)
.type(PropertyType.SINGLE_SELECT_LIST)
.options(Language.RU.getLanguageCode(), Language.EN.getLanguageCode())
.category(BSL_CATEGORY)
.onQualifiers(Qualifiers.APP, Qualifiers.PROJECT)
.index(0)
.build(),
PropertyDefinition.builder(LANG_SERVER_ENABLED_KEY)
.name("BSL Language Server enabled")
.description("Run internal BSL Language Server Diagnostic Provider")
.defaultValue(LANG_SERVER_ENABLED_DEFAULT_VALUE.toString())
PropertyDefinitionUtils.newPropertyBuilderBSL(1,
LANG_SERVER_ENABLED_KEY,
"enabled",
LANG_SERVER_ENABLED_DEFAULT_VALUE.toString())
.type(PropertyType.BOOLEAN)
.category(BSL_CATEGORY)
.onQualifiers(Qualifiers.PROJECT)
.index(1)
.build(),
PropertyDefinition.builder(LANG_SERVER_COMPUTE_DIAGNOSTICS_SKIP_SUPPORT_KEY)
.name("BSL Language Server - Skip computing diagnostics on modules with parent configurations")
.description("Skip computing diagnostics according to module's support mode " +
"(if there is a parent configuration).")
.category(BSL_CATEGORY)
.defaultValue(LANG_SERVER_COMPUTE_DIAGNOSTICS_SKIP_SUPPORT_DEFAULT_VALUE)
PropertyDefinitionUtils.newPropertyBuilderBSL(2,
LANG_SERVER_COMPUTE_DIAGNOSTICS_SKIP_SUPPORT_KEY,
"skipSupport",
LANG_SERVER_COMPUTE_DIAGNOSTICS_SKIP_SUPPORT_DEFAULT_VALUE)
.type(PropertyType.SINGLE_SELECT_LIST)
.options(Stream.of(SkipSupport.values())
.map(value -> value.name().toLowerCase(Locale.ENGLISH).replace("_", " "))
.collect(Collectors.toList())
.toList()
)
.onQualifiers(Qualifiers.PROJECT)
.index(2)
.build(),
PropertyDefinition.builder(LANG_SERVER_OVERRIDE_CONFIGURATION_KEY)
.name("BSL Language Server - Use configuration file")
.description("Override SonarQube settings with BSL LS configuration file.")
.category(BSL_CATEGORY)
.defaultValue(LANG_SERVER_OVERRIDE_CONFIGURATION_DEFAULT_VALUE.toString())
PropertyDefinitionUtils.newPropertyBuilderBSL(3,
LANG_SERVER_OVERRIDE_CONFIGURATION_KEY,
"overrideConfiguration",
LANG_SERVER_OVERRIDE_CONFIGURATION_DEFAULT_VALUE.toString())
.type(PropertyType.BOOLEAN)
.onQualifiers(Qualifiers.PROJECT)
.index(3)
.build(),
PropertyDefinition.builder(LANG_SERVER_CONFIGURATION_PATH_KEY)
.name("BSL Language Server - Configuration file")
.description("Path to BSL LS configuration file.")
.category(BSL_CATEGORY)
.defaultValue(LANG_SERVER_CONFIGURATION_PATH_DEFAULT_VALUE)
PropertyDefinitionUtils.newPropertyBuilderBSL(4,
LANG_SERVER_CONFIGURATION_PATH_KEY,
"enabled.configurationPath",
LANG_SERVER_CONFIGURATION_PATH_DEFAULT_VALUE)
.type(PropertyType.STRING)
.onQualifiers(Qualifiers.PROJECT)
.index(4)
.build(),
PropertyDefinition.builder(BSL_FILE_EXTENSIONS_KEY)
.name("BSL File suffixes")
.description("List of file suffixes that will be scanned.")
.category(BSL_CATEGORY)
.defaultValue(BSL_FILE_EXTENSIONS_DEFAULT_VALUE)
PropertyDefinitionUtils.newPropertyBuilderBSL(5,
BSL_FILE_EXTENSIONS_KEY,
"file.suffixes",
BSL_FILE_EXTENSIONS_DEFAULT_VALUE)
.onQualifiers(Qualifiers.PROJECT)
.multiValues(true)
.index(5)
.build(),
PropertyDefinition.builder(LANG_SERVER_REPORT_PATH_KEY)
.name("BSL Language Server Report Files")
.description("Paths (absolute or relative) to xml files with BSL Language Server diagnostics")
.defaultValue("")
.category(EXTERNAL_ANALYZERS_CATEGORY)
PropertyDefinitionUtils.newPropertyBuilderExternal(0,
LANG_SERVER_REPORT_PATH_KEY,
"reportPaths",
"")
.subCategory(BSL_SUBCATEGORY)
.onQualifiers(Qualifiers.PROJECT)
.multiValues(true)
.index(0)
.build()
);
}

}
Loading

0 comments on commit 0114fc6

Please sign in to comment.