Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
DoublesunRUS committed Apr 15, 2020
2 parents 149ba50 + bfe313b commit 19bb313
Show file tree
Hide file tree
Showing 16 changed files with 103 additions and 16 deletions.
8 changes: 8 additions & 0 deletions .bsl-language-server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://1c-syntax.github.io/bsl-language-server/configuration/schema.json",
"diagnostics": {
"FunctionNameStartsWithGet": true,
"TooManyReturns": true,
"UsingSynchronousCalls": true
}
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ git:
depth: false

env:
- PLUGIN_VERSION="0.13.0"
- PLUGIN_VERSION="0.14.0"

script:
- mvn clean test verify sonar:sonar -f build/pom.xml -s build/settings.xml -Dsonar.projectKey=$SONAR_PROJECT_KEY
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Перем CodeBlockBeforeSub;

#Область КвикФиксы

&НаКлиенте
Expand All @@ -18,3 +20,15 @@
КонецПроцедуры

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

#Область СлужебныеПроцедурыИФункции

CodeBlockBeforeSub = Ложь;

Процедура CodeBlockBeforeSub()

CodeBlockBeforeSub = Истина;

КонецПроцедуры

#КонецОбласти
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@

КонецПроцедуры

Процедура DeprecatedTypeManagedForm(А) Экспорт

А = Тип("УправляемаяФорма");

КонецПроцедуры

Процедура EmptyStatement(А) Экспорт

А = 1; ;
Expand Down Expand Up @@ -274,6 +280,12 @@

КонецПроцедуры

Функция ПолучитьFunctionNameStartsWithGet() Экспорт

Возврат Ложь;

КонецФункции

Процедура MagicNumber(А) Экспорт

Если А = 365 Тогда
Expand Down Expand Up @@ -521,6 +533,26 @@

КонецПроцедуры

Функция NestedFunctionInParameters1(А) Экспорт

Возврат А;

КонецФункции

Функция NestedFunctionInParameters2(А) Экспорт

Возврат А;

КонецФункции

Процедура NestedFunctionInParameters3(А) Экспорт

А.Вставить("А",
NestedFunctionInParameters1(
NestedFunctionInParameters2(Истина)));

КонецПроцедуры

Процедура NestedStatements(А) Экспорт

Если Истина Тогда
Expand Down Expand Up @@ -636,6 +668,12 @@

КонецПроцедуры

Процедура TempFilesDir(А) Экспорт

А = КаталогВременныхФайлов();

КонецПроцедуры

&НаСервере
Процедура TimeoutsInExternalResources(А, Б) Экспорт

Expand Down Expand Up @@ -706,6 +744,15 @@

КонецПроцедуры

&НаСервере
Процедура UsingExternalCodeTools() Экспорт

ВнешниеОтчеты.Подключить("А");
ВнешниеОбработки.Создать("А");
РасширенияКонфигурации.Создать();

КонецПроцедуры

&НаСервере
Процедура UsingFindElementByString(А) Экспорт

Expand Down Expand Up @@ -752,6 +799,15 @@

КонецПроцедуры

&НаСервере
Процедура WrongUseOfRollbackTransactionMethod() Экспорт

НачатьТранзакцию();

ОтменитьТранзакцию();

КонецПроцедуры

Процедура YoLetterUsage(А, Ё) Экспорт

А = 1;
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# dt.bslls.validator [![Build Status](https://travis-ci.org/DoublesunRUS/ru.capralow.dt.bslls.validator.svg)](https://travis-ci.org/DoublesunRUS/ru.capralow.dt.bslls.validator) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=DoublesunRUS_ru.capralow.dt.bslls.validator&metric=alert_status)](https://sonarcloud.io/dashboard?id=DoublesunRUS_ru.capralow.dt.bslls.validator) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=DoublesunRUS_ru.capralow.dt.bslls.validator&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=DoublesunRUS_ru.capralow.dt.bslls.validator) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=DoublesunRUS_ru.capralow.dt.bslls.validator&metric=coverage)](https://sonarcloud.io/dashboard?id=DoublesunRUS_ru.capralow.dt.bslls.validator)
# dt.bslls.validator [![Build Status](https://travis-ci.com/DoublesunRUS/ru.capralow.dt.bslls.validator.svg)](https://travis-ci.com/DoublesunRUS/ru.capralow.dt.bslls.validator) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=DoublesunRUS_ru.capralow.dt.bslls.validator&metric=alert_status)](https://sonarcloud.io/dashboard?id=DoublesunRUS_ru.capralow.dt.bslls.validator) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=DoublesunRUS_ru.capralow.dt.bslls.validator&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=DoublesunRUS_ru.capralow.dt.bslls.validator) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=DoublesunRUS_ru.capralow.dt.bslls.validator&metric=coverage)](https://sonarcloud.io/dashboard?id=DoublesunRUS_ru.capralow.dt.bslls.validator)


