jfx
Зеркало из https://github.com/openjdk/jfx
/
checkstyle.xml
213 строк · 7.9 Кб
1<?xml version="1.0"?>
2<!DOCTYPE module PUBLIC3"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"4"https://checkstyle.org/dtds/configuration_1_3.dtd">5
6<!--
7
8Checkstyle configuration that checks the sun coding conventions from:
9
10- the Java Language Specification at
11https://docs.oracle.com/javase/specs/jls/se11/html/index.html
12
13- the Sun Code Conventions at https://www.oracle.com/java/technologies/javase/codeconventions-contents.html
14
15- the Javadoc guidelines at
16https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
17
18- the JDK Api documentation https://docs.oracle.com/en/java/javase/11/
19
20- some best practices
21
22Checkstyle is very configurable. Be sure to read the documentation at
23https://checkstyle.org (or in your downloaded distribution).
24
25Most Checks are configurable, be sure to consult the documentation.
26
27To completely disable a check, just comment it out or delete it from the file.
28To suppress certain violations please review suppression filters.
29
30Finally, it is worth reading the documentation.
31
32-->
33
34<module name="Checker">35<!--36If you set the basedir property below, then all reported file
37names will be relative to the specified directory. See
38https://checkstyle.org/config.html#Checker
39
40<property name="basedir" value="${basedir}"/>
41-->
42<property name="severity" value="error"/>43
44<property name="fileExtensions" value="java, properties, xml"/>45
46<!-- Excludes all 'module-info.java' files -->47<!-- See https://checkstyle.org/config_filefilters.html -->48<module name="BeforeExecutionExclusionFileFilter">49<property name="fileNamePattern" value="module\-info\.java$"/>50</module>51
52<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->53<module name="SuppressionFilter">54<property name="file" value="${org.checkstyle.sun.suppressionfilter.config}"55default="checkstyle-suppressions.xml" />56<property name="optional" value="true"/>57</module>58
59<!-- Checks that a package-info.java file exists for each package. -->60<!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage -->61<module name="JavadocPackage"/>62
63<!-- Checks whether files end with a new line. -->64<!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->65<module name="NewlineAtEndOfFile"/>66
67<!-- Checks that property files contain the same keys. -->68<!-- See https://checkstyle.org/config_misc.html#Translation -->69<module name="Translation"/>70
71<!-- Checks for Size Violations. -->72<!-- See https://checkstyle.org/config_sizes.html -->73<module name="FileLength"/>74<module name="LineLength">75<property name="max" value="120"/>76<property name="fileExtensions" value="java"/>77</module>78
79<!-- Checks for whitespace -->80<!-- See https://checkstyle.org/config_whitespace.html -->81<module name="FileTabCharacter"/>82
83<!-- Miscellaneous other checks. -->84<!-- See https://checkstyle.org/config_misc.html -->85<module name="RegexpSingleline">86<property name="format" value="\s+$"/>87<property name="minimum" value="0"/>88<property name="maximum" value="0"/>89<property name="message" value="Line has trailing spaces."/>90</module>91
92<!-- Checks for Headers -->93<!-- See https://checkstyle.org/config_header.html -->94<!-- <module name="Header"> -->95<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->96<!-- <property name="fileExtensions" value="java"/> -->97<!-- </module> -->98
99<module name="TreeWalker">100
101<!-- Checks for Javadoc comments. -->102<!-- See https://checkstyle.org/config_javadoc.html -->103<module name="InvalidJavadocPosition"/>104<module name="JavadocMethod">105<property name="accessModifiers" value="public"/>106<property name="allowMissingParamTags" value="true"/>107</module>108<module name="JavadocType"/>109<module name="JavadocVariable">110<property name="scope" value="public"/>111</module>112<module name="JavadocStyle"/>113<!-- <module name="MissingJavadocMethod">-->
114<!-- <property name="scope" value="public"/>-->
115<!-- <property name="ignoreMethodNamesRegex" value="^test.*$"/>-->
116<!-- </module>-->
117
118<!-- Checks for Naming Conventions. -->119<!-- See https://checkstyle.org/config_naming.html -->120<module name="ConstantName"/>121<module name="LocalFinalVariableName"/>122<module name="LocalVariableName"/>123<module name="MemberName"/>124<module name="MethodName">125<property name="format" value="^[a-z_][a-zA-Z0-9]*$"/>126</module>127<module name="PackageName"/>128<module name="ParameterName"/>129<module name="StaticVariableName"/>130<module name="TypeName"/>131
132<!-- Checks for imports -->133<!-- See https://checkstyle.org/config_imports.html -->134<module name="AvoidStarImport"/>135<!-- <module name="IllegalImport"/> <!– defaults to sun.* packages –>-->
136<module name="RedundantImport"/>137<module name="UnusedImports">138<property name="processJavadoc" value="false"/>139</module>140
141<!-- Checks for Size Violations. -->142<!-- See https://checkstyle.org/config_sizes.html -->143<module name="MethodLength"/>144<module name="ParameterNumber">145<property name="max" value="20"/>146</module>147
148<!-- Checks for whitespace -->149<!-- See https://checkstyle.org/config_whitespace.html -->150<module name="EmptyForIteratorPad"/>151<module name="GenericWhitespace"/>152<module name="MethodParamPad"/>153<module name="NoWhitespaceAfter"/>154<module name="NoWhitespaceBefore"/>155<module name="OperatorWrap"/>156<module name="ParenPad"/>157<module name="TypecastParenPad"/>158<module name="WhitespaceAfter"/>159<module name="WhitespaceAround"/>160
161<!-- Modifier Checks -->162<!-- See https://checkstyle.org/config_modifier.html -->163<module name="ModifierOrder"/>164<module name="RedundantModifier"/>165
166<!-- Checks for blocks. You know, those {}'s -->167<!-- See https://checkstyle.org/config_blocks.html -->168<module name="AvoidNestedBlocks"/>169<module name="EmptyBlock"/>170<module name="LeftCurly"/>171<module name="NeedBraces"/>172<module name="RightCurly"/>173
174<!-- Checks for common coding problems -->175<!-- See https://checkstyle.org/config_coding.html -->176<module name="EmptyStatement"/>177<module name="EqualsHashCode"/>178<module name="HiddenField">179<property name="tokens" value="VARIABLE_DEF, PATTERN_VARIABLE_DEF, LAMBDA, RECORD_COMPONENT_DEF"/>180</module>181<module name="IllegalInstantiation"/>182<module name="InnerAssignment"/>183<!-- <module name="MagicNumber"/>-->
184<module name="MissingSwitchDefault"/>185<module name="MultipleVariableDeclarations"/>186<module name="SimplifyBooleanExpression"/>187<module name="SimplifyBooleanReturn"/>188
189<!-- Checks for class design -->190<!-- See https://checkstyle.org/config_design.html -->191<module name="DesignForExtension"/>192<module name="FinalClass"/>193<module name="HideUtilityClassConstructor"/>194<module name="InterfaceIsType"/>195<module name="VisibilityModifier"/>196
197<!-- Miscellaneous other checks. -->198<!-- See https://checkstyle.org/config_misc.html -->199<module name="ArrayTypeStyle"/>200<!-- <module name="FinalParameters"/>-->
201<module name="TodoComment"/>202<module name="UpperEll"/>203
204<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->205<module name="SuppressionXpathFilter">206<property name="file" value="${org.checkstyle.sun.suppressionxpathfilter.config}"207default="checkstyle-xpath-suppressions.xml" />208<property name="optional" value="true"/>209</module>210
211</module>212
213</module>214