From 1745fbd0a37176b9b5f6e14d701cdfdbb237502f Mon Sep 17 00:00:00 2001 From: Dmitriy Marmyshev Date: Mon, 25 Jul 2022 20:27:27 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=BA=D0=BB=D1=8E=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BE?= =?UTF-8?q?=D0=BA=20=D0=B4=D0=BB=D1=8F=20=D0=B7=D0=B0=D0=B8=D0=BC=D1=81?= =?UTF-8?q?=D1=82=D0=B2=D0=BE=D0=B2=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20=D0=BE?= =?UTF-8?q?=D0=B1=D1=8A=D0=B5=D0=BA=D1=82=D0=BE=D0=B2=20=D0=B2=20=D1=80?= =?UTF-8?q?=D0=B0=D1=81=D1=88=D0=B8=D1=80=D0=B5=D0=BD=D0=B8=D0=B8=20#1076?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + .../md/check/CommonModuleNameCachedCheck.java | 1 + .../md/check/CommonModuleNameClient.java | 1 + .../CommonModuleNameClientCachedCheck.java | 1 + .../check/CommonModuleNameClientServer.java | 1 + .../md/check/CommonModuleNameGlobal.java | 1 + ...CommonModuleNameServerCallCachedCheck.java | 1 + .../CommonModuleNameServerCallCheck.java | 1 + .../md/check/CommonModuleType.java | 1 + .../md/check/DbObjectAnyRefTypeCheck.java | 1 + .../md/check/DbObjectRefNonRefTypesCheck.java | 1 + .../check/MdListObjectPresentationCheck.java | 3 +- .../md/check/MdObjectNameLength.java | 1 + .../check/MdScheduledJobDescriptionCheck.java | 1 + .../check/MdScheduledJobPeriodicityCheck.java | 1 + .../MdStandardAttributeSynonymEmpty.java | 1 + ...ipAdoptedInExtensionMdObjectExtension.java | 41 +++++++++++++++++++ .../check/SubsystemSynonymTooLongCheck.java | 4 ++ 18 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/SkipAdoptedInExtensionMdObjectExtension.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fc8b131..2f443cd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,7 @@ - Некорректное сообщение об ошибке в строгих типах. Не существует типа "Таблица" #1055 - Ложное сообщение об ошибке о неиспользовании составных типов для стандартных объектов метаданных #1069 - Проверка: right-... не находит ошибку для роли с включением по умолчанию #815 +- Отключение проверок для заимствованных объектов в расширении #1076 ## 0.2.0 diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameCachedCheck.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameCachedCheck.java index b6568bf6..f8cd974a 100644 --- a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameCachedCheck.java +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameCachedCheck.java @@ -76,6 +76,7 @@ public final class CommonModuleNameCachedCheck .issueType(IssueType.WARNING) .extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)) .extension(new TopObjectFilterExtension()) + .extension(new SkipAdoptedInExtensionMdObjectExtension()) .topObject(COMMON_MODULE) .checkTop() .features(MD_OBJECT__NAME, COMMON_MODULE__RETURN_VALUES_REUSE); diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameClient.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameClient.java index 9f447365..8de72b92 100644 --- a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameClient.java +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameClient.java @@ -74,6 +74,7 @@ public final class CommonModuleNameClient .extension(new TopObjectFilterExtension()) .extension(new MdObjectNameWithoutSuffix(NAME_SUFFIX_DEFAULT)) .extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)) + .extension(new SkipAdoptedInExtensionMdObjectExtension()) .topObject(COMMON_MODULE) .checkTop() .features(MD_OBJECT__NAME, diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameClientCachedCheck.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameClientCachedCheck.java index 8be17a1f..7a6d443a 100644 --- a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameClientCachedCheck.java +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameClientCachedCheck.java @@ -76,6 +76,7 @@ public final class CommonModuleNameClientCachedCheck .issueType(IssueType.WARNING) .extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)) .extension(new TopObjectFilterExtension()) + .extension(new SkipAdoptedInExtensionMdObjectExtension()) .topObject(COMMON_MODULE) .checkTop() .features(MD_OBJECT__NAME, COMMON_MODULE__RETURN_VALUES_REUSE); diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameClientServer.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameClientServer.java index 101844e1..0222ad9c 100644 --- a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameClientServer.java +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameClientServer.java @@ -75,6 +75,7 @@ public final class CommonModuleNameClientServer .extension(new TopObjectFilterExtension()) .extension(new MdObjectNameWithoutSuffix(NAME_SUFFIX_DEFAULT)) .extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)) + .extension(new SkipAdoptedInExtensionMdObjectExtension()) .topObject(COMMON_MODULE) .checkTop() .features(MD_OBJECT__NAME, diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameGlobal.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameGlobal.java index 36a750e5..665bdd3f 100644 --- a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameGlobal.java +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameGlobal.java @@ -74,6 +74,7 @@ public final class CommonModuleNameGlobal .extension(new TopObjectFilterExtension()) .extension(new MdObjectNameWithoutSuffix(NAME_SUFFIX_DEFAULT)) .extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)) + .extension(new SkipAdoptedInExtensionMdObjectExtension()) .topObject(COMMON_MODULE) .checkTop() .features(MD_OBJECT__NAME, diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameServerCallCachedCheck.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameServerCallCachedCheck.java index f6aa4220..c77b5b4d 100644 --- a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameServerCallCachedCheck.java +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameServerCallCachedCheck.java @@ -76,6 +76,7 @@ public final class CommonModuleNameServerCallCachedCheck .issueType(IssueType.WARNING) .extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)) .extension(new TopObjectFilterExtension()) + .extension(new SkipAdoptedInExtensionMdObjectExtension()) .topObject(COMMON_MODULE) .checkTop() .features(MD_OBJECT__NAME, COMMON_MODULE__RETURN_VALUES_REUSE); diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameServerCallCheck.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameServerCallCheck.java index 17214d5a..3b2b4c77 100644 --- a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameServerCallCheck.java +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleNameServerCallCheck.java @@ -75,6 +75,7 @@ public final class CommonModuleNameServerCallCheck .issueType(IssueType.WARNING) .extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)) .extension(new TopObjectFilterExtension()) + .extension(new SkipAdoptedInExtensionMdObjectExtension()) .topObject(COMMON_MODULE) .checkTop() .features(MD_OBJECT__NAME, COMMON_MODULE__SERVER_CALL); diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleType.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleType.java index 969167f3..1e2cb504 100644 --- a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleType.java +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/CommonModuleType.java @@ -85,6 +85,7 @@ public final class CommonModuleType .issueType(IssueType.CODE_STYLE) .extension(new TopObjectFilterExtension()) .extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)) + .extension(new SkipAdoptedInExtensionMdObjectExtension()) .topObject(COMMON_MODULE) .checkTop() .features(CommonModuleTypes.SERVER.getFeatureValues(false).keySet().toArray(new EStructuralFeature[0])); diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/DbObjectAnyRefTypeCheck.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/DbObjectAnyRefTypeCheck.java index 61e634e9..efb985e3 100644 --- a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/DbObjectAnyRefTypeCheck.java +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/DbObjectAnyRefTypeCheck.java @@ -76,6 +76,7 @@ public final class DbObjectAnyRefTypeCheck .severity(IssueSeverity.MAJOR) .issueType(IssueType.PERFORMANCE) .extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)) + .extension(new SkipAdoptedInExtensionMdObjectExtension()) .topObject(BASIC_DB_OBJECT) .containment(TYPE_DESCRIPTION) .features(TYPE_DESCRIPTION__TYPES); diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/DbObjectRefNonRefTypesCheck.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/DbObjectRefNonRefTypesCheck.java index 3fa826b7..3de41aad 100644 --- a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/DbObjectRefNonRefTypesCheck.java +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/DbObjectRefNonRefTypesCheck.java @@ -86,6 +86,7 @@ public final class DbObjectRefNonRefTypesCheck .severity(IssueSeverity.MAJOR) .issueType(IssueType.PERFORMANCE) .extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)) + .extension(new SkipAdoptedInExtensionMdObjectExtension()) .topObject(BASIC_DB_OBJECT) .containment(TYPE_DESCRIPTION) .features(TYPE_DESCRIPTION__TYPES); diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdListObjectPresentationCheck.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdListObjectPresentationCheck.java index 40c5b235..771a7aed 100644 --- a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdListObjectPresentationCheck.java +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdListObjectPresentationCheck.java @@ -84,7 +84,8 @@ public class MdListObjectPresentationCheck .severity(IssueSeverity.MINOR) .extension(new TopObjectFilterExtension()) .issueType(IssueType.UI_STYLE) - .extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)); + .extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)) + .extension(new SkipAdoptedInExtensionMdObjectExtension()); builder.topObject(BASIC_DB_OBJECT) .checkTop() diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdObjectNameLength.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdObjectNameLength.java index 0a73afd3..e0305730 100644 --- a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdObjectNameLength.java +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdObjectNameLength.java @@ -60,6 +60,7 @@ public final class MdObjectNameLength .extension(new TopObjectFilterExtension()) .issueType(IssueType.PORTABILITY) .extension(new CommonSenseCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)) + .extension(new SkipAdoptedInExtensionMdObjectExtension()) .topObject(MD_OBJECT) .checkTop() .features(MD_OBJECT__NAME) diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdScheduledJobDescriptionCheck.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdScheduledJobDescriptionCheck.java index b52698da..3ce0e986 100644 --- a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdScheduledJobDescriptionCheck.java +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdScheduledJobDescriptionCheck.java @@ -56,6 +56,7 @@ public class MdScheduledJobDescriptionCheck .severity(IssueSeverity.MINOR) .issueType(IssueType.UI_STYLE) .extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)) + .extension(new SkipAdoptedInExtensionMdObjectExtension()) .topObject(SCHEDULED_JOB) .checkTop() .features(SCHEDULED_JOB__DESCRIPTION, SCHEDULED_JOB__PREDEFINED); diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdScheduledJobPeriodicityCheck.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdScheduledJobPeriodicityCheck.java index 4e8b0c8f..808b79ca 100644 --- a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdScheduledJobPeriodicityCheck.java +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdScheduledJobPeriodicityCheck.java @@ -124,6 +124,7 @@ public final class MdScheduledJobPeriodicityCheck .severity(IssueSeverity.MAJOR) .issueType(IssueType.PERFORMANCE) .extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)) + .extension(new SkipAdoptedInExtensionMdObjectExtension()) .topObject(SCHEDULE) .checkTop() .containment(DAILY_SCHEDULE) diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdStandardAttributeSynonymEmpty.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdStandardAttributeSynonymEmpty.java index bcf4636f..19598e33 100644 --- a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdStandardAttributeSynonymEmpty.java +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/MdStandardAttributeSynonymEmpty.java @@ -95,6 +95,7 @@ public class MdStandardAttributeSynonymEmpty .issueType(IssueType.UI_STYLE) .extension(new TopObjectFilterExtension()) .extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)) + .extension(new SkipAdoptedInExtensionMdObjectExtension()) .extension(new CatalogChangeExtension()); builder.topObject(CATALOG).containment(STANDARD_ATTRIBUTE).features(STANDARD_ATTRIBUTE__SYNONYM); diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/SkipAdoptedInExtensionMdObjectExtension.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/SkipAdoptedInExtensionMdObjectExtension.java new file mode 100644 index 00000000..2b43035f --- /dev/null +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/SkipAdoptedInExtensionMdObjectExtension.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (C) 2022, 1C-Soft LLC and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * 1C-Soft LLC - initial API and implementation + *******************************************************************************/ +package com.e1c.v8codestyle.md.check; + +import com._1c.g5.v8.dt.metadata.mdclass.MdObject; +import com._1c.g5.v8.dt.metadata.mdclass.ObjectBelonging; +import com.e1c.g5.v8.dt.check.components.IBasicCheckExtension; +import com.e1c.g5.v8.dt.check.ext.ITopObjectFilter; + +/** + * The extension skips TOP MD object that adopted in Extension Configuration. + * + * @author Dmitriy Marmyshev + */ +public class SkipAdoptedInExtensionMdObjectExtension + implements IBasicCheckExtension +{ + @Override + public ITopObjectFilter contributeTopObjectFilter() + { + return (object, parameters) -> { + + if (object instanceof MdObject) + { + return ((MdObject)object).getObjectBelonging() != ObjectBelonging.ADOPTED; + } + return true; + }; + } + +} diff --git a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/SubsystemSynonymTooLongCheck.java b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/SubsystemSynonymTooLongCheck.java index 1199d68a..02f40a0c 100644 --- a/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/SubsystemSynonymTooLongCheck.java +++ b/bundles/com.e1c.v8codestyle.md/src/com/e1c/v8codestyle/md/check/SubsystemSynonymTooLongCheck.java @@ -33,6 +33,8 @@ import com.e1c.g5.v8.dt.check.components.BasicCheck; import com.e1c.g5.v8.dt.check.components.TopObjectFilterExtension; 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.md.CorePlugin; /** * Check top subsystem synonym length that should be less then 35 by default or value @@ -70,6 +72,8 @@ public class SubsystemSynonymTooLongCheck .complexity(CheckComplexity.NORMAL) .severity(IssueSeverity.MINOR) .extension(new TopObjectFilterExtension()) + .extension(new StandardCheckExtension(getCheckId(), CorePlugin.PLUGIN_ID)) + .extension(new SkipAdoptedInExtensionMdObjectExtension()) .issueType(IssueType.UI_STYLE) .topObject(SUBSYSTEM) .checkTop()