Skip to content

Commit

Permalink
Merge pull request #3223 from 1c-syntax/feature/issOnPrj
Browse files Browse the repository at this point in the history
Признак диагностики для разрешения размещения ее замечаний на уровне проекта
  • Loading branch information
theshadowco authored Jan 12, 2024
2 parents 08b00ab + 7c66312 commit abfacae
Show file tree
Hide file tree
Showing 14 changed files with 113 additions and 38 deletions.
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
tags = {
DiagnosticTag.BADPRACTICE
},
scope = DiagnosticScope.BSL
scope = DiagnosticScope.BSL,
canLocateOnProject = true
)
public class DenyIncompleteValuesDiagnostic extends AbstractMetadataDiagnostic {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
ModuleType.ValueManagerModule,
ModuleType.SessionModule
},
scope = DiagnosticScope.BSL
scope = DiagnosticScope.BSL,
canLocateOnProject = true
)
@RequiredArgsConstructor
public class ForbiddenMetadataNameDiagnostic extends AbstractMetadataDiagnostic {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
scope = DiagnosticScope.BSL,
tags = {
DiagnosticTag.STANDARD
}
},
canLocateOnProject = true
)
public class MetadataObjectNameLengthDiagnostic extends AbstractMetadataDiagnostic {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
ModuleType.ObjectModule,
ModuleType.SessionModule
},
scope = DiagnosticScope.BSL

