Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
nixel2007 committed May 23, 2019
2 parents 2b385c6 + e220881 commit c0b2b04
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/en/diagnostics/CanonicalSpellingKeywords.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ RU | EN
НаКлиентеНаСервереБезКонтекста | AtClientAtServerNoContext
НаКлиентеНаСервере | AtClientAtServer

Источник: [Standart: Modules texts(RU)](https://its.1c.ru/db/v8std#content:456:hdoc)
Reference: [Standart: Modules texts (RU)](https://its.1c.ru/db/v8std#content:456:hdoc)
7 changes: 7 additions & 0 deletions docs/en/diagnostics/DeprecatedMessage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Restriction on using of the obsolete method "Message"

To display messages to the user in all cases, you should use the MessageUser object, even when the message is not “bound” to some form control. The Message method should not be used.

*When used the Standard Subsystems Library it is recommended use procedure MessageUser from common module CommonPurposeClientServer, which use object UserMessage.*

Refference: [Standard: Limit use of the obsolete method Message](https://its.1c.ru/db/v8std#content:418:hdoc)
51 changes: 51 additions & 0 deletions docs/en/diagnostics/NumberOfValuesInStructureConstructor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Limit on the number of property values passed to the structure constructor

When creating an object of type Structure it is not recommended to pass more than 3 property values to the constructor. Instead, it is recommended to use the Insert method or assign values to properties explicitly.

#### Example

Incorrect:

```bsl
ПараметрыФормыКомпоновки = Новый Структура(
"НеПомещатьНастройкиВСхемуКомпоновкиДанных,
|НеРедактироватьСхемуКомпоновкиДанных,
|НеНастраиватьУсловноеОформление,
|НеНастраиватьВыбор,
|НеНастраиватьПорядок,
|АдресСхемыКомпоновкиДанных,
|АдресНастроекКомпоновкиДанных,
|УникальныйИдентификатор,
|Заголовок",
Истина,
Истина,
Истина,
Истина,
Истина,
ТекущиеДанные.АдресСхемыКомпоновкиДанных,
?(АдресНастроекСхемыКомпоновкиДанных <> Неопределено,
АдресНастроекСхемыКомпоновкиДанных,
ТекущиеДанные.АдресНастроекСхемыКомпоновкиДанных),
УникальныйИдентификатор,
ЗаголовокФормыНастройкиСхемыКомпоновкиДанных));
```

Correct:

```bsl
ПараметрыФормыКомпоновки = Новый Структура;
ПараметрыФормыКомпоновки.Вставить("НеПомещатьНастройкиВСхемуКомпоновкиДанных", Истина);
ПараметрыФормыКомпоновки.Вставить("НеРедактироватьСхемуКомпоновкиДанных", Истина);
ПараметрыФормыКомпоновки.Вставить("НеРедактироватьСхемуКомпоновкиДанных", Истина);
ПараметрыФормыКомпоновки.Вставить("НеНастраиватьВыбор", Истина);
ПараметрыФормыКомпоновки.Вставить("НеНастраиватьПорядок", Истина);
ПараметрыФормыКомпоновки.Вставить("АдресСхемыКомпоновкиДанных", ТекущиеДанные.АдресСхемыКомпоновкиДанных);
ПараметрыФормыКомпоновки.Вставить("АдресНастроекКомпоновкиДанных", ?(АдресНастроекСхемыКомпоновкиДанных <> Неопределено,
АдресНастроекСхемыКомпоновкиДанных,
ТекущиеДанные.АдресНастроекСхемыКомпоновкиДанных));
ПараметрыФормыКомпоновки.Вставить("УникальныйИдентификатор ", УникальныйИдентификатор);
ПараметрыФормыКомпоновки.Вставить("Заголовок", ЗаголовокФормыНастройкиСхемыКомпоновкиДанных);
```

Reference: [Стандарт: Использование объектов типа Структура](https://its.1c.ru/db/v8std#content:693:hdoc)
29 changes: 29 additions & 0 deletions docs/en/diagnostics/UsingFindElementByString.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Using FindByName and FindByCode

- **Scope:** BSL (BSL only)
- **Type:** CODE_SMELL
- **Criticality:** MAJOR

The diagnostic finds use of methods FindByName and FindByCode with hardcoded values.

Example:

```bsl
Должность = Справочники.Должности.НайтиПоНаименованию("Ведущий бухгалтер");
```

or

```bsl
Должность = Справочники.Должности.НайтиПоКоду("00-0000001");
```

Acceptable use:

```bsl
Справочники.Валюты.НайтиПоКоду(ТекущиеДанные.КодВалютыЦифровой);
```

```bsl
Справочники.КлассификаторБанков.НайтиПоКоду(СведенияОБанке.БИК);
```
12 changes: 12 additions & 0 deletions docs/en/diagnostics/UsingServiceTag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Using service tags

The diagnostic finds use of service tags in comments. Tags list:

- TODO
- FIXME

Tags list can be extended via options.

## Parameters

- `serviceTags` - `String` - keyword for search. Bu default : "todo|fixme".
15 changes: 11 additions & 4 deletions docs/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

[Language Server Protocol](https://microsoft.github.io/language-server-protocol/) implementation for 1C (BSL) - 1C:Enterprise 8 and [OneScript](http://oscript.io) languages.

[English version](en/index.md)

- <a href="#capabilities">Capabilities</a>
- <a href="#cli">Run from command line</a>
- <a href="#analyze">Run in analyzer mode</a>
Expand Down Expand Up @@ -51,8 +53,8 @@ By default diagnostics texts are displayed in Russian. To switch the diagnostics

## Run in analyzer mode

To run in analyzer mode use parameter `--analyze` or `-a`. To set source code folder for analysis use parameter
`--srcDir` or `-s` followed by the path (relative or absolute) to the source code folder.
To run in analyzer mode use parameter `--analyze` (short `-a`). To set source code folder for analysis use parameter
`--srcDir` (short `-s`) followed by the path (relative or absolute) to the source code folder.

To generate an analysis report you need to specify one or more reporters. To specify reporter use parameter `--reporter` or `-r`, followed by reporter key. You may specify several reporters. The list of reporters see in section **Reporters**.

Expand All @@ -65,7 +67,7 @@ java -jar bsl-language-server.jar --analyze --srcDir ./src/cf --reporter json
> When run analysis for large code base it is recommended to set parameter {code0}-Xmx{/code0} to set maximum limit of memory being allocated to java process. The size of allocated memory depends on the size of code base for analysis.
```sh
java -Xmx4g -jar bsl-language-server.jar ...остальные параметры
java -Xmx4g -jar bsl-language-server.jar ... other parameters
```

<a id="configuration"></a>
Expand All @@ -90,7 +92,7 @@ Configuration file example, setting:

```json
{
"diagnosticLanguage": "ru",
"diagnosticLanguage": "en",
"diagnostics": {
"LineLength": {
"maxLineLength": 140
Expand Down Expand Up @@ -123,6 +125,7 @@ Used for code analysis to meet coding standards and search for possible errors.
### Implemented diagnostics

- [CanonicalSpellingKeywords - Canonical Keywords Spelling ](diagnostics/CanonicalSpellingKeywords.md)
- [DeprecatedMessage - Restriction on using of the obsolete method "Message"](diagnostics/DeprecatedMessage.md)
- [EmptyCodeBlock - Empty Code Block](diagnostics/EmptyCodeBlock.md)
- [EmptyStatement - Empty Statement](diagnostics/EmptyStatement.md)
- [FunctionShouldHaveReturn - Function Should Have Return](diagnostics/FunctionShouldHaveReturn.md)
Expand All @@ -131,14 +134,18 @@ Used for code analysis to meet coding standards and search for possible errors.
- [IfElseIfEndsWithElse - If...ElseIf Ends With Else](diagnostics/IfElseIfEndsWithElse.md)
- [LineLength - Line Length](diagnostics/LineLength.md)
- [MethodSize - Method Size](diagnostics/MethodSize.md)
- [NestedConstructorsInStructureDeclaration - Nested constructors with parameters in structure declaration](diagnostics/NestedConstructorsInStructureDeclaration.md)
- [NestedTernaryOperator - Nested Ternary Operator](diagnostics/NestedTernaryOperator.md)
- [NumberOfOptionalParams - Number Of Optional Parameters in Method](diagnostics/NumberOfOptionalParams.md)
- [NumberOfParams - Number Of Parameters in Method](diagnostics/NumberOfParams.md)
- [NumberOfValuesInStructureConstructor - Restriction on the number of property values ​​passed to the structure constructor](diagnostics/NumberOfValuesInStructureConstructor.md)
- [OneStatementPerLine - One Statement Per Line](diagnostics/OneStatementPerLine.md)
- [OrderOfParams - Order Of Parameters in Method](diagnostics/OrderOfParams.md)
- [ProcedureReturnsValue - Procedure should not return Value](diagnostics/ProcedureReturnsValue.md)
- [SemicolonPresence - Statement should end with Semicolon](diagnostics/SemicolonPresence.md)
- [SelfAssign - Variable is Assigned to itself](diagnostics/SelfAssign.md)
- [UnknownPreprocessorSymbol - Unknown Preprocessor Symbol](diagnostics/UnknownPreprocessorSymbol.md)
- [UsingCancelParameter - Using Cancel Parameter](diagnostics/UsingCancelParameter.md)
- [UsingFindElementByString - Using the methods "FindByDescription" and "FindByCode"](diagnostics/UsingFindElementByString.md)
- [UsingServiceTag - Using service tags](diagnostics/UsingServiceTag.md)
- [YoLetterUsageDiagnostic - Yo Letter Usage in code](diagnostics/YoLetterUsage.md)

0 comments on commit c0b2b04

Please sign in to comment.