Skip to content

Commit cfcfa1b

Browse files
committed
#24 Add checksytle to the build and fix the current violations
1 parent 6294205 commit cfcfa1b

File tree

12 files changed

+483
-147
lines changed

12 files changed

+483
-147
lines changed

build-config/pom.xml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright 2012-2015 Gunnar Morling (http://www.gunnarmorling.de/)
5+
and/or other contributors as indicated by the @authors tag. See the
6+
copyright.txt file in the distribution for a full listing of all
7+
contributors.
8+
9+
Licensed under the Apache License, Version 2.0 (the "License");
10+
you may not use this file except in compliance with the License.
11+
You may obtain a copy of the License at
12+
13+
http://www.apache.org/licenses/LICENSE-2.0
14+
15+
Unless required by applicable law or agreed to in writing, software
16+
distributed under the License is distributed on an "AS IS" BASIS,
17+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
See the License for the specific language governing permissions and
19+
limitations under the License.
20+
21+
-->
22+
<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">
23+
<modelVersion>4.0.0</modelVersion>
24+
25+
<parent>
26+
<groupId>org.mapstruct</groupId>
27+
<artifactId>mapstruct-eclipse-parent</artifactId>
28+
<version>0.1.0-SNAPSHOT</version>
29+
<relativePath>../parent/pom.xml</relativePath>
30+
</parent>
31+
32+
<artifactId>mapstruct-eclipse-build-config</artifactId>
33+
<packaging>jar</packaging>
34+
<name>MapStruct Eclipse Plugin Build Configuration</name>
35+
36+
<build>
37+
<plugins>
38+
<plugin>
39+
<groupId>org.apache.maven.plugins</groupId>
40+
<artifactId>maven-deploy-plugin</artifactId>
41+
<configuration>
42+
<skip>true</skip>
43+
</configuration>
44+
</plugin>
45+
</plugins>
46+
</build>
47+
</project>
Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
<?xml version="1.0"?>
2+
3+
<!DOCTYPE module PUBLIC
4+
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
5+
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
6+
7+
<!-- Based on sun_checks.xml from the CheckStyle distribution -->
8+
9+
<module name="Checker">
10+
<!--
11+
If you set the basedir property below, then all reported file
12+
names will be relative to the specified directory. See
13+
http://checkstyle.sourceforge.net/5.x/config.html#Checker
14+
15+
<property name="basedir" value="${basedir}"/>
16+
-->
17+
18+
<!-- Checks that each Java package has a Javadoc file used for commenting. -->
19+
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
20+
<!--
21+
<module name="JavadocPackage">
22+
<property name="allowLegacy" value="true"/>
23+
</module>
24+
-->
25+
26+
<!-- Checks that property files contain the same keys. -->
27+
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
28+
<module name="Translation"/>
29+
30+
<module name="FileLength"/>
31+
32+
<!-- Following interprets the header file as regular expressions. -->
33+
<!-- <module name="RegexpHeader"/> -->
34+
35+
<module name="FileTabCharacter">
36+
<property name="eachLine" value="true"/>
37+
</module>
38+
39+
<!-- Not using NewLineAtEndOfFile as it doesn't work across all platforms
40+
in conjunction with git's automatic handling of line endings. This rule fails
41+
if there is a non-whitespace character at the end of the file; Together with
42+
the next rule which forbids trailing whitespace characters this enforces a
43+
new line at the end of the file -->
44+
<module name="RegexpMultiline">
45+
<property name="format" value="\S\z" />
46+
<property name="message" value="There is no new line at the end of file" />
47+
</module>
48+
49+
<module name="RegexpSingleline">
50+
<!-- \s matches whitespace character, $ matches end of line. -->
51+
<property name="format" value="\s+$"/>
52+
<property name="message" value="Line has trailing spaces"/>
53+
</module>
54+
55+
<module name="RegexpSingleline">
56+
<!-- do not allow a package declaration that contains ".target." or "target;" -->
57+
<property name="format" value="^package .*\.target[\.;]"/>
58+
<property name="message" value="Do not use &quot;target&quot; as package name element"/>
59+
</module>
60+
61+
<module name="TreeWalker">
62+
63+
<property name="cacheFile" value="${checkstyle.cache.file}"/>
64+
65+
<!-- Required for SuppressionCommentFilter -->
66+
<module name="FileContentsHolder"/>
67+
<module name="SuppressWarningsHolder"/>
68+
69+
<!-- Checks for Javadoc comments. -->
70+
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
71+
<!-- <module name="JavadocMethod"/> -->
72+
<!-- <module name="JavadocType"/> -->
73+
<!-- <module name="JavadocVariable"/> -->
74+
<!-- <module name="JavadocStyle"/> -->
75+
76+
77+
<!-- Checks for Naming Conventions. -->
78+
<!-- See http://checkstyle.sf.net/config_naming.html -->
79+
<module name="ConstantName"/>
80+
<module name="LocalFinalVariableName"/>
81+
<module name="LocalVariableName"/>
82+
<module name="MemberName"/>
83+
<module name="MethodName"/>
84+
<module name="PackageName"/>
85+
<module name="ParameterName"/>
86+
<module name="StaticVariableName"/>
87+
<module name="TypeName"/>
88+
89+
90+
<!-- Checks for Headers -->
91+
<!-- See http://checkstyle.sf.net/config_header.html -->
92+
<!-- <module name="Header"> -->
93+
<!-- The follow property value demonstrates the ability -->
94+
<!-- to have access to ANT properties. In this case it uses -->
95+
<!-- the ${basedir} property to allow Checkstyle to be run -->
96+
<!-- from any directory within a project. See property -->
97+
<!-- expansion, -->
98+
<!-- http://checkstyle.sf.net/config.html#properties -->
99+
<!-- <property -->
100+
<!-- name="headerFile" -->
101+
<!-- value="${basedir}/java.header"/> -->
102+
<!-- </module> -->
103+
104+
105+
<!-- Checks for imports -->
106+
<!-- See http://checkstyle.sf.net/config_import.html -->
107+
<module name="AvoidStarImport"/>
108+
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
109+
<module name="RedundantImport"/>
110+
<module name="UnusedImports">
111+
<property name="processJavadoc" value="true"/>
112+
</module>
113+
114+
115+
<!-- Checks for Size Violations. -->
116+
<!-- See http://checkstyle.sf.net/config_sizes.html -->
117+
<module name="LineLength">
118+
<property name="max" value="120"/>
119+
</module>
120+
<module name="MethodLength"/>
121+
<module name="ParameterNumber">
122+
<property name="max" value="10"/>
123+
</module>
124+
125+
126+
<!-- Checks for whitespace -->
127+
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
128+
<module name="EmptyForIteratorPad">
129+
<property name="option" value="space" />
130+
</module>
131+
<module name="MethodParamPad"/>
132+
<module name="NoWhitespaceAfter">
133+
<property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS"/>
134+
</module>
135+
<module name="NoWhitespaceBefore"/>
136+
<!-- <module name="OperatorWrap"/> -->
137+
<module name="ParenPad">
138+
<property name="tokens" value="CTOR_CALL, METHOD_CALL, SUPER_CTOR_CALL"/>
139+
<property name="option" value="space"/>
140+
</module>
141+
<module name="TypecastParenPad"/>
142+
<module name="WhitespaceAfter"/>
143+
<module name="WhitespaceAround"/>
144+
145+
146+
<!-- Modifier Checks -->
147+
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
148+
<module name="ModifierOrder"/>
149+
<module name="RedundantModifier"/>
150+
151+
152+
<!-- Checks for blocks. You know, those {}'s -->
153+
<!-- See http://checkstyle.sf.net/config_blocks.html -->
154+
<module name="AvoidNestedBlocks"/>
155+
<module name="EmptyBlock"/>
156+
<module name="LeftCurly"/>
157+
<module name="NeedBraces"/>
158+
<module name="RightCurly">
159+
<property name="option" value="alone"/>
160+
</module>
161+
162+
163+
<!-- Checks for common coding problems -->
164+
<!-- See http://checkstyle.sf.net/config_coding.html -->
165+
<!-- <module name="AvoidInlineConditionals"/> -->
166+
<module name="EmptyStatement"/>
167+
<module name="EqualsHashCode"/>
168+
<!-- <module name="HiddenField"/> -->
169+
<module name="IllegalInstantiation"/>
170+
<module name="InnerAssignment"/>
171+
<!-- <module name="MagicNumber"/> -->
172+
<module name="MissingSwitchDefault"/>
173+
<!-- <module name="RedundantThrows"/> -->
174+
<module name="SimplifyBooleanExpression"/>
175+
<module name="SimplifyBooleanReturn"/>
176+
177+
178+
<!-- Checks for class design -->
179+
<!-- See http://checkstyle.sf.net/config_design.html -->
180+
<!-- <module name="DesignForExtension"/> -->
181+
<!-- <module name="FinalClass"/> -->
182+
<module name="HideUtilityClassConstructor"/>
183+
<module name="InterfaceIsType"/>
184+
<module name="VisibilityModifier">
185+
<property name="packageAllowed" value="true" />
186+
<property name="protectedAllowed" value="true" />
187+
</module>
188+
189+
190+
<!-- Miscellaneous other checks. -->
191+
<!-- See http://checkstyle.sf.net/config_misc.html -->
192+
<module name="ArrayTypeStyle"/>
193+
<!-- <module name="FinalParameters"/> -->
194+
<!-- <module name="TodoComment"/> -->
195+
<module name="UpperEll"/>
196+
197+
</module>
198+
199+
<module name="SuppressionCommentFilter"/>
200+
<module name="SuppressWarningsFilter"/>
201+
202+
</module>

org.mapstruct.eclipse.feature/pom.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@
2020
2121
-->
2222
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
23+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2424

25-
<modelVersion>4.0.0</modelVersion>
25+
<modelVersion>4.0.0</modelVersion>
2626

27-
<parent>
28-
<groupId>org.mapstruct</groupId>
29-
<artifactId>mapstruct-eclipse-parent</artifactId>
30-
<version>0.1.0-SNAPSHOT</version>
31-
<relativePath>../parent/pom.xml</relativePath>
32-
</parent>
27+
<parent>
28+
<groupId>org.mapstruct</groupId>
29+
<artifactId>mapstruct-eclipse-parent</artifactId>
30+
<version>0.1.0-SNAPSHOT</version>
31+
<relativePath>../parent/pom.xml</relativePath>
32+
</parent>
3333

34-
<artifactId>org.mapstruct.eclipse.feature</artifactId>
35-
<packaging>eclipse-feature</packaging>
34+
<artifactId>org.mapstruct.eclipse.feature</artifactId>
35+
<packaging>eclipse-feature</packaging>
3636

37-
<name>MapStruct Eclipse feature</name>
37+
<name>MapStruct Eclipse feature</name>
3838

3939
</project>

org.mapstruct.eclipse.repository/pom.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@
2020
2121
-->
2222
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
23+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2424

25-
<modelVersion>4.0.0</modelVersion>
25+
<modelVersion>4.0.0</modelVersion>
2626

27-
<parent>
28-
<groupId>org.mapstruct</groupId>
29-
<artifactId>mapstruct-eclipse-parent</artifactId>
30-
<version>0.1.0-SNAPSHOT</version>
31-
<relativePath>../parent/pom.xml</relativePath>
32-
</parent>
27+
<parent>
28+
<groupId>org.mapstruct</groupId>
29+
<artifactId>mapstruct-eclipse-parent</artifactId>
30+
<version>0.1.0-SNAPSHOT</version>
31+
<relativePath>../parent/pom.xml</relativePath>
32+
</parent>
3333

34-
<artifactId>org.mapstruct.eclipse.repository</artifactId>
35-
<packaging>eclipse-repository</packaging>
34+
<artifactId>org.mapstruct.eclipse.repository</artifactId>
35+
<packaging>eclipse-repository</packaging>
3636

37-
<name>MapStruct Eclipse repository</name>
37+
<name>MapStruct Eclipse repository</name>
3838

3939
</project>

org.mapstruct.eclipse/pom.xml

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,40 @@
2020
2121
-->
2222
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24-
25-
<modelVersion>4.0.0</modelVersion>
26-
27-
<parent>
28-
<groupId>org.mapstruct</groupId>
29-
<artifactId>mapstruct-eclipse-parent</artifactId>
30-
<version>0.1.0-SNAPSHOT</version>
31-
<relativePath>../parent/pom.xml</relativePath>
32-
</parent>
33-
34-
<artifactId>org.mapstruct.eclipse</artifactId>
35-
<packaging>eclipse-plugin</packaging>
36-
37-
<name>MapStruct Eclipse plug-in</name>
38-
23+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24+
25+
<modelVersion>4.0.0</modelVersion>
26+
27+
<parent>
28+
<groupId>org.mapstruct</groupId>
29+
<artifactId>mapstruct-eclipse-parent</artifactId>
30+
<version>0.1.0-SNAPSHOT</version>
31+
<relativePath>../parent/pom.xml</relativePath>
32+
</parent>
33+
34+
<artifactId>org.mapstruct.eclipse</artifactId>
35+
<packaging>eclipse-plugin</packaging>
36+
37+
<name>MapStruct Eclipse plug-in</name>
38+
39+
<build>
40+
<plugins>
41+
<plugin>
42+
<groupId>org.apache.maven.plugins</groupId>
43+
<artifactId>maven-checkstyle-plugin</artifactId>
44+
<configuration>
45+
<sourceDirectory>src</sourceDirectory>
46+
</configuration>
47+
<executions>
48+
<execution>
49+
<id>check-style</id>
50+
<phase>verify</phase>
51+
<goals>
52+
<goal>checkstyle</goal>
53+
</goals>
54+
</execution>
55+
</executions>
56+
</plugin>
57+
</plugins>
58+
</build>
3959
</project>

org.mapstruct.eclipse/src/org/mapstruct/eclipse/internal/Bindings.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
*/
3333
public class Bindings {
3434

35+
private Bindings() {
36+
}
37+
3538
/**
3639
* @param type the type
3740
* @return the method names declared in the class or a super type of it

0 commit comments

Comments
 (0)