scope = DiagnosticScope.BSL,
canLocateOnProject = true
)
public class SameMetadataObjectAndChildNamesDiagnostic extends AbstractMetadataDiagnostic {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
tags = {
DiagnosticTag.ERROR
},
scope = DiagnosticScope.BSL
scope = DiagnosticScope.BSL,
canLocateOnProject = true
)
public class ScheduledJobHandlerDiagnostic extends AbstractMetadataDiagnostic {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ public Optional<DiagnosticParameterInfo> getParameter(String parameterName) {
return diagnosticParameters.stream().filter(param -> param.getName().equals(parameterName)).findAny();
}

public boolean canLocateOnProject() {
return diagnosticMetadata.canLocateOnProject();
}

public Map<String, Object> getDefaultConfiguration() {
return diagnosticParameters.stream()
.collect(Collectors.toMap(DiagnosticParameterInfo::getName, DiagnosticParameterInfo::getDefaultValue));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,48 @@
@Primary
@Scope("prototype")
public @interface DiagnosticMetadata {
/**
* Тип диагностики
*/
DiagnosticType type() default DiagnosticType.ERROR;

/**
* Серьезность замечания
*/
DiagnosticSeverity severity() default DiagnosticSeverity.MINOR;

/**
* Область применения диагностики по диалекту языка (bsl или oscript)
*/
DiagnosticScope scope() default DiagnosticScope.ALL;

/**
* Типы модулей, анализируемых диагностикой
*/
ModuleType[] modules() default {};

/**
* Время, необходимое для исправления замечания
*/
int minutesToFix() default 0;

/**
* Признак включения диагностики в профиле по умолчанию
*/
boolean activatedByDefault() default true;

/**
* Версия платформы 1С:Предприятие, с которой диагностика применяется
*/
DiagnosticCompatibilityMode compatibilityMode() default DiagnosticCompatibilityMode.UNDEFINED;

/**
* Перечень меток (тегов) диагностики
*/
DiagnosticTag[] tags() default {};

/**
* Замечания диагностики могут быть прикреплены на уровень анализируемого проекта (в частности в SonarQube)
*/
boolean canLocateOnProject() default false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -704,12 +704,26 @@
},
"FileSystemAccess": {
"description": "FileSystemAccess",
"default": true,
"default": false,
"type": [
"boolean",
"object"
],
"title": "FileSystemAccess",
"properties": {
"globalMethods": {
"description": "Global methods pattern (regex)",
"default": "\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u0412\u0424\u0430\u0439\u043b|ValueToFile|\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0424\u0430\u0439\u043b|FileCopy|\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0424\u0430\u0439\u043b\u044b|MergeFiles|\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c\u0424\u0430\u0439\u043b|MoveFile|\u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c\u0424\u0430\u0439\u043b|SplitFile|\u0421\u043e\u0437\u0434\u0430\u0442\u044c\u041a\u0430\u0442\u0430\u043b\u043e\u0433|CreateDirectory|\u0423\u0434\u0430\u043b\u0438\u0442\u044c\u0424\u0430\u0439\u043b\u044b|DeleteFiles|\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b|BinDir|\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445\u0424\u0430\u0439\u043b\u043e\u0432|TempFilesDir|\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432|DocumentsDir|\u0420\u0430\u0431\u043e\u0447\u0438\u0439\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0414\u0430\u043d\u043d\u044b\u0445\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f|UserDataWorkDir|\u041d\u0430\u0447\u0430\u0442\u044c\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u0420\u0430\u0431\u043e\u0442\u044b\u0421\u0424\u0430\u0439\u043b\u0430\u043c\u0438|BeginAttachingFileSystemExtension|\u041d\u0430\u0447\u0430\u0442\u044c\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u0420\u0430\u0431\u043e\u0442\u044b\u0421\u0424\u0430\u0439\u043b\u0430\u043c\u0438|BeginInstallFileSystemExtension|\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u0420\u0430\u0431\u043e\u0442\u044b\u0421\u0424\u0430\u0439\u043b\u0430\u043c\u0438|InstallFileSystemExtension|\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u0420\u0430\u0431\u043e\u0442\u044b\u0421\u0424\u0430\u0439\u043b\u0430\u043c\u0438\u0410\u0441\u0438\u043d\u0445|InstallFileSystemExtensionAsync|\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u0420\u0430\u0431\u043e\u0442\u044b\u0421\u0424\u0430\u0439\u043b\u0430\u043c\u0438\u0410\u0441\u0438\u043d\u0445|AttachFileSystemExtensionAsync|\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445\u0424\u0430\u0439\u043b\u043e\u0432\u0410\u0441\u0438\u043d\u0445|TempFilesDirAsync|\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432\u0410\u0441\u0438\u043d\u0445|DocumentsDirAsync|\u041d\u0430\u0447\u0430\u0442\u044c\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445\u0424\u0430\u0439\u043b\u043e\u0432|BeginGettingTempFilesDir|\u041d\u0430\u0447\u0430\u0442\u044c\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432|BeginGettingDocumentsDir|\u041d\u0430\u0447\u0430\u0442\u044c\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u0420\u0430\u0431\u043e\u0447\u0435\u0433\u043e\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u0414\u0430\u043d\u043d\u044b\u0445\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f|BeginGettingUserDataWorkDir|\u0420\u0430\u0431\u043e\u0447\u0438\u0439\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0414\u0430\u043d\u043d\u044b\u0445\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0410\u0441\u0438\u043d\u0445|UserDataWorkDirAsync|\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0424\u0430\u0439\u043b\u0410\u0441\u0438\u043d\u0445|CopyFileAsync|\u041d\u0430\u0439\u0442\u0438\u0424\u0430\u0439\u043b\u044b\u0410\u0441\u0438\u043d\u0445|FindFilesAsync|\u041d\u0430\u0447\u0430\u0442\u044c\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u0424\u0430\u0439\u043b\u0430|BeginCopyingFile|\u041d\u0430\u0447\u0430\u0442\u044c\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u0424\u0430\u0439\u043b\u0430|BeginMovingFile|\u041d\u0430\u0447\u0430\u0442\u044c\u041f\u043e\u0438\u0441\u043a\u0424\u0430\u0439\u043b\u043e\u0432|BeginFindingFiles|\u041d\u0430\u0447\u0430\u0442\u044c\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u0414\u0432\u043e\u0438\u0447\u043d\u044b\u0445\u0414\u0430\u043d\u043d\u044b\u0445\u0418\u0437\u0424\u0430\u0439\u043b\u0430|BeginCreateBinaryDataFromFile|\u041d\u0430\u0447\u0430\u0442\u044c\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0430|BeginCreatingDirectory|\u041d\u0430\u0447\u0430\u0442\u044c\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435\u0424\u0430\u0439\u043b\u043e\u0432|BeginDeletingFiles|\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c\u0424\u0430\u0439\u043b\u0410\u0441\u0438\u043d\u0445|MoveFileAsync|\u0421\u043e\u0437\u0434\u0430\u0442\u044c\u0414\u0432\u043e\u0438\u0447\u043d\u044b\u0435\u0414\u0430\u043d\u043d\u044b\u0435\u0418\u0437\u0424\u0430\u0439\u043b\u0430\u0410\u0441\u0438\u043d\u0445|CreateBinaryDataFromFileAsync|\u0421\u043e\u0437\u0434\u0430\u0442\u044c\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0410\u0441\u0438\u043d\u0445|CreateDirectoryAsync|\u0423\u0434\u0430\u043b\u0438\u0442\u044c\u0424\u0430\u0439\u043b\u044b\u0410\u0441\u0438\u043d\u0445|DeleteFilesAsync",
"type": "string",
"title": "Global methods pattern (regex)"
},
"newExpression": {
"description": "Class names pattern (regex)",
"default": "File|\u0424\u0430\u0439\u043b|xBase|HTMLWriter|\u0417\u0430\u043f\u0438\u0441\u044cHTML|HTMLReader|\u0427\u0442\u0435\u043d\u0438\u0435HTML|FastInfosetReader|\u0427\u0442\u0435\u043d\u0438\u0435FastInfoset|FastInfosetWriter|\u0417\u0430\u043f\u0438\u0441\u044cFastInfoset|XSLTransform|\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435XSL|ZipFileWriter|\u0417\u0430\u043f\u0438\u0441\u044cZip\u0424\u0430\u0439\u043b\u0430|ZipFileReader|\u0427\u0442\u0435\u043d\u0438\u0435Zip\u0424\u0430\u0439\u043b\u0430|TextReader|\u0427\u0442\u0435\u043d\u0438\u0435\u0422\u0435\u043a\u0441\u0442\u0430|TextWriter|\u0417\u0430\u043f\u0438\u0441\u044c\u0422\u0435\u043a\u0441\u0442\u0430|TextExtraction|\u0418\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435\u0422\u0435\u043a\u0441\u0442\u0430|BinaryData|\u0414\u0432\u043e\u0438\u0447\u043d\u044b\u0435\u0414\u0430\u043d\u043d\u044b\u0435|FileStream|\u0424\u0430\u0439\u043b\u043e\u0432\u044b\u0439\u041f\u043e\u0442\u043e\u043a|FileStreamsManager|\u041c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0424\u0430\u0439\u043b\u043e\u0432\u044b\u0445\u041f\u043e\u0442\u043e\u043a\u043e\u0432|DataWriter|\u0417\u0430\u043f\u0438\u0441\u044c\u0414\u0430\u043d\u043d\u044b\u0445|DataReader|\u0427\u0442\u0435\u043d\u0438\u0435\u0414\u0430\u043d\u043d\u044b\u0445",
"type": "string",
"title": "Class names pattern (regex)"
}
},
"$id": "#/definitions/FileSystemAccess"
},
"ForbiddenMetadataName": {
Expand Down Expand Up @@ -2041,13 +2055,13 @@
"$id": "#/definitions/UsingExternalCodeTools"
},
"UsingFindElementByString": {
"description": "Using FindByName, FindByCode and FindByNumber",
"description": "Using FindByName, FindByCode and FindByNumber",
"default": true,
"type": [
"boolean",
"object"
],
"title": "Using FindByName, FindByCode and FindByNumber",
"title": "Using FindByName, FindByCode and FindByNumber",
"$id": "#/definitions/UsingFindElementByString"
},
"UsingGoto": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,18 @@
"ExportVariables": {
"$ref": "parameters-schema.json#/definitions/ExportVariables"
},
"ExternalAppStarting": {
"$ref": "parameters-schema.json#/definitions/ExternalAppStarting"
},
"ExtraCommas": {
"$ref": "parameters-schema.json#/definitions/ExtraCommas"
},
"FieldsFromJoinsWithoutIsNull": {
"$ref": "parameters-schema.json#/definitions/FieldsFromJoinsWithoutIsNull"
},
"FileSystemAccess": {
"$ref": "parameters-schema.json#/definitions/FileSystemAccess"
},
"ForbiddenMetadataName": {
"$ref": "parameters-schema.json#/definitions/ForbiddenMetadataName"
},
Expand Down Expand Up @@ -350,6 +356,9 @@
"ParseError": {
"$ref": "parameters-schema.json#/definitions/ParseError"
},
"PrivilegedModuleMethodCall": {
"$ref": "parameters-schema.json#/definitions/PrivilegedModuleMethodCall"
},
"ProcedureReturnsValue": {
"$ref": "parameters-schema.json#/definitions/ProcedureReturnsValue"
},
Expand Down
Loading

0 comments on commit abfacae

Please sign in to comment.