## BSL проверки для [1C:Enterprise Development Tools](http://v8.1c.ru/overview/IDE/) 1.16

Минимальная версия EDT: 1.16.0

Текущий релиз в ветке [master: 0.13.0](https://github.com/DoublesunRUS/ru.capralow.dt.bslls.validator/tree/master).<br>
Текущий релиз в ветке [master: 0.14.0](https://github.com/DoublesunRUS/ru.capralow.dt.bslls.validator/tree/master).<br>
Разработка ведется в ветке [dev](https://github.com/DoublesunRUS/ru.capralow.dt.bslls.validator/tree/dev).<br>

В данном репозитории хранятся только исходники.<br>
Expand All @@ -15,7 +15,7 @@

### BSL Language Server
Плагин использует [BSL Language Server](https://github.com/1c-syntax/bsl-language-server) в соответствии с [лицензией](https://github.com/1c-syntax/bsl-language-server/blob/develop/COPYING.md).<br>
В состав плагина включена версия 0.13.0<br>
В состав плагина включена версия 0.14.1<br>
Список диагностик можно посмотреть на [официальном сайте](https://1c-syntax.github.io/bsl-language-server/diagnostics) сервера.

### Возможности
Expand All @@ -32,6 +32,7 @@
* UsingServiceTag

Диагностики есть в EDT:
* CodeBlockBeforeSub
* FunctionShouldHaveReturn
* ProcedureReturnsValue
* UnknownPreprocessorSymbol
Expand Down
4 changes: 2 additions & 2 deletions build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ru.capralow.dt.bslls.validator</groupId>
<artifactId>build</artifactId>
<version>0.13.0-SNAPSHOT</version>
<version>0.14.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>BSL проверки для EDT</name>
Expand Down Expand Up @@ -56,7 +56,7 @@
<artifact>
<groupId>ru.capralow.dt.bslls.validator.target</groupId>
<artifactId>default</artifactId>
<version>0.13.0-SNAPSHOT</version>
<version>0.14.0-SNAPSHOT</version>
</artifact>
</target>
<environments>
Expand Down
2 changes: 1 addition & 1 deletion repository/category.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature url="features/ru.capralow.dt.bslls.validator_0.13.0.qualifier.jar" id="ru.capralow.dt.bslls.validator" version="0.13.0.qualifier">
<feature url="features/ru.capralow.dt.bslls.validator_0.14.0.qualifier.jar" id="ru.capralow.dt.bslls.validator" version="0.14.0.qualifier">
<category name="ru.capralow.dt.plugin.category.public"/>
</feature>
<category-def name="ru.capralow.dt.plugin.category.public" label="Плагины для EDT"/>
Expand Down
2 changes: 1 addition & 1 deletion repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>ru.capralow.dt.bslls.validator</groupId>
<artifactId>build</artifactId>
<version>0.13.0-SNAPSHOT</version>
<version>0.14.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions ru.capralow.dt.bslls.validator.plugin.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="ru.capralow.dt.bslls.validator"
label="%featureName"
version="0.13.0.qualifier"
version="0.14.0.qualifier"
provider-name="%providerName">

<description>
Expand All @@ -16,7 +16,7 @@
<license url="">
BSD 3-Clause License

Copyright (c) 2019, Александр Капралов
Copyright (c) 2019-2020, Alexander Kapralov
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion ru.capralow.dt.bslls.validator.plugin.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>ru.capralow.dt.bslls.validator</groupId>
<artifactId>build</artifactId>
<version>0.13.0-SNAPSHOT</version>
<version>0.14.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<artifactId>ru.capralow.dt.bslls.validator</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: ru.capralow.dt.bslls.validator.plugin.ui;singleton:=true
Bundle-Version: 0.13.0.qualifier
Bundle-Version: 0.14.0.qualifier
Bundle-Activator: ru.capralow.dt.bslls.validator.plugin.internal.ui.BslValidatorPlugin
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime,
Expand Down
Binary file modified ru.capralow.dt.bslls.validator.plugin.ui/bsl-language-server.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

pluginName = BSL LS \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u0434\u043B\u044F EDT

providerName = \u041A\u0430\u043F\u0440\u0430\u043B\u043E\u0432 \u0410\u043B\u0435\u043A\u0441\u0430\u043D\u0434\u0440 \u0410\u043B\u0435\u043A\u0441\u0430\u043D\u0434\u0440\u0432\u0438\u0447
providerName = \u041A\u0430\u043F\u0440\u0430\u043B\u043E\u0432 \u0410\u043B\u0435\u043A\u0441\u0430\u043D\u0434\u0440 \u0410\u043B\u0435\u043A\u0441\u0430\u043D\u0434\u0440\u043E\u0432\u0438\u0447
2 changes: 1 addition & 1 deletion ru.capralow.dt.bslls.validator.plugin.ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>ru.capralow.dt.bslls.validator</groupId>
<artifactId>build</artifactId>
<version>0.13.0-SNAPSHOT</version>
<version>0.14.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<packaging>eclipse-plugin</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import com.github._1c_syntax.bsl.languageserver.context.DocumentContext;
import com.github._1c_syntax.bsl.languageserver.context.ServerContext;
import com.github._1c_syntax.bsl.languageserver.diagnostics.BSLDiagnostic;
import com.github._1c_syntax.bsl.languageserver.diagnostics.CodeBlockBeforeSubDiagnostic;
import com.github._1c_syntax.bsl.languageserver.diagnostics.DiagnosticSupplier;
import com.github._1c_syntax.bsl.languageserver.diagnostics.FunctionShouldHaveReturnDiagnostic;
import com.github._1c_syntax.bsl.languageserver.diagnostics.LineLengthDiagnostic;
Expand Down Expand Up @@ -114,6 +115,12 @@ private LanguageServerConfiguration initializeLsConfiguration(IProject project)
if (!configurationFile.exists())
configurationFile = new File(getConfigurationFilePath() + File.separator + BSL_LS_FILENAME);

if (configurationFile.exists()) {
String initializationMessage = BSL_LS_PREFIX.concat("Конфигурационный файл: ") //$NON-NLS-1$
.concat(configurationFile.getPath());
BslValidatorPlugin.log(BslValidatorPlugin.createInfoStatus(initializationMessage));
}

LanguageServerConfiguration lsConfiguration = LanguageServerConfiguration.create(configurationFile);

Map<String, Either<Boolean, Map<String, Object>>> diagnostics = lsConfiguration.getDiagnostics();
Expand All @@ -128,6 +135,7 @@ private LanguageServerConfiguration initializeLsConfiguration(IProject project)
duplicateDiagnostics.add(UsingServiceTagDiagnostic.class);

// Диагностики есть в EDT
duplicateDiagnostics.add(CodeBlockBeforeSubDiagnostic.class);
duplicateDiagnostics.add(FunctionShouldHaveReturnDiagnostic.class);
duplicateDiagnostics.add(ProcedureReturnsValueDiagnostic.class);
duplicateDiagnostics.add(UnknownPreprocessorSymbolDiagnostic.class);
Expand All @@ -136,7 +144,7 @@ private LanguageServerConfiguration initializeLsConfiguration(IProject project)
// В настройках можно принудительно включить выключенные диагностики
for (Class<? extends BSLDiagnostic> diagnostic : duplicateDiagnostics) {
DiagnosticInfo diagnosticInfo = new DiagnosticInfo(diagnostic, lsConfiguration.getDiagnosticLanguage());
String diagnocticCode = diagnosticInfo.getCode();
String diagnocticCode = diagnosticInfo.getCode().getStringValue();
if (!diagnostics.containsKey(diagnocticCode))
diagnostics.put(diagnocticCode, falseForLeft);
}
Expand Down
2 changes: 1 addition & 1 deletion target/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>ru.capralow.dt.bslls.validator</groupId>
<artifactId>build</artifactId>
<version>0.13.0-SNAPSHOT</version>
<version>0.14.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>

Expand Down

0 comments on commit 19bb313

Please sign in to comment.