You've already forked v8-code-style
mirror of
https://github.com/1C-Company/v8-code-style.git
synced 2025-07-17 13:07:50 +02:00
committed by
GitHub
parent
9ca89adede
commit
e2d0071c94
7
bundles/com.e1c.v8codestyle.ql/.classpath
Normal file
7
bundles/com.e1c.v8codestyle.ql/.classpath
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
bundles/com.e1c.v8codestyle.ql/.project
Normal file
28
bundles/com.e1c.v8codestyle.ql/.project
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.e1c.v8codestyle.ql</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
@ -0,0 +1,9 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
|
||||
org.eclipse.jdt.core.compiler.compliance=11
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||
org.eclipse.jdt.core.compiler.release=enabled
|
||||
org.eclipse.jdt.core.compiler.source=11
|
23
bundles/com.e1c.v8codestyle.ql/META-INF/MANIFEST.MF
Normal file
23
bundles/com.e1c.v8codestyle.ql/META-INF/MANIFEST.MF
Normal file
@ -0,0 +1,23 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: com.e1c.v8codestyle.ql;singleton:=true
|
||||
Bundle-Version: 0.1.0.qualifier
|
||||
Bundle-Activator: com.e1c.v8codestyle.internal.ql.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)"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
Automatic-Module-Name: com.e1c.v8codestyle.ql
|
||||
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.metadata.mdclass;version="[8.0.0,9.0.0)",
|
||||
com._1c.g5.v8.dt.ql.model;version="[4.0.0,5.0.0)",
|
||||
com._1c.g5.wiring;version="[2.2.0,3.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.settings;version="1.0.0",
|
||||
com.e1c.g5.v8.dt.ql.check;version="[1.0.0,2.0.0)",
|
||||
com.google.inject;version="[1.3.0,2.0.0)"
|
19
bundles/com.e1c.v8codestyle.ql/build.properties
Normal file
19
bundles/com.e1c.v8codestyle.ql/build.properties
Normal file
@ -0,0 +1,19 @@
|
||||
###############################################################################
|
||||
# Copyright (C) 2021, 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
|
||||
###############################################################################
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
plugin.xml,\
|
||||
plugin.properties,\
|
||||
plugin_ru.properties
|
3
bundles/com.e1c.v8codestyle.ql/check.descriptions/.gitignore
vendored
Normal file
3
bundles/com.e1c.v8codestyle.ql/check.descriptions/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
*.html
|
||||
*.css
|
||||
*.js
|
@ -0,0 +1,10 @@
|
||||
# ql-camel-case-string-literal
|
||||
|
||||
|
||||
|
||||
## Noncompliant Code Example
|
||||
|
||||
## Compliant Solution
|
||||
|
||||
## See
|
||||
|
@ -0,0 +1,10 @@
|
||||
# ql-cast-to-max-number
|
||||
|
||||
|
||||
|
||||
## Noncompliant Code Example
|
||||
|
||||
## Compliant Solution
|
||||
|
||||
## See
|
||||
|
@ -0,0 +1,10 @@
|
||||
# ql-join-to-sub-query
|
||||
|
||||
|
||||
|
||||
## Noncompliant Code Example
|
||||
|
||||
## Compliant Solution
|
||||
|
||||
## See
|
||||
|
@ -0,0 +1,10 @@
|
||||
# ql-camel-case-string-literal
|
||||
|
||||
|
||||
|
||||
## Неправильно
|
||||
|
||||
## Правильно
|
||||
|
||||
## См.
|
||||
|
@ -0,0 +1,10 @@
|
||||
# ql-cast-to-max-number
|
||||
|
||||
|
||||
|
||||
## Неправильно
|
||||
|
||||
## Правильно
|
||||
|
||||
## См.
|
||||
|
@ -0,0 +1,10 @@
|
||||
# ql-join-to-sub-query
|
||||
|
||||
|
||||
|
||||
## Неправильно
|
||||
|
||||
## Правильно
|
||||
|
||||
## См.
|
||||
|
18
bundles/com.e1c.v8codestyle.ql/plugin.properties
Normal file
18
bundles/com.e1c.v8codestyle.ql/plugin.properties
Normal file
@ -0,0 +1,18 @@
|
||||
###############################################################################
|
||||
# Copyright (C) 2021, 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
|
||||
###############################################################################
|
||||
#Properties file for com.e1c.v8codestyle.ql
|
||||
providerName = 1C-Soft LLC
|
||||
pluginName = 1C:Standards for V8 Query Language plugin
|
||||
|
||||
category.ql.description = Query language checks by standards
|
||||
category.ql.title = Query language checks by standards
|
39
bundles/com.e1c.v8codestyle.ql/plugin.xml
Normal file
39
bundles/com.e1c.v8codestyle.ql/plugin.xml
Normal file
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.4"?>
|
||||
<!--
|
||||
Copyright (C) 2021, 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
|
||||
-->
|
||||
|
||||
<plugin>
|
||||
<extension
|
||||
point="com.e1c.g5.v8.dt.check.checks">
|
||||
<category
|
||||
category="com.e1c.v8codestyle"
|
||||
description="%category.ql.description"
|
||||
id="com.e1c.v8codestyle.ql"
|
||||
title="%category.ql.title">
|
||||
</category>
|
||||
<check
|
||||
category="com.e1c.v8codestyle.ql"
|
||||
class="com.e1c.v8codestyle.ql.check.CamelCaseStringLiteral">
|
||||
</check>
|
||||
<check
|
||||
category="com.e1c.v8codestyle.ql"
|
||||
class="com.e1c.v8codestyle.ql.check.JoinToSubQuery">
|
||||
</check>
|
||||
<check
|
||||
category="com.e1c.v8codestyle.ql"
|
||||
class="com.e1c.v8codestyle.ql.check.CastToMaxNumber">
|
||||
</check>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
21
bundles/com.e1c.v8codestyle.ql/plugin_ru.properties
Normal file
21
bundles/com.e1c.v8codestyle.ql/plugin_ru.properties
Normal file
@ -0,0 +1,21 @@
|
||||
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
|
||||
###############################################################################
|
||||
# Copyright (C) 2021, 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
|
||||
###############################################################################
|
||||
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
|
||||
|
||||
category.ql.description = Проверки языка запросов по стандартам
|
||||
category.ql.title = Проверки языка запросов по стандартам
|
||||
|
||||
pluginName = 1С:Стандарты разработки V8 плагин языка запросов
|
||||
|
||||
providerName = ООО "1С-Софт"
|
68
bundles/com.e1c.v8codestyle.ql/pom.xml
Normal file
68
bundles/com.e1c.v8codestyle.ql/pom.xml
Normal file
@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (C) 2021, 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
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.e1c.v8codestyle</groupId>
|
||||
<artifactId>bundles</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>com.e1c.v8codestyle.ql</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
<properties>
|
||||
<!-- base dir of bom module: bom/parent/bundle/this-module -->
|
||||
<markdown.page.generator.html.file.path>${project.parent.parent.parent.basedir}</markdown.page.generator.html.file.path>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.ruleoftech</groupId>
|
||||
<artifactId>markdown-page-generator-plugin</artifactId>
|
||||
<configuration>
|
||||
<inputDirectory>${project.basedir}/markdown</inputDirectory>
|
||||
<outputDirectory>${project.basedir}/check.descriptions</outputDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-resource-files</id>
|
||||
<phase>generate-sources</phase>
|
||||
<configuration>
|
||||
<target>
|
||||
<property name="source" value="${project.basedir}/../../bom"/>
|
||||
<copy toDir="${project.basedir}/check.descriptions/css">
|
||||
<fileset dir="${source}/html/css" />
|
||||
</copy>
|
||||
<copy toDir="${project.basedir}/check.descriptions/js">
|
||||
<fileset dir="${source}/html/js" />
|
||||
</copy>
|
||||
</target>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -0,0 +1,167 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2021, 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.internal.ql;
|
||||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Plugin;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
/**
|
||||
* Plugin activator. The activator class controls the plugin life cycle.
|
||||
*
|
||||
* @author Dmitriy Marmyshev
|
||||
*/
|
||||
public class CorePlugin
|
||||
extends Plugin
|
||||
{
|
||||
|
||||
public static final String PLUGIN_ID = "com.e1c.v8codestyle.ql"; //$NON-NLS-1$
|
||||
|
||||
private static CorePlugin plugin;
|
||||
|
||||
private Injector injector;
|
||||
|
||||
/**
|
||||
* Returns the shared instance
|
||||
*
|
||||
* @return the shared instance
|
||||
*/
|
||||
public static CorePlugin getDefault()
|
||||
{
|
||||
return plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a status to the plugin log.
|
||||
*
|
||||
* @param status status to log, cannot be <code>null</code>
|
||||
*/
|
||||
public static void log(IStatus status)
|
||||
{
|
||||
plugin.getLog().log(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a throwable to the plugin log as error status.
|
||||
*
|
||||
* @param throwable throwable, cannot be <code>null</code>
|
||||
*/
|
||||
public static void logError(Throwable throwable)
|
||||
{
|
||||
log(createErrorStatus(throwable.getMessage(), throwable));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates error status by a given message and cause throwable.
|
||||
*
|
||||
* @param message status message, cannot be <code>null</code>
|
||||
* @param throwable throwable, can be <code>null</code> if not applicable
|
||||
* @return status created error status, never <code>null</code>
|
||||
*/
|
||||
public static IStatus createErrorStatus(String message, Throwable throwable)
|
||||
{
|
||||
return new Status(IStatus.ERROR, PLUGIN_ID, 0, message, throwable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates warning status by a given message.
|
||||
*
|
||||
* @param message status message, cannot be <code>null</code>
|
||||
* @return status created warning status, never <code>null</code>
|
||||
*/
|
||||
public static IStatus createWarningStatus(String message)
|
||||
{
|
||||
return new Status(IStatus.WARNING, PLUGIN_ID, 0, message, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates warning status by a given message and cause throwable.
|
||||
*
|
||||
* @param message status message, cannot be <code>null</code>
|
||||
* @param throwable throwable, can be <code>null</code> if not applicable
|
||||
* @return status created warning status, never <code>null</code>
|
||||
*/
|
||||
public static IStatus createWarningStatus(final String message, Exception throwable)
|
||||
{
|
||||
return new Status(IStatus.WARNING, PLUGIN_ID, 0, message, throwable);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
@Override
|
||||
public void start(BundleContext bundleContext) throws Exception
|
||||
{
|
||||
super.start(bundleContext);
|
||||
|
||||
plugin = this;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
@Override
|
||||
public void stop(BundleContext bundleContext) throws Exception
|
||||
{
|
||||
plugin = null;
|
||||
injector = null;
|
||||
|
||||
super.stop(bundleContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Guice injector for this plugin.
|
||||
*
|
||||
* @return Guice injector for this plugin, never <code>null</code>
|
||||
*/
|
||||
/* package */ Injector getInjector()
|
||||
{
|
||||
Injector localInstance = injector;
|
||||
if (localInstance == null)
|
||||
{
|
||||
synchronized (CorePlugin.class)
|
||||
{
|
||||
localInstance = injector;
|
||||
if (localInstance == null)
|
||||
{
|
||||
localInstance = createInjector();
|
||||
injector = localInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
return localInstance;
|
||||
}
|
||||
|
||||
private Injector createInjector()
|
||||
{
|
||||
try
|
||||
{
|
||||
return Guice.createInjector(new ExternalDependenciesModule(this));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log(createErrorStatus("Failed to create injector for " //$NON-NLS-1$
|
||||
+ getBundle().getSymbolicName(), e));
|
||||
throw new RuntimeException("Failed to create injector for " //$NON-NLS-1$
|
||||
+ getBundle().getSymbolicName(), e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2021, 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.internal.ql;
|
||||
|
||||
import org.osgi.framework.Bundle;
|
||||
|
||||
import com._1c.g5.wiring.AbstractGuiceAwareExecutableExtensionFactory;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
/**
|
||||
* Guice module aware executable extension factory for plugin.
|
||||
*
|
||||
* @author Dmitriy Marmyshev
|
||||
*/
|
||||
public class ExecutableExtensionFactory
|
||||
extends AbstractGuiceAwareExecutableExtensionFactory
|
||||
{
|
||||
@Override
|
||||
protected Bundle getBundle()
|
||||
{
|
||||
return CorePlugin.getDefault().getBundle();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Injector getInjector()
|
||||
{
|
||||
return CorePlugin.getDefault().getInjector();
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2021, 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.internal.ql;
|
||||
|
||||
import org.eclipse.core.runtime.Plugin;
|
||||
|
||||
import com._1c.g5.wiring.AbstractServiceAwareModule;
|
||||
|
||||
/**
|
||||
* External services bindings for plugin.
|
||||
*
|
||||
* @author Dmitriy Marmyshev
|
||||
*
|
||||
*/
|
||||
public class ExternalDependenciesModule
|
||||
extends AbstractServiceAwareModule
|
||||
{
|
||||
|
||||
/**
|
||||
* @param plugin
|
||||
*/
|
||||
public ExternalDependenciesModule(Plugin plugin)
|
||||
{
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doConfigure()
|
||||
{
|
||||
// empty
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2021, 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.ql.check;
|
||||
|
||||
import static com._1c.g5.v8.dt.ql.model.QlPackage.Literals.STRING_LITERAL_EXPRESSION__CONTENT;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
import com._1c.g5.v8.dt.common.StringUtils;
|
||||
import com._1c.g5.v8.dt.ql.model.StringLiteralExpression;
|
||||
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.g5.v8.dt.ql.check.QlBasicDelegateCheck;
|
||||
|
||||
/**
|
||||
* The check QL string literal contains only camel-case words and not contains any special symbols mixes with letters.
|
||||
*
|
||||
* @author Dmitriy Marmyshev
|
||||
*/
|
||||
public class CamelCaseStringLiteral
|
||||
extends QlBasicDelegateCheck
|
||||
{
|
||||
|
||||
private static final String CHECK_ID = "ql-camel-case-string-literal"; //$NON-NLS-1$
|
||||
|
||||
private static final String PARAMETER_SKIP_CONTENT_PATTERN = "skipContentPattern"; //$NON-NLS-1$
|
||||
|
||||
private static final Pattern WORD_PATTERN = Pattern.compile("\\p{L}+", Pattern.UNICODE_CHARACTER_CLASS); //$NON-NLS-1$
|
||||
|
||||
private static final Pattern NON_WORD_PATTERN = Pattern.compile("\\W+", Pattern.UNICODE_CHARACTER_CLASS); //$NON-NLS-1$
|
||||
|
||||
@Override
|
||||
public String getCheckId()
|
||||
{
|
||||
return CHECK_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configureCheck(CheckConfigurer builder)
|
||||
{
|
||||
builder.title(Messages.CamelCaseStringLiteral_title)
|
||||
.description(Messages.CamelCaseStringLiteral_description)
|
||||
.complexity(CheckComplexity.NORMAL)
|
||||
.severity(IssueSeverity.MINOR)
|
||||
.issueType(IssueType.CODE_STYLE)
|
||||
.delegate(StringLiteralExpression.class);
|
||||
builder.parameter(PARAMETER_SKIP_CONTENT_PATTERN, String.class, StringUtils.EMPTY,
|
||||
Messages.CamelCaseStringLiteral_Regular_expression_to_skip_literal_content);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkQlObject(EObject object, QueryOwner owner, IQlResultAcceptor resultAceptor,
|
||||
ICheckParameters parameters, IProgressMonitor monitor)
|
||||
{
|
||||
StringLiteralExpression literal = (StringLiteralExpression)object;
|
||||
String content = literal.getContent();
|
||||
if (content == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (content.length() > 2)
|
||||
{
|
||||
content = content.substring(1, content.length() - 1);
|
||||
}
|
||||
|
||||
String skipContentPattern = parameters.getString(PARAMETER_SKIP_CONTENT_PATTERN);
|
||||
if (skipContentPattern != null && content.matches(skipContentPattern))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Matcher matcher = NON_WORD_PATTERN.matcher(content);
|
||||
if (matcher.find() && WORD_PATTERN.matcher(content).find())
|
||||
{
|
||||
String message =
|
||||
MessageFormat.format(Messages.CamelCaseStringLiteral_String_literal_contains_non_CamelCase_symbols__0,
|
||||
content.substring(matcher.start(), matcher.end()));
|
||||
resultAceptor.addIssue(message, literal, STRING_LITERAL_EXPRESSION__CONTENT);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2021, 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.ql.check;
|
||||
|
||||
import static com._1c.g5.v8.dt.ql.model.QlPackage.Literals.CASTING_NUMBER_TYPE__PRECISION;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
import com._1c.g5.v8.dt.ql.model.CastingNumberType;
|
||||
import com._1c.g5.v8.dt.ql.model.NumberLiteralExpression;
|
||||
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.g5.v8.dt.ql.check.QlBasicDelegateCheck;
|
||||
|
||||
/**
|
||||
* The check of query CAST to Number(31, N) because max allowed number is different in for supported SQL servers.
|
||||
*
|
||||
* @author Dmitriy Marmyshev
|
||||
*/
|
||||
public class CastToMaxNumber
|
||||
extends QlBasicDelegateCheck
|
||||
{
|
||||
|
||||
private static final String CHECK_ID = "ql-cast-to-max-number"; //$NON-NLS-1$
|
||||
|
||||
private static final String MAX_NUMBER_LENGTH = "maxNumberLength"; //$NON-NLS-1$
|
||||
|
||||
private static final String MAX_NUMBER_LENGTH_DEFAULT = "31"; //$NON-NLS-1$
|
||||
|
||||
private static final String MAX_NUMBER_PRECISION = "maxNumberPrecision"; //$NON-NLS-1$
|
||||
|
||||
private static final String MAX_NUMBER_PRECISION_DEFAULT = "-1"; //$NON-NLS-1$
|
||||
|
||||
@Override
|
||||
public String getCheckId()
|
||||
{
|
||||
return CHECK_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configureCheck(CheckConfigurer builder)
|
||||
{
|
||||
builder.title(Messages.CastToMaxNumber_title)
|
||||
.description(Messages.CastToMaxNumber_description)
|
||||
.complexity(CheckComplexity.NORMAL)
|
||||
.severity(IssueSeverity.MAJOR)
|
||||
.issueType(IssueType.ERROR)
|
||||
.delegate(CastingNumberType.class);
|
||||
builder
|
||||
.parameter(MAX_NUMBER_LENGTH, Integer.class, MAX_NUMBER_LENGTH_DEFAULT,
|
||||
Messages.CastToMaxNumber_Maximum_cast_number_length)
|
||||
.parameter(MAX_NUMBER_PRECISION, Integer.class, MAX_NUMBER_PRECISION_DEFAULT,
|
||||
Messages.CastToMaxNumber_Maximum_cast_number_precision_or_N_to_skip_check);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkQlObject(EObject object, QueryOwner owner, IQlResultAcceptor resultAceptor,
|
||||
ICheckParameters parameters, IProgressMonitor monitor)
|
||||
{
|
||||
CastingNumberType casting = (CastingNumberType)object;
|
||||
|
||||
int length = parameters.getInt(MAX_NUMBER_LENGTH);
|
||||
int precision = parameters.getInt(MAX_NUMBER_PRECISION);
|
||||
|
||||
if (length > 0 && casting.getLength() instanceof NumberLiteralExpression)
|
||||
{
|
||||
NumberLiteralExpression lengthExpression = (NumberLiteralExpression)casting.getLength();
|
||||
int current = Integer.parseInt(lengthExpression.getIntPart());
|
||||
if (current > length)
|
||||
{
|
||||
String message = MessageFormat.format(
|
||||
Messages.CastToMaxNumber_Query_cast_to_number_with_lenth__0__and_max_allowed__1, current, length);
|
||||
resultAceptor.addIssue(message, object, CASTING_NUMBER_TYPE__PRECISION);
|
||||
}
|
||||
}
|
||||
|
||||
if (precision > -1 && casting.getPrecision() instanceof NumberLiteralExpression)
|
||||
{
|
||||
NumberLiteralExpression precisionExpression = (NumberLiteralExpression)casting.getPrecision();
|
||||
int current = Integer.parseInt(precisionExpression.getIntPart());
|
||||
if (current > precision)
|
||||
{
|
||||
String message = MessageFormat.format(
|
||||
Messages.CastToMaxNumber_Query_cast_to_number_with_precision__0__and_max_allowed__1, current,
|
||||
precision);
|
||||
resultAceptor.addIssue(message, object, CASTING_NUMBER_TYPE__PRECISION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2021, 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.ql.check;
|
||||
|
||||
import static com._1c.g5.v8.dt.ql.model.QlPackage.Literals.QUERY_SCHEMA_QUERY_SOURCE_JOIN__SOURCE;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
import com._1c.g5.v8.dt.ql.model.QuerySchemaNestedQuery;
|
||||
import com._1c.g5.v8.dt.ql.model.QuerySchemaQuerySourceJoin;
|
||||
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.g5.v8.dt.ql.check.QlBasicDelegateCheck;
|
||||
|
||||
/**
|
||||
* The check of QL query that join with sub query, which lead to performance decrease.
|
||||
*
|
||||
* @author Dmitriy Marmyshev
|
||||
*/
|
||||
public class JoinToSubQuery
|
||||
extends QlBasicDelegateCheck
|
||||
{
|
||||
|
||||
private static final String CHECK_ID = "ql-join-to-sub-query"; //$NON-NLS-1$
|
||||
|
||||
@Override
|
||||
public String getCheckId()
|
||||
{
|
||||
return CHECK_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configureCheck(CheckConfigurer builder)
|
||||
{
|
||||
builder.title(Messages.JoinToSubQuery_title)
|
||||
.description(Messages.JoinToSubQuery_description)
|
||||
.complexity(CheckComplexity.NORMAL)
|
||||
.severity(IssueSeverity.MAJOR)
|
||||
.issueType(IssueType.PERFORMANCE)
|
||||
.delegate(QuerySchemaQuerySourceJoin.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkQlObject(EObject object, QueryOwner owner, IQlResultAcceptor resultAceptor,
|
||||
ICheckParameters parameters, IProgressMonitor monitor)
|
||||
{
|
||||
QuerySchemaQuerySourceJoin join = (QuerySchemaQuerySourceJoin)object;
|
||||
|
||||
if (join.getSource() != null && join.getSource().getSource() instanceof QuerySchemaNestedQuery)
|
||||
{
|
||||
resultAceptor.addIssue(Messages.JoinToSubQuery_Query_join_to_sub_query_not_allowed, object,
|
||||
QUERY_SCHEMA_QUERY_SOURCE_JOIN__SOURCE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2021, 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.ql.check;
|
||||
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
|
||||
/**
|
||||
* @author Dmitriy Marmyshev
|
||||
*
|
||||
*/
|
||||
final class Messages
|
||||
extends NLS
|
||||
{
|
||||
private static final String BUNDLE_NAME = "com.e1c.v8codestyle.ql.check.messages"; //$NON-NLS-1$
|
||||
public static String CamelCaseStringLiteral_description;
|
||||
public static String CamelCaseStringLiteral_Regular_expression_to_skip_literal_content;
|
||||
public static String CamelCaseStringLiteral_String_literal_contains_non_CamelCase_symbols__0;
|
||||
public static String CamelCaseStringLiteral_title;
|
||||
public static String CastToMaxNumber_description;
|
||||
public static String CastToMaxNumber_Maximum_cast_number_length;
|
||||
public static String CastToMaxNumber_Maximum_cast_number_precision_or_N_to_skip_check;
|
||||
public static String CastToMaxNumber_Query_cast_to_number_with_lenth__0__and_max_allowed__1;
|
||||
public static String CastToMaxNumber_Query_cast_to_number_with_precision__0__and_max_allowed__1;
|
||||
public static String CastToMaxNumber_title;
|
||||
public static String JoinToSubQuery_description;
|
||||
public static String JoinToSubQuery_Query_join_to_sub_query_not_allowed;
|
||||
public static String JoinToSubQuery_title;
|
||||
static
|
||||
{
|
||||
// initialize resource bundle
|
||||
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
|
||||
}
|
||||
|
||||
private Messages()
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
###############################################################################
|
||||
# Copyright (C) 2021, 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
|
||||
###############################################################################
|
||||
CamelCaseStringLiteral_description=Query string literal contains non CamelCase content
|
||||
CamelCaseStringLiteral_Regular_expression_to_skip_literal_content=Regular expression to skip literal content
|
||||
CamelCaseStringLiteral_String_literal_contains_non_CamelCase_symbols__0=String literal contains non CamelCase symbols: "{0}"
|
||||
CamelCaseStringLiteral_title=Query string literal contains non CamelCase content
|
||||
CastToMaxNumber_description=Query cast to max number
|
||||
CastToMaxNumber_Maximum_cast_number_length=Maximum cast number length
|
||||
CastToMaxNumber_Maximum_cast_number_precision_or_N_to_skip_check=Maximum cast number precision, or -1 to skip check
|
||||
CastToMaxNumber_Query_cast_to_number_with_lenth__0__and_max_allowed__1=Query cast to number with lenth {0} and max allowed {1}
|
||||
CastToMaxNumber_Query_cast_to_number_with_precision__0__and_max_allowed__1=Query cast to number with precision {0} and max allowed {1}
|
||||
CastToMaxNumber_title=Query cast to max number
|
||||
JoinToSubQuery_description=Query join with sub query
|
||||
JoinToSubQuery_Query_join_to_sub_query_not_allowed=Query join to sub query not allowed
|
||||
JoinToSubQuery_title=Query join with sub query
|
@ -0,0 +1,27 @@
|
||||
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
|
||||
|
||||
CamelCaseStringLiteral_Regular_expression_to_skip_literal_content = Регулярное выражение для исключения содержимого литерела
|
||||
|
||||
CamelCaseStringLiteral_String_literal_contains_non_CamelCase_symbols__0 = Строковый литерал содержит не CamelCase символы: "{0}"
|
||||
|
||||
CamelCaseStringLiteral_description = Строковый литерал в запросе содержит не КемелКейс контент
|
||||
|
||||
CamelCaseStringLiteral_title = Строковый литерал в запросе содержит не КемелКейс контент
|
||||
|
||||
CastToMaxNumber_Maximum_cast_number_length = Максимальная длина числа выражения
|
||||
|
||||
CastToMaxNumber_Maximum_cast_number_precision_or_N_to_skip_check = Максимальная точность числа выражения, или -1 для пропуска проверки
|
||||
|
||||
CastToMaxNumber_Query_cast_to_number_with_lenth__0__and_max_allowed__1 = Выражение к числу в запросе с длиной {0} и максимально разрешенной {1}
|
||||
|
||||
CastToMaxNumber_Query_cast_to_number_with_precision__0__and_max_allowed__1 = Выражение к числу в запросе с точностью {0} и максимально разрешенной {1}
|
||||
|
||||
CastToMaxNumber_description = Выражение к максимальному числу в запросе
|
||||
|
||||
CastToMaxNumber_title = Выражение к максимальному числу в запросе
|
||||
|
||||
JoinToSubQuery_Query_join_to_sub_query_not_allowed = Соединение в запросе с подзапросом не разрешено
|
||||
|
||||
JoinToSubQuery_description = Соединение запроса с подзапросом
|
||||
|
||||
JoinToSubQuery_title = Соединение запроса с подзапросом
|
@ -27,6 +27,7 @@
|
||||
<module>com.e1c.v8codestyle.md</module>
|
||||
<module>com.e1c.v8codestyle.autosort</module>
|
||||
<module>com.e1c.v8codestyle.autosort.ui</module>
|
||||
<module>com.e1c.v8codestyle.ql</module>
|
||||
</modules>
|
||||
|
||||
<build>
|
||||
|
@ -46,6 +46,13 @@
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.e1c.v8codestyle.ql"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.e1c.v8codestyle.autosort"
|
||||
download-size="0"
|
||||
|
7
tests/com.e1c.v8codestyle.ql.itests/.classpath
Normal file
7
tests/com.e1c.v8codestyle.ql.itests/.classpath
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
tests/com.e1c.v8codestyle.ql.itests/.project
Normal file
28
tests/com.e1c.v8codestyle.ql.itests/.project
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.e1c.v8codestyle.ql.itests</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
@ -0,0 +1,10 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
|
||||
org.eclipse.jdt.core.compiler.compliance=11
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||
org.eclipse.jdt.core.compiler.release=enabled
|
||||
org.eclipse.jdt.core.compiler.source=11
|
18
tests/com.e1c.v8codestyle.ql.itests/META-INF/MANIFEST.MF
Normal file
18
tests/com.e1c.v8codestyle.ql.itests/META-INF/MANIFEST.MF
Normal file
@ -0,0 +1,18 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: com.e1c.v8codestyle.ql.itests;singleton:=true
|
||||
Bundle-Version: 0.1.0.qualifier
|
||||
Bundle-Vendor: %providerName
|
||||
Fragment-Host: com.e1c.v8codestyle.ql;bundle-version="[0.1.0,0.2.0)"
|
||||
Automatic-Module-Name: com.e1c.v8codestyle.ql.itests
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
Bundle-Localization: fragment
|
||||
Import-Package: com._1c.g5.v8.bm.integration;version="[9.1.0,10.0.0)",
|
||||
com._1c.g5.v8.dt.core.platform;version="[10.3.0,11.0.0)",
|
||||
com._1c.g5.v8.dt.form.model;version="[9.0.0,10.0.0)",
|
||||
com._1c.g5.v8.dt.mcore;version="[6.0.0,7.0.0)",
|
||||
com.e1c.g5.v8.dt.testing.check;version="[1.0.0,2.0.0)",
|
||||
com._1c.g5.v8.dt.validation.marker;version="[4.0.0,5.0.0)",
|
||||
org.junit;version="[4.13.0,5.0.0)"
|
||||
Require-Bundle: org.eclipse.core.resources;bundle-version="[3.13.900,4.0.0)"
|
18
tests/com.e1c.v8codestyle.ql.itests/build.properties
Normal file
18
tests/com.e1c.v8codestyle.ql.itests/build.properties
Normal file
@ -0,0 +1,18 @@
|
||||
###############################################################################
|
||||
# Copyright (C) 2021, 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
|
||||
###############################################################################
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
fragment.properties,\
|
||||
workspace/
|
15
tests/com.e1c.v8codestyle.ql.itests/fragment.properties
Normal file
15
tests/com.e1c.v8codestyle.ql.itests/fragment.properties
Normal file
@ -0,0 +1,15 @@
|
||||
###############################################################################
|
||||
# Copyright (C) 2021, 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
|
||||
###############################################################################
|
||||
#Properties file for com.e1c.v8codestyle.ql.itests
|
||||
providerName = 1C-Soft LLC
|
||||
pluginName = 1C:Standards for V8 Query Language Integration test plugin
|
27
tests/com.e1c.v8codestyle.ql.itests/pom.xml
Normal file
27
tests/com.e1c.v8codestyle.ql.itests/pom.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (C) 2021, 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
|
||||
-->
|
||||
|
||||
<project
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.e1c.v8codestyle</groupId>
|
||||
<artifactId>tests</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>com.e1c.v8codestyle.ql.itests</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<packaging>eclipse-test-plugin</packaging>
|
||||
</project>
|
@ -0,0 +1,90 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2021, 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.ql.itests;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.junit.Test;
|
||||
|
||||
import com._1c.g5.v8.bm.core.IBmObject;
|
||||
import com._1c.g5.v8.bm.core.IBmTransaction;
|
||||
import com._1c.g5.v8.bm.integration.AbstractBmTask;
|
||||
import com._1c.g5.v8.bm.integration.IBmModel;
|
||||
import com._1c.g5.v8.dt.core.platform.IDtProject;
|
||||
import com._1c.g5.v8.dt.form.model.DynamicListExtInfo;
|
||||
import com._1c.g5.v8.dt.form.model.Form;
|
||||
import com._1c.g5.v8.dt.form.model.FormAttribute;
|
||||
import com._1c.g5.v8.dt.validation.marker.Marker;
|
||||
import com.e1c.g5.v8.dt.testing.check.CheckTestBase;
|
||||
import com.e1c.v8codestyle.ql.check.CamelCaseStringLiteral;
|
||||
|
||||
/**
|
||||
* Test {@link CamelCaseStringLiteral} class that checks string literal contains only camel-case words
|
||||
* or non-word symbols.
|
||||
*
|
||||
* @author Dmitriy Marmyshev
|
||||
*/
|
||||
public class CamelCaseStringLiteralTest
|
||||
extends CheckTestBase
|
||||
{
|
||||
|
||||
private static final String CHECK_ID = "ql-camel-case-string-literal"; //$NON-NLS-1$
|
||||
|
||||
private static final String PROJECT_NAME = "StringLiteralCameCase";
|
||||
|
||||
@Test
|
||||
public void testCamelCaseWithSymbols() throws Exception
|
||||
{
|
||||
IDtProject project = openProjectAndWaitForValidationFinish(PROJECT_NAME);
|
||||
assertNotNull(project);
|
||||
IBmObject object = getTopObjectByFqn("CommonForm.Form.Form", project);
|
||||
assertNotNull(object);
|
||||
Marker marker = getFirstNestedMarker(CHECK_ID, object.bmGetId(), project);
|
||||
assertNotNull(marker);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCamelCaseWithoutSymbols() throws Exception
|
||||
{
|
||||
IDtProject project = openProjectAndWaitForValidationFinish(PROJECT_NAME);
|
||||
assertNotNull(project);
|
||||
IBmObject object = getTopObjectByFqn("CommonForm.Form.Form", project);
|
||||
assertTrue(object instanceof Form);
|
||||
Marker marker = getFirstNestedMarker(CHECK_ID, object.bmGetId(), project);
|
||||
assertNotNull(marker);
|
||||
|
||||
// update query text
|
||||
long id = object.bmGetId();
|
||||
IBmModel model = bmModelManager.getModel(project);
|
||||
object = model.getGlobalContext().execute(new AbstractBmTask<IBmObject>("Edit Form")
|
||||
{
|
||||
|
||||
@Override
|
||||
public IBmObject execute(IBmTransaction transaction, IProgressMonitor monitor)
|
||||
{
|
||||
Form form = (Form)transaction.getObjectById(id);
|
||||
FormAttribute attribute = form.getAttributes().get(0);
|
||||
((DynamicListExtInfo)attribute.getExtInfo()).setQueryText("SELECT\r\n" + " \"A1\" AS Field");
|
||||
|
||||
return form;
|
||||
}
|
||||
});
|
||||
waitForDD(project);
|
||||
|
||||
marker = getFirstNestedMarker(CHECK_ID, object.bmGetId(), project);
|
||||
assertNull(marker);
|
||||
}
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2021, 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.ql.itests;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.junit.Test;
|
||||
|
||||
import com._1c.g5.v8.bm.core.IBmObject;
|
||||
import com._1c.g5.v8.bm.core.IBmTransaction;
|
||||
import com._1c.g5.v8.bm.integration.AbstractBmTask;
|
||||
import com._1c.g5.v8.bm.integration.IBmModel;
|
||||
import com._1c.g5.v8.dt.core.platform.IDtProject;
|
||||
import com._1c.g5.v8.dt.form.model.DynamicListExtInfo;
|
||||
import com._1c.g5.v8.dt.form.model.Form;
|
||||
import com._1c.g5.v8.dt.form.model.FormAttribute;
|
||||
import com._1c.g5.v8.dt.validation.marker.Marker;
|
||||
import com.e1c.g5.v8.dt.testing.check.CheckTestBase;
|
||||
import com.e1c.v8codestyle.ql.check.CamelCaseStringLiteral;
|
||||
|
||||
/**
|
||||
* Test {@link CamelCaseStringLiteral} class that checks string literal contains only camel-case words
|
||||
* or non-word symbols.
|
||||
*
|
||||
* @author Dmitriy Marmyshev
|
||||
*/
|
||||
public class CastToMaxNumberTest
|
||||
extends CheckTestBase
|
||||
{
|
||||
|
||||
private static final String CHECK_ID = "ql-cast-to-max-number"; //$NON-NLS-1$
|
||||
|
||||
private static final String PROJECT_NAME = "CastToMaxNumber";
|
||||
|
||||
@Test
|
||||
public void testCastToOverMaxNumber() throws Exception
|
||||
{
|
||||
IDtProject project = openProjectAndWaitForValidationFinish(PROJECT_NAME);
|
||||
assertNotNull(project);
|
||||
IBmObject object = getTopObjectByFqn("CommonForm.Form.Form", project);
|
||||
assertNotNull(object);
|
||||
Marker marker = getFirstNestedMarker(CHECK_ID, object.bmGetId(), project);
|
||||
assertNotNull(marker);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCastToMaxNumber() throws Exception
|
||||
{
|
||||
IDtProject project = openProjectAndWaitForValidationFinish(PROJECT_NAME);
|
||||
assertNotNull(project);
|
||||
IBmObject object = getTopObjectByFqn("CommonForm.Form.Form", project);
|
||||
assertTrue(object instanceof Form);
|
||||
Marker marker = getFirstNestedMarker(CHECK_ID, object.bmGetId(), project);
|
||||
assertNotNull(marker);
|
||||
|
||||
// update query text
|
||||
long id = object.bmGetId();
|
||||
IBmModel model = bmModelManager.getModel(project);
|
||||
object = model.getGlobalContext().execute(new AbstractBmTask<IBmObject>("Edit Form")
|
||||
{
|
||||
|
||||
@Override
|
||||
public IBmObject execute(IBmTransaction transaction, IProgressMonitor monitor)
|
||||
{
|
||||
Form form = (Form)transaction.getObjectById(id);
|
||||
FormAttribute attribute = form.getAttributes().get(0);
|
||||
((DynamicListExtInfo)attribute.getExtInfo())
|
||||
.setQueryText("SELECT\r\n CAST(10 AS NUMBER(31, 2)) AS Field");
|
||||
return form;
|
||||
}
|
||||
});
|
||||
waitForDD(project);
|
||||
|
||||
marker = getFirstNestedMarker(CHECK_ID, object.bmGetId(), project);
|
||||
assertNull(marker);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCastToMaxNumberPrecisionAbsent() throws Exception
|
||||
{
|
||||
IDtProject project = openProjectAndWaitForValidationFinish(PROJECT_NAME);
|
||||
assertNotNull(project);
|
||||
IBmObject object = getTopObjectByFqn("CommonForm.Form.Form", project);
|
||||
assertTrue(object instanceof Form);
|
||||
Marker marker = getFirstNestedMarker(CHECK_ID, object.bmGetId(), project);
|
||||
assertNotNull(marker);
|
||||
|
||||
// update query text
|
||||
long id = object.bmGetId();
|
||||
IBmModel model = bmModelManager.getModel(project);
|
||||
object = model.getGlobalContext().execute(new AbstractBmTask<IBmObject>("Edit Form")
|
||||
{
|
||||
|
||||
@Override
|
||||
public IBmObject execute(IBmTransaction transaction, IProgressMonitor monitor)
|
||||
{
|
||||
Form form = (Form)transaction.getObjectById(id);
|
||||
FormAttribute attribute = form.getAttributes().get(0);
|
||||
((DynamicListExtInfo)attribute.getExtInfo())
|
||||
.setQueryText("SELECT\r\n CAST(10. AS NUMBER(31)) AS Field");
|
||||
return form;
|
||||
}
|
||||
});
|
||||
waitForDD(project);
|
||||
|
||||
marker = getFirstNestedMarker(CHECK_ID, object.bmGetId(), project);
|
||||
assertNull(marker);
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2021, 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.ql.itests;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com._1c.g5.v8.bm.core.IBmObject;
|
||||
import com._1c.g5.v8.dt.core.platform.IDtProject;
|
||||
import com._1c.g5.v8.dt.validation.marker.Marker;
|
||||
import com.e1c.g5.v8.dt.testing.check.CheckTestBase;
|
||||
import com.e1c.v8codestyle.ql.check.CamelCaseStringLiteral;
|
||||
|
||||
/**
|
||||
* Test {@link CamelCaseStringLiteral} class that checks string literal contains only camel-case words
|
||||
* or non-word symbols.
|
||||
*
|
||||
* @author Dmitriy Marmyshev
|
||||
*/
|
||||
public class JoinToSubQueryTest
|
||||
extends CheckTestBase
|
||||
{
|
||||
|
||||
private static final String CHECK_ID = "ql-join-to-sub-query"; //$NON-NLS-1$
|
||||
|
||||
private static final String PROJECT_NAME = "JoinToSubQuery";
|
||||
|
||||
@Test
|
||||
public void testJoinToSubQuery() throws Exception
|
||||
{
|
||||
IDtProject project = openProjectAndWaitForValidationFinish(PROJECT_NAME);
|
||||
assertNotNull(project);
|
||||
IBmObject object = getTopObjectByFqn("CommonForm.Form.Form", project);
|
||||
assertNotNull(object);
|
||||
Marker marker = getFirstNestedMarker(CHECK_ID, object.bmGetId(), project);
|
||||
assertNotNull(marker);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>CastToMaxNumber</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
|
||||
<nature>com._1c.g5.v8.dt.core.V8ConfigurationNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
@ -0,0 +1,2 @@
|
||||
Manifest-Version: 1.0
|
||||
Runtime-Version: 8.3.19
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings"/>
|
@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form:Form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:form="http://g5.1c.ru/v8/dt/form" xmlns:schema="http://g5.1c.ru/v8/dt/data-composition-system/schema">
|
||||
<autoCommandBar>
|
||||
<name>FormCommandBar</name>
|
||||
<id>-1</id>
|
||||
<visible>true</visible>
|
||||
<enabled>true</enabled>
|
||||
<userVisible>
|
||||
<common>true</common>
|
||||
</userVisible>
|
||||
<horizontalAlign>Left</horizontalAlign>
|
||||
<autoFill>true</autoFill>
|
||||
</autoCommandBar>
|
||||
<autoTitle>true</autoTitle>
|
||||
<autoUrl>true</autoUrl>
|
||||
<group>Vertical</group>
|
||||
<autoFillCheck>true</autoFillCheck>
|
||||
<allowFormCustomize>true</allowFormCustomize>
|
||||
<enabled>true</enabled>
|
||||
<showTitle>true</showTitle>
|
||||
<showCloseButton>true</showCloseButton>
|
||||
<attributes>
|
||||
<name>List</name>
|
||||
<title>
|
||||
<key>en</key>
|
||||
<value>List</value>
|
||||
</title>
|
||||
<id>1</id>
|
||||
<valueType>
|
||||
<types>DynamicList</types>
|
||||
</valueType>
|
||||
<view>
|
||||
<common>true</common>
|
||||
</view>
|
||||
<edit>
|
||||
<common>true</common>
|
||||
</edit>
|
||||
<extInfo xsi:type="form:DynamicListExtInfo">
|
||||
<queryText>SELECT
|
||||
CAST(10 AS NUMBER(35, 2)) AS Field</queryText>
|
||||
<autoFillAvailableFields>true</autoFillAvailableFields>
|
||||
<customQuery>true</customQuery>
|
||||
<autoSaveUserSettings>true</autoSaveUserSettings>
|
||||
<getInvisibleFieldPresentations>true</getInvisibleFieldPresentations>
|
||||
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
|
||||
<dataPath>Field</dataPath>
|
||||
<field>Field</field>
|
||||
<title>
|
||||
<localValue>
|
||||
<content>
|
||||
<key>en</key>
|
||||
<value>Field</value>
|
||||
</content>
|
||||
</localValue>
|
||||
</title>
|
||||
</fields>
|
||||
</extInfo>
|
||||
</attributes>
|
||||
<commandInterface>
|
||||
<navigationPanel/>
|
||||
<commandBar/>
|
||||
</commandInterface>
|
||||
</form:Form>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonForm xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="f3f0ec83-a1b9-45f3-9eff-9ecdf12f23a8">
|
||||
<name>Form</name>
|
||||
<synonym>
|
||||
<key>en</key>
|
||||
<value>Form</value>
|
||||
</synonym>
|
||||
<usePurposes>PersonalComputer</usePurposes>
|
||||
<usePurposes>MobileDevice</usePurposes>
|
||||
</mdclass:CommonForm>
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<cmi:CommandInterface xmlns:cmi="http://g5.1c.ru/v8/dt/cmi"/>
|
@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:Configuration xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="94c92315-dfd3-4b19-a4fe-9ee7925c8d60">
|
||||
<name>StringLiteralCameCase</name>
|
||||
<synonym>
|
||||
<key>en</key>
|
||||
<value>String literal came case</value>
|
||||
</synonym>
|
||||
<containedObjects classId="9cd510cd-abfc-11d4-9434-004095e12fc7" objectId="8d8badc8-f461-497c-9189-c0507354369e"/>
|
||||
<containedObjects classId="9fcd25a0-4822-11d4-9414-008048da11f9" objectId="6ef8f846-54e6-40a4-856c-9782214c8982"/>
|
||||
<containedObjects classId="e3687481-0a87-462c-a166-9f34594f9bba" objectId="ad988dc7-f15d-4a34-9e4e-f62471f40a89"/>
|
||||
<containedObjects classId="9de14907-ec23-4a07-96f0-85521cb6b53b" objectId="89643dce-058f-4177-aa9d-9daed21804ca"/>
|
||||
<containedObjects classId="51f2d5d8-ea4d-4064-8892-82951750031e" objectId="9c307ce3-b9d4-4f5a-8b34-70bb92fb0c70"/>
|
||||
<containedObjects classId="e68182ea-4237-4383-967f-90c1e3370bc7" objectId="ee13ab61-9465-4ae4-968a-6f48042f3c14"/>
|
||||
<containedObjects classId="fb282519-d103-4dd3-bc12-cb271d631dfc" objectId="f97bce3c-b163-48cd-b81d-2c7f886fc2cf"/>
|
||||
<configurationExtensionCompatibilityMode>8.3.19</configurationExtensionCompatibilityMode>
|
||||
<defaultRunMode>ManagedApplication</defaultRunMode>
|
||||
<usePurposes>PersonalComputer</usePurposes>
|
||||
<usedMobileApplicationFunctionalities>
|
||||
<functionality>
|
||||
<use>true</use>
|
||||
</functionality>
|
||||
<functionality>
|
||||
<functionality>OSBackup</functionality>
|
||||
<use>true</use>
|
||||
</functionality>
|
||||
</usedMobileApplicationFunctionalities>
|
||||
<defaultLanguage>Language.English</defaultLanguage>
|
||||
<dataLockControlMode>Managed</dataLockControlMode>
|
||||
<objectAutonumerationMode>NotAutoFree</objectAutonumerationMode>
|
||||
<modalityUseMode>DontUse</modalityUseMode>
|
||||
<synchronousPlatformExtensionAndAddInCallUseMode>DontUse</synchronousPlatformExtensionAndAddInCallUseMode>
|
||||
<compatibilityMode>8.3.19</compatibilityMode>
|
||||
<languages uuid="1948febd-ba2a-4164-b1dd-d54b052e3660">
|
||||
<name>English</name>
|
||||
<synonym>
|
||||
<key>en</key>
|
||||
<value>English</value>
|
||||
</synonym>
|
||||
<languageCode>en</languageCode>
|
||||
</languages>
|
||||
<commonForms>CommonForm.Form</commonForms>
|
||||
</mdclass:Configuration>
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<cmi:CommandInterface xmlns:cmi="http://g5.1c.ru/v8/dt/cmi"/>
|
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>JoinToSubQuery</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
|
||||
<nature>com._1c.g5.v8.dt.core.V8ConfigurationNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
@ -0,0 +1,2 @@
|
||||
Manifest-Version: 1.0
|
||||
Runtime-Version: 8.3.19
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings"/>
|
@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form:Form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:form="http://g5.1c.ru/v8/dt/form" xmlns:schema="http://g5.1c.ru/v8/dt/data-composition-system/schema">
|
||||
<autoCommandBar>
|
||||
<name>FormCommandBar</name>
|
||||
<id>-1</id>
|
||||
<visible>true</visible>
|
||||
<enabled>true</enabled>
|
||||
<userVisible>
|
||||
<common>true</common>
|
||||
</userVisible>
|
||||
<horizontalAlign>Left</horizontalAlign>
|
||||
<autoFill>true</autoFill>
|
||||
</autoCommandBar>
|
||||
<autoTitle>true</autoTitle>
|
||||
<autoUrl>true</autoUrl>
|
||||
<group>Vertical</group>
|
||||
<autoFillCheck>true</autoFillCheck>
|
||||
<allowFormCustomize>true</allowFormCustomize>
|
||||
<enabled>true</enabled>
|
||||
<showTitle>true</showTitle>
|
||||
<showCloseButton>true</showCloseButton>
|
||||
<attributes>
|
||||
<name>List</name>
|
||||
<title>
|
||||
<key>en</key>
|
||||
<value>List</value>
|
||||
</title>
|
||||
<id>1</id>
|
||||
<valueType>
|
||||
<types>DynamicList</types>
|
||||
</valueType>
|
||||
<view>
|
||||
<common>true</common>
|
||||
</view>
|
||||
<edit>
|
||||
<common>true</common>
|
||||
</edit>
|
||||
<extInfo xsi:type="form:DynamicListExtInfo">
|
||||
<queryText>SELECT
|
||||
1 AS Field,
|
||||
NestedSelect.Field2,
|
||||
NestedSelect1.Field3
|
||||
FROM
|
||||
(SELECT
|
||||
2 AS Field2) AS NestedSelect
|
||||
LEFT JOIN (SELECT
|
||||
3 AS Field3) AS NestedSelect1
|
||||
ON NestedSelect.Field2 = NestedSelect1.Field3</queryText>
|
||||
<autoFillAvailableFields>true</autoFillAvailableFields>
|
||||
<customQuery>true</customQuery>
|
||||
<autoSaveUserSettings>true</autoSaveUserSettings>
|
||||
<getInvisibleFieldPresentations>true</getInvisibleFieldPresentations>
|
||||
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
|
||||
<dataPath>Field</dataPath>
|
||||
<field>Field</field>
|
||||
<title>
|
||||
<localValue>
|
||||
<content>
|
||||
<key>en</key>
|
||||
<value>Field</value>
|
||||
</content>
|
||||
</localValue>
|
||||
</title>
|
||||
</fields>
|
||||
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
|
||||
<dataPath>Field3</dataPath>
|
||||
<field>Field3</field>
|
||||
<title>
|
||||
<localValue>
|
||||
<content>
|
||||
<key>en</key>
|
||||
<value>Field3</value>
|
||||
</content>
|
||||
</localValue>
|
||||
</title>
|
||||
<role>
|
||||
<accountTypeExpression></accountTypeExpression>
|
||||
<balanceGroupName></balanceGroupName>
|
||||
<accountField></accountField>
|
||||
</role>
|
||||
</fields>
|
||||
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
|
||||
<dataPath>Field2</dataPath>
|
||||
<field>Field2</field>
|
||||
<title>
|
||||
<localValue>
|
||||
<content>
|
||||
<key>en</key>
|
||||
<value>Field2</value>
|
||||
</content>
|
||||
</localValue>
|
||||
</title>
|
||||
<role>
|
||||
<accountTypeExpression></accountTypeExpression>
|
||||
<balanceGroupName></balanceGroupName>
|
||||
<accountField></accountField>
|
||||
</role>
|
||||
</fields>
|
||||
</extInfo>
|
||||
</attributes>
|
||||
<commandInterface>
|
||||
<navigationPanel/>
|
||||
<commandBar/>
|
||||
</commandInterface>
|
||||
</form:Form>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonForm xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="f3f0ec83-a1b9-45f3-9eff-9ecdf12f23a8">
|
||||
<name>Form</name>
|
||||
<synonym>
|
||||
<key>en</key>
|
||||
<value>Form</value>
|
||||
</synonym>
|
||||
<usePurposes>PersonalComputer</usePurposes>
|
||||
<usePurposes>MobileDevice</usePurposes>
|
||||
</mdclass:CommonForm>
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<cmi:CommandInterface xmlns:cmi="http://g5.1c.ru/v8/dt/cmi"/>
|
@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:Configuration xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="94c92315-dfd3-4b19-a4fe-9ee7925c8d60">
|
||||
<name>StringLiteralCameCase</name>
|
||||
<synonym>
|
||||
<key>en</key>
|
||||
<value>String literal came case</value>
|
||||
</synonym>
|
||||
<containedObjects classId="9cd510cd-abfc-11d4-9434-004095e12fc7" objectId="8d8badc8-f461-497c-9189-c0507354369e"/>
|
||||
<containedObjects classId="9fcd25a0-4822-11d4-9414-008048da11f9" objectId="6ef8f846-54e6-40a4-856c-9782214c8982"/>
|
||||
<containedObjects classId="e3687481-0a87-462c-a166-9f34594f9bba" objectId="ad988dc7-f15d-4a34-9e4e-f62471f40a89"/>
|
||||
<containedObjects classId="9de14907-ec23-4a07-96f0-85521cb6b53b" objectId="89643dce-058f-4177-aa9d-9daed21804ca"/>
|
||||
<containedObjects classId="51f2d5d8-ea4d-4064-8892-82951750031e" objectId="9c307ce3-b9d4-4f5a-8b34-70bb92fb0c70"/>
|
||||
<containedObjects classId="e68182ea-4237-4383-967f-90c1e3370bc7" objectId="ee13ab61-9465-4ae4-968a-6f48042f3c14"/>
|
||||
<containedObjects classId="fb282519-d103-4dd3-bc12-cb271d631dfc" objectId="f97bce3c-b163-48cd-b81d-2c7f886fc2cf"/>
|
||||
<configurationExtensionCompatibilityMode>8.3.19</configurationExtensionCompatibilityMode>
|
||||
<defaultRunMode>ManagedApplication</defaultRunMode>
|
||||
<usePurposes>PersonalComputer</usePurposes>
|
||||
<usedMobileApplicationFunctionalities>
|
||||
<functionality>
|
||||
<use>true</use>
|
||||
</functionality>
|
||||
<functionality>
|
||||
<functionality>OSBackup</functionality>
|
||||
<use>true</use>
|
||||
</functionality>
|
||||
</usedMobileApplicationFunctionalities>
|
||||
<defaultLanguage>Language.English</defaultLanguage>
|
||||
<dataLockControlMode>Managed</dataLockControlMode>
|
||||
<objectAutonumerationMode>NotAutoFree</objectAutonumerationMode>
|
||||
<modalityUseMode>DontUse</modalityUseMode>
|
||||
<synchronousPlatformExtensionAndAddInCallUseMode>DontUse</synchronousPlatformExtensionAndAddInCallUseMode>
|
||||
<compatibilityMode>8.3.19</compatibilityMode>
|
||||
<languages uuid="1948febd-ba2a-4164-b1dd-d54b052e3660">
|
||||
<name>English</name>
|
||||
<synonym>
|
||||
<key>en</key>
|
||||
<value>English</value>
|
||||
</synonym>
|
||||
<languageCode>en</languageCode>
|
||||
</languages>
|
||||
<commonForms>CommonForm.Form</commonForms>
|
||||
</mdclass:Configuration>
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<cmi:CommandInterface xmlns:cmi="http://g5.1c.ru/v8/dt/cmi"/>
|
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>StringLiteralCameCase</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
|
||||
<nature>com._1c.g5.v8.dt.core.V8ConfigurationNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
@ -0,0 +1,2 @@
|
||||
Manifest-Version: 1.0
|
||||
Runtime-Version: 8.3.19
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings"/>
|
@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form:Form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:form="http://g5.1c.ru/v8/dt/form" xmlns:schema="http://g5.1c.ru/v8/dt/data-composition-system/schema">
|
||||
<autoCommandBar>
|
||||
<name>FormCommandBar</name>
|
||||
<id>-1</id>
|
||||
<visible>true</visible>
|
||||
<enabled>true</enabled>
|
||||
<userVisible>
|
||||
<common>true</common>
|
||||
</userVisible>
|
||||
<horizontalAlign>Left</horizontalAlign>
|
||||
<autoFill>true</autoFill>
|
||||
</autoCommandBar>
|
||||
<autoTitle>true</autoTitle>
|
||||
<autoUrl>true</autoUrl>
|
||||
<group>Vertical</group>
|
||||
<autoFillCheck>true</autoFillCheck>
|
||||
<allowFormCustomize>true</allowFormCustomize>
|
||||
<enabled>true</enabled>
|
||||
<showTitle>true</showTitle>
|
||||
<showCloseButton>true</showCloseButton>
|
||||
<attributes>
|
||||
<name>List</name>
|
||||
<title>
|
||||
<key>en</key>
|
||||
<value>List</value>
|
||||
</title>
|
||||
<id>1</id>
|
||||
<valueType>
|
||||
<types>DynamicList</types>
|
||||
</valueType>
|
||||
<view>
|
||||
<common>true</common>
|
||||
</view>
|
||||
<edit>
|
||||
<common>true</common>
|
||||
</edit>
|
||||
<extInfo xsi:type="form:DynamicListExtInfo">
|
||||
<queryText>SELECT
|
||||
"A+ 1" AS Field</queryText>
|
||||
<autoFillAvailableFields>true</autoFillAvailableFields>
|
||||
<customQuery>true</customQuery>
|
||||
<autoSaveUserSettings>true</autoSaveUserSettings>
|
||||
<getInvisibleFieldPresentations>true</getInvisibleFieldPresentations>
|
||||
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
|
||||
<dataPath>Field</dataPath>
|
||||
<field>Field</field>
|
||||
<title>
|
||||
<localValue>
|
||||
<content>
|
||||
<key>en</key>
|
||||
<value>Field</value>
|
||||
</content>
|
||||
</localValue>
|
||||
</title>
|
||||
<role>
|
||||
<accountTypeExpression></accountTypeExpression>
|
||||
<balanceGroupName></balanceGroupName>
|
||||
<accountField></accountField>
|
||||
</role>
|
||||
</fields>
|
||||
</extInfo>
|
||||
</attributes>
|
||||
<commandInterface>
|
||||
<navigationPanel/>
|
||||
<commandBar/>
|
||||
</commandInterface>
|
||||
</form:Form>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonForm xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="f3f0ec83-a1b9-45f3-9eff-9ecdf12f23a8">
|
||||
<name>Form</name>
|
||||
<synonym>
|
||||
<key>en</key>
|
||||
<value>Form</value>
|
||||
</synonym>
|
||||
<usePurposes>PersonalComputer</usePurposes>
|
||||
<usePurposes>MobileDevice</usePurposes>
|
||||
</mdclass:CommonForm>
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<cmi:CommandInterface xmlns:cmi="http://g5.1c.ru/v8/dt/cmi"/>
|
@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:Configuration xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="94c92315-dfd3-4b19-a4fe-9ee7925c8d60">
|
||||
<name>StringLiteralCameCase</name>
|
||||
<synonym>
|
||||
<key>en</key>
|
||||
<value>String literal came case</value>
|
||||
</synonym>
|
||||
<containedObjects classId="9cd510cd-abfc-11d4-9434-004095e12fc7" objectId="8d8badc8-f461-497c-9189-c0507354369e"/>
|
||||
<containedObjects classId="9fcd25a0-4822-11d4-9414-008048da11f9" objectId="6ef8f846-54e6-40a4-856c-9782214c8982"/>
|
||||
<containedObjects classId="e3687481-0a87-462c-a166-9f34594f9bba" objectId="ad988dc7-f15d-4a34-9e4e-f62471f40a89"/>
|
||||
<containedObjects classId="9de14907-ec23-4a07-96f0-85521cb6b53b" objectId="89643dce-058f-4177-aa9d-9daed21804ca"/>
|
||||
<containedObjects classId="51f2d5d8-ea4d-4064-8892-82951750031e" objectId="9c307ce3-b9d4-4f5a-8b34-70bb92fb0c70"/>
|
||||
<containedObjects classId="e68182ea-4237-4383-967f-90c1e3370bc7" objectId="ee13ab61-9465-4ae4-968a-6f48042f3c14"/>
|
||||
<containedObjects classId="fb282519-d103-4dd3-bc12-cb271d631dfc" objectId="f97bce3c-b163-48cd-b81d-2c7f886fc2cf"/>
|
||||
<configurationExtensionCompatibilityMode>8.3.19</configurationExtensionCompatibilityMode>
|
||||
<defaultRunMode>ManagedApplication</defaultRunMode>
|
||||
<usePurposes>PersonalComputer</usePurposes>
|
||||
<usedMobileApplicationFunctionalities>
|
||||
<functionality>
|
||||
<use>true</use>
|
||||
</functionality>
|
||||
<functionality>
|
||||
<functionality>OSBackup</functionality>
|
||||
<use>true</use>
|
||||
</functionality>
|
||||
</usedMobileApplicationFunctionalities>
|
||||
<defaultLanguage>Language.English</defaultLanguage>
|
||||
<dataLockControlMode>Managed</dataLockControlMode>
|
||||
<objectAutonumerationMode>NotAutoFree</objectAutonumerationMode>
|
||||
<modalityUseMode>DontUse</modalityUseMode>
|
||||
<synchronousPlatformExtensionAndAddInCallUseMode>DontUse</synchronousPlatformExtensionAndAddInCallUseMode>
|
||||
<compatibilityMode>8.3.19</compatibilityMode>
|
||||
<languages uuid="1948febd-ba2a-4164-b1dd-d54b052e3660">
|
||||
<name>English</name>
|
||||
<synonym>
|
||||
<key>en</key>
|
||||
<value>English</value>
|
||||
</synonym>
|
||||
<languageCode>en</languageCode>
|
||||
</languages>
|
||||
<commonForms>CommonForm.Form</commonForms>
|
||||
</mdclass:Configuration>
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<cmi:CommandInterface xmlns:cmi="http://g5.1c.ru/v8/dt/cmi"/>
|
@ -26,6 +26,7 @@
|
||||
<modules>
|
||||
<module>com.e1c.v8codestyle.md.itests</module>
|
||||
<module>com.e1c.v8codestyle.autosort.itests</module>
|
||||
<module>com.e1c.v8codestyle.ql.itests</module>
|
||||
</modules>
|
||||
|
||||
<profiles>
|
||||
|
Reference in New Issue
Block a user