Skip to content

Commit 10e66f9

Browse files
authored
adjust checkstyle to disallow crlf (#7)
* 1. adjust checkstyle to disallow crlf 2. add debug core to manifest. Signed-off-by: andxu <andxu@microsoft.com>
1 parent 7217d80 commit 10e66f9

File tree

4 files changed

+72
-55
lines changed

4 files changed

+72
-55
lines changed

check_style.xml

Lines changed: 59 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<!DOCTYPE module PUBLIC
3-
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4-
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
3+
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4+
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
55

66
<!--
77
Checkstyle configuration that checks the Google coding conventions from Google Java Style
@@ -15,25 +15,31 @@
1515
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
1616
-->
1717

18-
<module name = "Checker">
18+
<module name="Checker">
1919
<property name="charset" value="UTF-8"/>
2020

2121
<property name="fileExtensions" value="java, properties, xml"/>
2222
<module name="RegexpHeader">
23-
<property name="headerFile" value="${basedir}/microsoft.header" />
23+
<property name="headerFile" value="${basedir}/microsoft.header"/>
2424
</module>
25-
<!-- Checks for whitespace -->
26-
<!-- See http://checkstyle.sf.net/config_whitespace.html
27-
<module name="FileTabCharacter">
28-
<property name="eachLine" value="true"/>
29-
</module>
30-
-->
25+
<!-- Checks for whitespace -->
26+
<!-- See http://checkstyle.sf.net/config_whitespace.html
27+
<module name="FileTabCharacter">
28+
<property name="eachLine" value="true"/>
29+
</module>
30+
-->
3131
<!-- No trailing spaces allowed -->
3232
<module name="RegexpSingleline">
3333
<property name="format" value="\s+$"/>
3434
<property name="message" value="Line has trailing spaces."/>
3535
</module>
3636

37+
<!-- CRLF is not allowed -->
38+
<module name="RegexpMultiline">
39+
<property name="format" value="(?s:(\r\n|\r).*)"/>
40+
<property name="message" value="CRLF and CR line endings are prohibited, but this file uses them."/>
41+
</module>
42+
3743
<module name="TreeWalker">
3844
<!-- Default CheckStyle Whitespace rules seem reasonable to use. -->
3945
<module name="EmptyForIteratorPad"/>
@@ -59,25 +65,27 @@
5965
<module name="NeedBraces"/>
6066
<module name="RightCurly"/>
6167

62-
<!-- Added some coding problems as INFO. Up to developer to react to them. -->
68+
<!-- Added some coding problems as INFO. Up to developer to react to them. -->
6369
<module name="CovariantEquals">
64-
<property name="severity" value="info" />
70+
<property name="severity" value="info"/>
6571
</module>
6672
<!-- Only apply this to local variables; Designers seem to prefer using same parameter names as class members. -->
6773
<module name="HiddenField">
6874
<property name="tokens" value="VARIABLE_DEF"/>
6975
</module>
7076

7177
<!-- No multiple assignement in a single line. -->
72-
<module name="InnerAssignment" />
78+
<module name="InnerAssignment"/>
7379

74-
<module name="UnusedImports" />
80+
<module name="UnusedImports"/>
7581

7682
<module name="OuterTypeFilename"/>
7783
<module name="IllegalTokenText">
7884
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
79-
<property name="format" value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
80-
<property name="message" value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
85+
<property name="format"
86+
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
87+
<property name="message"
88+
value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
8189
</module>
8290
<module name="AvoidEscapedUnicodeCharacters">
8391
<property name="allowEscapesForControlCharacters" value="true"/>
@@ -101,22 +109,24 @@
101109
</module>
102110
<module name="RightCurly">
103111
<property name="id" value="RightCurlySame"/>
104-
<property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
112+
<property name="tokens"
113+
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
105114
</module>
106115
<module name="RightCurly">
107116
<property name="id" value="RightCurlyAlone"/>
108117
<property name="option" value="alone"/>
109-
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
118+
<property name="tokens"
119+
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
110120
</module>
111121
<module name="WhitespaceAround">
112122
<property name="allowEmptyConstructors" value="true"/>
113123
<property name="allowEmptyMethods" value="true"/>
114124
<property name="allowEmptyTypes" value="true"/>
115125
<property name="allowEmptyLoops" value="true"/>
116126
<message key="ws.notFollowed"
117-
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
118-
<message key="ws.notPreceded"
119-
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
127+
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
128+
<message key="ws.notPreceded"
129+
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
120130
</module>
121131
<module name="OneStatementPerLine"/>
122132
<module name="MultipleVariableDeclarations"/>
@@ -146,58 +156,58 @@
146156
<module name="PackageName">
147157
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
148158
<message key="name.invalidPattern"
149-
value="Package name ''{0}'' must match pattern ''{1}''."/>
159+
value="Package name ''{0}'' must match pattern ''{1}''."/>
150160
</module>
151161
<module name="TypeName">
152162
<message key="name.invalidPattern"
153-
value="Type name ''{0}'' must match pattern ''{1}''."/>
163+
value="Type name ''{0}'' must match pattern ''{1}''."/>
154164
</module>
155165
<module name="MemberName">
156166
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
157167
<message key="name.invalidPattern"
158-
value="Member name ''{0}'' must match pattern ''{1}''."/>
168+
value="Member name ''{0}'' must match pattern ''{1}''."/>
159169
</module>
160170
<module name="ParameterName">
161171
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
162172
<message key="name.invalidPattern"
163-
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
173+
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
164174
</module>
165175
<module name="CatchParameterName">
166176
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
167177
<message key="name.invalidPattern"
168-
value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
178+
value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
169179
</module>
170180
<module name="LocalVariableName">
171181
<property name="tokens" value="VARIABLE_DEF"/>
172182
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
173183
<message key="name.invalidPattern"
174-
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
184+
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
175185
</module>
176186
<module name="ClassTypeParameterName">
177187
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
178188
<message key="name.invalidPattern"
179-
value="Class type name ''{0}'' must match pattern ''{1}''."/>
189+
value="Class type name ''{0}'' must match pattern ''{1}''."/>
180190
</module>
181191
<module name="MethodTypeParameterName">
182192
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
183193
<message key="name.invalidPattern"
184-
value="Method type name ''{0}'' must match pattern ''{1}''."/>
194+
value="Method type name ''{0}'' must match pattern ''{1}''."/>
185195
</module>
186196
<module name="InterfaceTypeParameterName">
187197
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
188198
<message key="name.invalidPattern"
189-
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
199+
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
190200
</module>
191201
<module name="NoFinalizer"/>
192202
<module name="GenericWhitespace">
193203
<message key="ws.followed"
194-
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
195-
<message key="ws.preceded"
196-
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
197-
<message key="ws.illegalFollow"
198-
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
199-
<message key="ws.notPreceded"
200-
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
204+
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
205+
<message key="ws.preceded"
206+
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
207+
<message key="ws.illegalFollow"
208+
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
209+
<message key="ws.notPreceded"
210+
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
201211
</module>
202212
<module name="Indentation">
203213
<property name="basicOffset" value="4"/>
@@ -210,18 +220,19 @@
210220
<module name="OverloadMethodsDeclarationOrder"/>
211221
<module name="VariableDeclarationUsageDistance"/>
212222
<module name="CustomImportOrder">
213-
<property name="customImportOrderRules"
214-
value="STATIC###STANDARD_JAVA_PACKAGE###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE"/>
215-
<property name="specialImportsRegExp" value="^org\."/>
216-
<property name="thirdPartyPackageRegExp" value="^com\."/>
217-
<property name="sortImportsInGroupAlphabetically" value="true"/>
218-
<property name="separateLineBetweenGroups" value="true"/>
223+
<property name="customImportOrderRules"
224+
value="STATIC###STANDARD_JAVA_PACKAGE###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE"/>
225+
<property name="specialImportsRegExp" value="^org\."/>
226+
<property name="thirdPartyPackageRegExp" value="^com\."/>
227+
<property name="sortImportsInGroupAlphabetically" value="true"/>
228+
<property name="separateLineBetweenGroups" value="true"/>
219229
</module>
220230
<module name="MethodParamPad"/>
221231
<module name="ParenPad"/>
222232
<module name="OperatorWrap">
223233
<property name="option" value="NL"/>
224-
<property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
234+
<property name="tokens"
235+
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
225236
</module>
226237
<module name="AnnotationLocation">
227238
<property name="id" value="AnnotationLocationMostCases"/>
@@ -235,7 +246,8 @@
235246
<module name="NonEmptyAtclauseDescription"/>
236247
<module name="JavadocTagContinuationIndentation"/>
237248
<module name="SummaryJavadoc">
238-
<property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
249+
<property name="forbiddenSummaryFragments"
250+
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
239251
</module>
240252
<module name="JavadocParagraph"/>
241253
<module name="AtclauseOrder">
@@ -254,7 +266,7 @@
254266
<module name="MethodName">
255267
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
256268
<message key="name.invalidPattern"
257-
value="Method name ''{0}'' must match pattern ''{1}''."/>
269+
value="Method name ''{0}'' must match pattern ''{1}''."/>
258270
</module>
259271
<module name="SingleLineJavadoc">
260272
<property name="ignoreInlineTags" value="false"/>
@@ -264,6 +276,6 @@
264276
</module>
265277
<module name="CommentsIndentation"/>
266278
<module name="EmptyStatement"/>
267-
<module name="StringLiteralEquality" />
279+
<module name="StringLiteralEquality"/>
268280
</module>
269281
</module>

com.microsoft.java.debug.plugin/META-INF/MANIFEST.MF

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.12.0",
1818
Bundle-ClassPath: lib/gson-2.7.jar,
1919
.,
2020
lib/rxjava-2.1.1.jar,
21-
lib/reactive-streams-1.0.0.jar
21+
lib/reactive-streams-1.0.0.jar,
22+
lib/com.microsoft.java.debug.core-0.1.0-SNAPSHOT.jar
2223

com.microsoft.java.debug.plugin/pom.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55
<parent>
66
<groupId>com.microsoft.java</groupId>
@@ -49,10 +49,6 @@
4949
</artifactItems>
5050
</configuration>
5151
</plugin>
52-
<plugin>
53-
<groupId>org.apache.maven.plugins</groupId>
54-
<artifactId>maven-checkstyle-plugin</artifactId>
55-
</plugin>
5652
</plugins>
5753
</build>
58-
</project>
54+
</project>

pom.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.microsoft.java</groupId>
55
<artifactId>parent</artifactId>
@@ -94,6 +94,14 @@
9494
<failOnViolation>true</failOnViolation>
9595
</configuration>
9696
</plugin>
97+
<plugin>
98+
<groupId>org.eclipse.tycho</groupId>
99+
<artifactId>target-platform-configuration</artifactId>
100+
<version>${tycho-version}</version>
101+
<configuration>
102+
<pomDependencies>consider</pomDependencies>
103+
</configuration>
104+
</plugin>
97105
</plugins>
98106
</pluginManagement>
99107
</build>

0 commit comments

Comments
 (0)