1
0
mirror of https://github.com/1C-Company/v8-code-style.git synced 2025-01-06 00:33:23 +02:00

#1 Перенос проверок документирующего комментария

This commit is contained in:
Dmitriy Marmyshev 2022-02-07 18:00:45 +03:00
parent ba2289702c
commit c7cf065d21
12 changed files with 37 additions and 1 deletions

View File

@ -29,6 +29,8 @@ import com.e1c.g5.v8.dt.check.CheckComplexity;
import com.e1c.g5.v8.dt.check.ICheckParameters;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.bsl.BslPlugin;
/**
* Check type definition that collection type (like array, map etc.) has type of contain item.
@ -69,6 +71,7 @@ public class CollectionTypeDefinitionCheck
.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.MINOR)
.issueType(IssueType.CODE_STYLE)
.extension(new StandardCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID))
.delegate(TypeDefinition.class);
builder.parameter(PARAMETER_COLLECTION_TYPES, String.class, DEFAULT_COLLECTION_TYPES,
Messages.CollectionTypeDefinitionCheck_Collection_types);

View File

@ -33,11 +33,13 @@ import com.e1c.g5.v8.dt.check.CheckComplexity;
import com.e1c.g5.v8.dt.check.ICheckParameters;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.bsl.BslPlugin;
import com.google.inject.Inject;
/**
* Validator of export function that has return section in documentation comment if function has anything
* in documentation comment. If function has link to some other function this means documentation inherites and
* in documentation comment. If function has link to some other function this means documentation inherits and
* validator checks documentation comment of linked function. Otherwise this function should have return section.
*
* @author Dmitriy Marmyshev
@ -86,6 +88,7 @@ public class ExportFunctionReturnSectionCheck
.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.MAJOR)
.issueType(IssueType.CODE_STYLE)
.extension(new StandardCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID))
.delegate(BslDocumentationComment.class);
}

View File

@ -25,6 +25,8 @@ import com.e1c.g5.v8.dt.check.CheckComplexity;
import com.e1c.g5.v8.dt.check.ICheckParameters;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
import com.e1c.v8codestyle.check.CommonSenseCheckExtension;
import com.e1c.v8codestyle.internal.bsl.BslPlugin;
/**
* Validates that field name in documentation comment is valid name (not starts with number or does not contains any
@ -53,6 +55,7 @@ public class FieldDefinitionNameCheck
.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.MINOR)
.issueType(IssueType.CODE_STYLE)
.extension(new CommonSenseCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID))
.delegate(FieldDefinition.class);
}

View File

@ -23,6 +23,8 @@ import com.e1c.g5.v8.dt.check.CheckComplexity;
import com.e1c.g5.v8.dt.check.ICheckParameters;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.bsl.BslPlugin;
/**
* Checks that field definition in documentation comment has type definition section.
@ -48,6 +50,7 @@ public class FieldDefinitionTypeCheck
.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.MINOR)
.issueType(IssueType.CODE_STYLE)
.extension(new StandardCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID))
.delegate(FieldDefinition.class);
}

View File

@ -35,6 +35,8 @@ import com.e1c.g5.v8.dt.check.CheckComplexity;
import com.e1c.g5.v8.dt.check.ICheckParameters;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
import com.e1c.v8codestyle.check.CommonSenseCheckExtension;
import com.e1c.v8codestyle.internal.bsl.BslPlugin;
/**
* Check field that it has definition of complex type and also reference to constructor function instead of just only
@ -97,6 +99,7 @@ public class FieldDefinitionTypeWithLinkRefCheck
.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.MINOR)
.issueType(IssueType.CODE_STYLE)
.extension(new CommonSenseCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID))
.delegate(FieldDefinition.class);
builder.parameter(PARAMETER_COLLECTION_TYPES, String.class, DEFAULT_COLLECTION_TYPES,
Messages.CollectionTypeDefinitionCheck_Collection_types);

View File

@ -37,6 +37,8 @@ import com.e1c.g5.v8.dt.check.CheckComplexity;
import com.e1c.g5.v8.dt.check.ICheckParameters;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.bsl.BslPlugin;
import com.google.inject.Inject;
/**
@ -89,6 +91,7 @@ public class FunctionReturnSectionCheck
.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.MINOR)
.issueType(IssueType.CODE_STYLE)
.extension(new StandardCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID))
.delegate(ReturnSection.class);
}

View File

@ -27,6 +27,8 @@ import com.e1c.g5.v8.dt.check.CheckComplexity;
import com.e1c.g5.v8.dt.check.ICheckParameters;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
import com.e1c.v8codestyle.check.CommonSenseCheckExtension;
import com.e1c.v8codestyle.internal.bsl.BslPlugin;
/**
* Validates any description in documentation comment that is multi-line and may contains File definition like:
@ -64,6 +66,7 @@ public class MultilineDescriptionFieldSuggestionCheck
.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.TRIVIAL)
.issueType(IssueType.CODE_STYLE)
.extension(new CommonSenseCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID))
.delegate(Description.class);
}

View File

@ -30,6 +30,8 @@ import com.e1c.g5.v8.dt.check.CheckComplexity;
import com.e1c.g5.v8.dt.check.ICheckParameters;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
import com.e1c.v8codestyle.check.CommonSenseCheckExtension;
import com.e1c.v8codestyle.internal.bsl.BslPlugin;
/**
* Validates method description in documentation comment that is multi-line and may contains parameter definition like:
@ -61,6 +63,7 @@ public class MultilineDescriptionParameterSuggestionCheck
.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.TRIVIAL)
.issueType(IssueType.CODE_STYLE)
.extension(new CommonSenseCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID))
.delegate(Description.class);
}

View File

@ -27,6 +27,8 @@ import com.e1c.g5.v8.dt.check.CheckComplexity;
import com.e1c.g5.v8.dt.check.ICheckParameters;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.bsl.BslPlugin;
/**
* Validates that each of parameters specified in documenting comments.
@ -57,6 +59,7 @@ public class ParametersSectionCheck
.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.MINOR)
.issueType(IssueType.CODE_STYLE)
.extension(new StandardCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID))
.delegate(ParametersSection.class);
builder.parameter(PARAMETER_CHECK_ONLY_EXPORT, Boolean.class, Boolean.FALSE.toString(),
Messages.ParametersSectionCheck_Check_only_export_method_parameter_section);

View File

@ -23,6 +23,8 @@ import com.e1c.g5.v8.dt.check.CheckComplexity;
import com.e1c.g5.v8.dt.check.ICheckParameters;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
import com.e1c.v8codestyle.check.CommonSenseCheckExtension;
import com.e1c.v8codestyle.internal.bsl.BslPlugin;
/**
* The check validate {@link ReturnSection} of documentation comment if the method is {@link Procedure} which should not
@ -50,6 +52,7 @@ public class ProcedureReturnSectionCheck
.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.MINOR)
.issueType(IssueType.CODE_STYLE)
.extension(new CommonSenseCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID))
.delegate(ReturnSection.class);
}

View File

@ -26,6 +26,8 @@ import com.e1c.g5.v8.dt.check.CheckComplexity;
import com.e1c.g5.v8.dt.check.ICheckParameters;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
import com.e1c.v8codestyle.check.CommonSenseCheckExtension;
import com.e1c.v8codestyle.internal.bsl.BslPlugin;
/**
* Validates {@link LinkPart} of documentation comment that it referenced to an existing object.
@ -77,6 +79,7 @@ public class RefLinkPartCheck
.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.MINOR)
.issueType(IssueType.CODE_STYLE)
.extension(new CommonSenseCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID))
.delegate(LinkPart.class);
builder.parameter(PARAMETER_ALLOW_SEE_IN_DESCRIPTION, Boolean.class, Boolean.TRUE.toString(),
Messages.RefLinkPartCheck_Allow_See_in_description);

View File

@ -32,6 +32,8 @@ import com.e1c.g5.v8.dt.check.CheckComplexity;
import com.e1c.g5.v8.dt.check.ICheckParameters;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
import com.e1c.v8codestyle.check.CommonSenseCheckExtension;
import com.e1c.v8codestyle.internal.bsl.BslPlugin;
import com.google.inject.Inject;
/**
@ -72,6 +74,7 @@ public class TypeDefinitionCheck
.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.MINOR)
.issueType(IssueType.CODE_STYLE)
.extension(new CommonSenseCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID))
.delegate(TypeDefinition.class);
}