Skip to content

Commit

Permalink
Merge branch 'develop' into feature/osClassModuleType
Browse files Browse the repository at this point in the history
  • Loading branch information
nixel2007 committed Apr 7, 2024
2 parents 040cd86 + 9d64238 commit 137731f
Show file tree
Hide file tree
Showing 114 changed files with 919 additions and 865 deletions.
1 change: 1 addition & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
with:
java-version: 17
distribution: 'temurin'
cache: gradle

- name: Build with Gradle
run: ./gradlew bootJar
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/check-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
with:
java-version: 20
distribution: 'temurin'
cache: gradle

- name: Build bootJar with Gradle
run: ./gradlew check build
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ jobs:
# a pull request then we can checkout the head.
fetch-depth: 2

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: gradle

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
with:
java-version: 17
distribution: 'temurin'
cache: gradle

- name: Build javadoc
run: ./gradlew --no-daemon javadoc
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
with:
java-version: ${{ matrix.java_version }}
distribution: 'temurin'
cache: gradle
- name: Build with Gradle
run: ./gradlew check --stacktrace
- name: Archive test results
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ jobs:
with:
java-version: 17
distribution: 'temurin'
cache: gradle
- name: Check javadoc build
run: ./gradlew javadoc --stacktrace
1 change: 1 addition & 0 deletions .github/workflows/publish-to-sonatype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
with:
java-version: 17
distribution: 'temurin'
cache: gradle
- name: Publish to Sonatype
run: ./gradlew publishMavenPublicationToSonatypeRepository -PsimplifyVersion
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
with:
java-version: 17
distribution: 'temurin'
cache: gradle
- name: SonarCloud Scan on PR
if: github.event.workflow_run.event == 'pull_request'
run: ./gradlew check sonar -Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }} -Dsonar.pullrequest.key=${{ fromJson(steps.get_pr_data.outputs.data).number }} -Dsonar.pullrequest.branch=${{ fromJson(steps.get_pr_data.outputs.data).head.ref }} -Dsonar.pullrequest.base=${{ fromJson(steps.get_pr_data.outputs.data).base.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qodana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: 'Qodana Scan'
uses: JetBrains/[email protected].0
uses: JetBrains/[email protected].2
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
with:
java-version: 20
distribution: 'temurin'
cache: gradle

- name: Build bootJar with Gradle
run: ./gradlew check bootJar
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/update-gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Update Gradle Wrapper

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0"

jobs:
update-gradle-wrapper:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: gradle

- name: Update Gradle Wrapper
uses: gradle-update/update-gradle-wrapper-action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
set-distribution-checksum: false
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ public/
bsl-language-server/
bsl-language-server_*.zip
/.idea/misc.xml
*.log
*.hprof
34 changes: 17 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ plugins {
jacoco
signing
id("org.cadixdev.licenser") version "0.6.1"
id("org.sonarqube") version "4.4.1.3373"
id("io.freefair.lombok") version "8.4"
id("io.freefair.javadoc-links") version "8.4"
id("io.freefair.javadoc-utf-8") version "8.4"
id("io.freefair.aspectj.post-compile-weaving") version "8.4"
id("io.freefair.maven-central.validate-poms") version "8.4"
id("org.sonarqube") version "5.0.0.4638"
id("io.freefair.lombok") version "8.6"
id("io.freefair.javadoc-links") version "8.6"
id("io.freefair.javadoc-utf-8") version "8.6"
id("io.freefair.aspectj.post-compile-weaving") version "8.6"
id("io.freefair.maven-central.validate-poms") version "8.6"
id("me.qoomon.git-versioning") version "6.4.3"
id("com.github.ben-manes.versions") version "0.50.0"
id("org.springframework.boot") version "3.2.1"
id("com.github.ben-manes.versions") version "0.51.0"
id("org.springframework.boot") version "3.2.4"
id("io.spring.dependency-management") version "1.1.4"
id("io.github.1c-syntax.bslls-dev-tools") version "0.7.3"
id("ru.vyarus.pom") version "2.2.2"
id("ru.vyarus.pom") version "3.0.0"
id("com.gorylenko.gradle-git-properties") version "2.4.1"
id("io.codearte.nexus-staging") version "0.30.0"
id("me.champeau.jmh") version "0.7.2"
Expand Down Expand Up @@ -56,7 +56,7 @@ val languageToolVersion = "6.1"

dependencyManagement {
imports {
mavenBom("io.sentry:sentry-bom:7.1.0")
mavenBom("io.sentry:sentry-bom:7.6.0")
}
}

Expand All @@ -74,18 +74,18 @@ dependencies {
api("org.eclipse.lsp4j", "org.eclipse.lsp4j.websocket.jakarta", "0.21.0")

// 1c-syntax
api("io.github.1c-syntax", "bsl-parser", "0.23.3") {
api("io.github.1c-syntax", "bsl-parser", "0.24.0") {
exclude("com.tunnelvisionlabs", "antlr4-annotations")
exclude("com.ibm.icu", "*")
exclude("org.antlr", "ST4")
exclude("org.abego.treelayout", "org.abego.treelayout.core")
exclude("org.antlr", "antlr-runtime")
exclude("org.glassfish", "javax.json")
}
api("com.github.1c-syntax", "utils", "0.5.1")
api("io.github.1c-syntax", "mdclasses", "0.12.0")
api("io.github.1c-syntax", "bsl-common-library", "0.5.0")
api("io.github.1c-syntax", "supportconf", "0.12.1")
api("io.github.1c-syntax", "utils", "0.6.0")
api("io.github.1c-syntax", "mdclasses", "0.13.0-rc.2")
api("io.github.1c-syntax", "bsl-common-library", "0.5.1")
api("io.github.1c-syntax", "supportconf", "0.14.0")
api("io.github.1c-syntax", "bsl-parser-core", "0.1.0")

// JLanguageTool
implementation("org.languagetool", "languagetool-core", languageToolVersion){
Expand Down Expand Up @@ -120,7 +120,7 @@ dependencies {
implementation("com.contrastsecurity", "java-sarif", "2.0")

// Sentry
implementation("io.sentry:sentry-spring-boot-starter")
implementation("io.sentry:sentry-spring-boot-starter-jakarta")
implementation("io.sentry:sentry-logback")

// CONSTRAINTS
Expand Down
12 changes: 10 additions & 2 deletions docs/contributing/DiagnosticStructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@

- Тип диагностики `type` и ее важность `severity`, для каждой диагностики обязательно их определение. Для того, чтобы правильно выбрать тип и важность диагностики, можно обратиться к [статье](DiagnosticTypeAndSeverity.md).
- Время на исправление замечания `minutesToFix` (по умолчанию 0). Данное значение используется при расчете общего техдолга проекта в трудозатрах на исправление всех замечаний (сумма времени на исправление по всем обнаруженным замечаниям). Стоит указывать время, максимально реалистичное, которое разработчик должен потратить на исправление.
- С помощью параметра `extraMinForComplexity` можно динамически увеличивать время на исправление замечания для диагностик, в которых учитывается несколько нарушающих правило мест, например при расчете сложности метода.
- Набор тэгов `tag` диагностики, указывающих группы, к котором она относится. Подробнее о тэга в [статье](DiagnosticTag.md).
- Границы применимости `scope` (по умолчанию `ALL`, т.е. без ограничения). BSL LS поддерживает несколько языков (oscript и bsl) и диагностики могут применяться как к одному конкретному языку, так и ко всем сразу.
- Активность правила по-умолчанию `activatedByDefault` (по умолчанию `Истина`). При разработке экспериментальных, спорных либо не применимых в большинстве проектов, стоит по умолчанию отключать диагностику, активацию выполнит конечный пользователь решения.
- Режим совместимости `compatibilityMode`, по которому фильтруются диагностики при использовании метаданных. По умолчанию `UNDEFINED`.

- Список типов модулей `modules` для возможности ограничить анализируемую диагностикой область
- Признак возможности установить замечания на весь проект `canLocateOnProject`. Используется для диагностик не связанных с модулем исходного кода. На данный момент опция воспринимается только SonarQube, остальные инструменты игнорируют.
Последние два могут быть опущены.

Пример аннотации
Expand All @@ -64,8 +66,14 @@
compatibilityMode = DiagnosticCompatibilityMode.COMPATIBILITY_MODE_8_3_3, // Режим проверки совместимости с 8.3.3
tags = {
DiagnosticTag.STANDARD // Относится к диагностикам нарушения стандарта 1С
}
},
modules = {
ModuleType.CommonModule // Анализируются только общие модули
},
canLocateOnProject = false, // Замечание будет размещено только в привязке к модулю
extraMinForComplexity = 1 // За каждую дополнительную позицию замечания (`DiagnosticRelatedInformation`) будет добавлено по одной минуте
)

```

Класс должен реализовывать интерфейс `BSLDiagnostic`. Если диагностика основывается на AST дереве, то класс реализации должен быть унаследован от одного из классов ниже, реализующих `BSLDiagnostic`:
Expand Down
2 changes: 1 addition & 1 deletion docs/diagnostics/CognitiveComplexity.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
И НЕ Символы.Экспортный() Тогда // +1, логическая операция, вложенность не учитывается
Если МожноПереопределить(Символ) Тогда // +3, вложенное условие, вложенность 2
Переопредялемость = ПроверитьПереопределяемость(Символ, ТипКласса);
Переопределяемость = ПроверитьПереопределяемость(Символ, ТипКласса);
Если Переопределяемость = Неопределено Тогда // +4, вложенное условие, вложенность 3
Если НЕ НеизвестностьНайдена Тогда // +5, вложенное условие, вложенность 4
НеизвестностьНайдена = Истина;
Expand Down
2 changes: 1 addition & 1 deletion docs/diagnostics/DenyIncompleteValues.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Запрет незаполненных значений (DenyIncompleteValues)
# Запрет незаполненных значений у измерений регистров (DenyIncompleteValues)

<!-- Блоки выше заполняются автоматически, не трогать -->
## Описание диагностики
Expand Down
2 changes: 1 addition & 1 deletion docs/diagnostics/GlobalContextMethodCollision8312.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
ПобитовыйСдвигВлево|BitwiseShiftLeft
ПобитовыйСдвигВправо|BitwiseShiftRight

Необходимо существующие функции конфигурации прикладного решения необходимо либо переименовать, либо удалить, заменив обращение к ним на методы глобального контекста.
Необходимо существующие функции конфигурации прикладного решения переименовать или удалить, заменив обращение к ним на методы глобального контекста.

## Примеры
<!-- В данном разделе приводятся примеры, на которые диагностика срабатывает, а также можно привести пример, как можно исправить ситуацию -->
Expand Down
5 changes: 3 additions & 2 deletions docs/en/diagnostics/DeprecatedCurrentDate.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Using of the deprecated method "CurrentDate" (DeprecatedCurrentDate)

<!-- Blocks above are filled in automatically, do not touch -->
## Diagnostic description
<!-- Блоки выше заполняются автоматически, не трогать -->
## Description

The configurations must be designed to work in conditions where the time zone on the server computer does not match the real time zone of the infobase users. For example, employees of a company from Vladivostok work with a server located in Moscow, and all operations in the system must be performed in local time (Vladivostok).

Such a work scenario is often in demand in client-server infobases and in applied solutions in the service model (SaaS).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Transferring parameters between client and server (TransferringParametersBetweenClientAndServer)
# Transferring parameters between the client and the server (TransferringParametersBetweenClientAndServer)

<!-- Blocks above are included automatically, do not touch -->
## Diagnostic description
<!-- Diagnostic description is filled in manually. It is necessary to describe the meaning an understandable language -->
<!-- Блоки выше заполняются автоматически, не трогать -->
## Description

When transferring control from the client to the server (and vice versa), copies of the parameters are always transferred.

Expand Down
2 changes: 1 addition & 1 deletion docs/en/diagnostics/UsingFindElementByString.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Using FindByName, FindByCode and FindByNumber (UsingFindElementByString)
# Using FindByName, FindByCode and FindByNumber (UsingFindElementByString)

<!-- Блоки выше заполняются автоматически, не трогать -->
## Description
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 17 additions & 12 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
Loading

0 comments on commit 137731f

Please sign in to comment.