1
0
mirror of https://github.com/1C-Company/v8-code-style.git synced 2025-04-17 22:16:18 +02:00

Исправление проверки - режим блокировки не тестировать для расширений

This commit is contained in:
Dmitriy Marmyshev 2021-06-26 13:37:51 +03:00
parent 7169f4422a
commit 5609051aa9
4 changed files with 29 additions and 12 deletions

View File

@ -6,19 +6,21 @@ Bundle-Version: 0.1.0.qualifier
Bundle-Activator: com.e1c.v8codestyle.internal.md.CorePlugin
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.18.0,4.0.0)",
org.eclipse.emf.ecore;bundle-version="[2.22.0,3.0.0)"
org.eclipse.emf.ecore;bundle-version="[2.22.0,3.0.0)",
org.eclipse.core.resources;bundle-version="[3.14.0,4.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: com.e1c.v8codestyle.md
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Import-Package: com._1c.g5.v8.bm.core;version="[7.0.0,8.0.0)",
com._1c.g5.v8.dt.common;version="[6.0.0,7.0.0)",
com._1c.g5.v8.dt.core.platform;version="[10.0.0,11.0.0)",
com._1c.g5.v8.dt.metadata.mdclass;version="[8.0.0,9.0.0)",
com._1c.g5.wiring;version="[2.2.0,3.0.0)",
com._1c.g5.wiring.binder;version="[1.1.0,2.0.0)",
com.e1c.g5.v8.dt.check;version="[1.0.0,2.0.0)",
com.e1c.g5.v8.dt.check.components;version="[1.0.0,2.0.0)",
com.e1c.g5.v8.dt.check.ext;version="[1.0.0,2.0.0)",
com.e1c.g5.v8.dt.check.settings;version="[1.0.0,2.0.0)",
com._1c.g5.v8.dt.common;version="[6.0.0,7.0.0)",
com._1c.g5.v8.dt.metadata.mdclass;version="[8.0.0,9.0.0)",
com._1c.g5.wiring;version="[2.2.0,3.0.0)",
com._1c.g5.wiring.binder;version="[1.1.0,2.0.0)",
com.google.common.base;version="[27.0.0,28.0.0)",
com.google.inject;version="[1.3.0,2.0.0)"

View File

@ -28,23 +28,23 @@
</check>
<check
category="com.e1c.v8codestyle.md"
class="com.e1c.v8codestyle.md.check.MdObjectNameLength">
class="com.e1c.v8codestyle.internal.md.ExecutableExtensionFactory:com.e1c.v8codestyle.md.check.MdObjectNameLength">
</check>
<check
category="com.e1c.v8codestyle.md"
class="com.e1c.v8codestyle.md.check.CommonModuleNameClient">
class="com.e1c.v8codestyle.internal.md.ExecutableExtensionFactory:com.e1c.v8codestyle.md.check.CommonModuleNameClient">
</check>
<check
category="com.e1c.v8codestyle.md"
class="com.e1c.v8codestyle.md.check.CommonModuleNameClientServer">
class="com.e1c.v8codestyle.internal.md.ExecutableExtensionFactory:com.e1c.v8codestyle.md.check.CommonModuleNameClientServer">
</check>
<check
category="com.e1c.v8codestyle.md"
class="com.e1c.v8codestyle.md.check.CommonModuleNameGlobal">
class="com.e1c.v8codestyle.internal.md.ExecutableExtensionFactory:com.e1c.v8codestyle.md.check.CommonModuleNameGlobal">
</check>
<check
category="com.e1c.v8codestyle.md"
class="com.e1c.v8codestyle.md.check.CommonModuleType">
class="com.e1c.v8codestyle.internal.md.ExecutableExtensionFactory:com.e1c.v8codestyle.md.check.CommonModuleType">
</check>
</extension>

View File

@ -14,6 +14,7 @@ package com.e1c.v8codestyle.internal.md;
import org.eclipse.core.runtime.Plugin;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.wiring.AbstractServiceAwareModule;
/**
@ -37,7 +38,7 @@ public class ExternalDependenciesModule
@Override
protected void doConfigure()
{
// empty
bind(IV8ProjectManager.class).toService();
}
}

View File

@ -17,6 +17,9 @@ import static com._1c.g5.v8.dt.metadata.mdclass.MdClassPackage.Literals.CONFIGUR
import org.eclipse.core.runtime.IProgressMonitor;
import com._1c.g5.v8.dt.core.platform.IConfigurationProject;
import com._1c.g5.v8.dt.core.platform.IV8Project;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.metadata.mdclass.Configuration;
import com._1c.g5.v8.dt.metadata.mdclass.DefaultDataLockControlMode;
import com.e1c.g5.v8.dt.check.CheckComplexity;
@ -24,6 +27,7 @@ import com.e1c.g5.v8.dt.check.ICheckParameters;
import com.e1c.g5.v8.dt.check.components.BasicCheck;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
import com.google.inject.Inject;
/**
* Check configuration data lock mode should be managed
@ -36,6 +40,14 @@ public final class ConfigurationDataLock
private static final String CHECK_ID = "configuration-data-lock-mode"; //$NON-NLS-1$
private final IV8ProjectManager v8ProjectManager;
@Inject
public ConfigurationDataLock(IV8ProjectManager v8ProjectManager)
{
this.v8ProjectManager = v8ProjectManager;
}
@Override
public String getCheckId()
{
@ -60,7 +72,9 @@ public final class ConfigurationDataLock
IProgressMonitor monitor)
{
Configuration configuration = (Configuration)object;
if (DefaultDataLockControlMode.MANAGED != configuration.getDataLockControlMode())
IV8Project v8Project = v8ProjectManager.getProject(configuration);
if (v8Project instanceof IConfigurationProject
&& DefaultDataLockControlMode.MANAGED != configuration.getDataLockControlMode())
{
resultAceptor.addIssue(Messages.ConfigurationDataLock_message, CONFIGURATION__DATA_LOCK_CONTROL_MODE);
}