1- <?xml version =" 1.0" ?>
2- <!DOCTYPE module PUBLIC
3- "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4- "https://checkstyle.org/dtds/configuration_1_3.dtd">
5-
6- <!--
1+ <?xml version =" 1.0" encoding =" UTF-8" standalone =" no" ?><!--
72 Palantir Baseline Checkstyle configuration.
83 Authors: Robert Fink, Brian Worth, Merrick Zoubeiri, and many other contributors. Based in part on http://checkstyle.sourceforge.net/google_style.html
94 Please keep checks alphabetized with one exception: "relaxed" checks are grouped together at the bottom for easier disabling.
105 Check-specific comments reference documents internal to Palantir and can be safely ignored or removed.
11- -->
12-
6+ --> <!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
137<module name =" Checker" >
148 <property name =" charset" value =" UTF-8" />
159 <property name =" severity" value =" error" />
4741 <module name =" BeforeExecutionExclusionFileFilter" >
4842 <property name =" fileNamePattern" value =" module\-info\.java$" />
4943 </module >
44+ <module name =" LineLength" > <!-- Java Style Guide: No line-wrapping -->
45+ <property name =" max" value =" 120" />
46+ <property name =" ignorePattern" value =" ^package.*|^import.*|a href|href|http://|https://|ftp://" />
47+ </module >
5048 <module name =" TreeWalker" >
5149 <module name =" SuppressionCommentFilter" /> <!-- baseline-gradle: README.md -->
5250 <module name =" SuppressionCommentFilter" >
6563 <property name =" tokens" value =" VARIABLE_DEF" />
6664 <property name =" allowSamelineMultipleAnnotations" value =" true" />
6765 </module >
68- <module name =" AnnotationUseStyle" /> <!-- Java Style Guide: Annotations -->
66+ <module name =" AnnotationUseStyle" > <!-- Java Style Guide: Annotations -->
67+ <property name =" trailingArrayComma" value =" ignore" />
68+ </module >
6969 <module name =" ArrayTypeStyle" /> <!-- Java Style Guide: No C-style array declarations -->
7070 <module name =" AvoidEscapedUnicodeCharacters" > <!-- Java Style Guide: Non-ASCII characters -->
7171 <property name =" allowEscapesForControlCharacters" value =" true" />
7777 </module >
7878 <module name =" AvoidStarImport" /> <!-- Java Style Guide: No wildcard imports -->
7979 <module name =" AvoidStaticImport" > <!-- Java Style Guide: No static imports -->
80- <property name =" excludes" value ="
81- com.google.common.base.Preconditions.*,
82- com.palantir.logsafe.Preconditions.*,
83- java.util.Collections.*,
84- java.util.stream.Collectors.*,
85- org.apache.commons.lang3.Validate.*,
86- org.assertj.core.api.Assertions.*,
87- org.mockito.Mockito.*" />
80+ <property name =" excludes" value =" com.google.common.base.Preconditions.*, com.palantir.logsafe.Preconditions.*, java.util.Collections.*, java.util.stream.Collectors.*, org.apache.commons.lang3.Validate.*, org.assertj.core.api.Assertions.*, org.mockito.Mockito.*" />
8881 </module >
8982 <module name =" ClassTypeParameterName" > <!-- Java Style Guide: Type variable names -->
9083 <property name =" format" value =" (^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)" />
134127 <module name =" IllegalImport" > <!-- Java Coding Guidelines: Import the canonical package -->
135128 <property name =" id" value =" BanShadedClasses" />
136129 <property name =" illegalPkgs" value =" .*\.(repackaged|shaded|thirdparty)" />
137- <property name =" regexp" value =" true" />
130+ <property name =" regexp" value =" true" />
138131 <message key =" import.illegal" value =" Must not import repackaged classes." />
139132 </module >
140133 <module name =" IllegalImport" >
141134 <property name =" illegalPkgs" value =" ^org\.gradle\.(internal|.*\.internal)" />
142- <property name =" regexp" value =" true" />
135+ <property name =" regexp" value =" true" />
143136 <message key =" import.illegal" value =" Do not rely on gradle internal classes as these may change in minor releases - use org.gradle.api versions instead." />
144137 </module >
145138 <module name =" IllegalImport" >
192185 <property name =" separated" value =" true" />
193186 <property name =" sortStaticImportsAlphabetically" value =" true" />
194187 </module >
188+
195189 <module name =" InnerAssignment" /> <!-- Java Coding Guidelines: Inner assignments: Not used -->
196- <module name =" LineLength" > <!-- Java Style Guide: No line-wrapping -->
197- <property name =" max" value =" 120" />
198- <property name =" ignorePattern" value =" ^package.*|^import.*|a href|href|http://|https://|ftp://" />
199- </module >
190+ <!-- Java Style Guide: Nonempty blocks: K & R style -->
200191 <module name =" MemberName" > <!-- Java Style Guide: Non-constant field names -->
201192 <property name =" format" value =" ^[a-z][a-zA-Z0-9]+$" />
202193 <message key =" name.invalidPattern" value =" Member name ''{0}'' must match pattern ''{1}''." />
237228 <message key =" name.invalidPattern" value =" Package name ''{0}'' must match pattern ''{1}''." />
238229 </module >
239230 <module name =" ParameterAssignment" /> <!-- Java Coding Guidelines: Final variables and parameters -->
231+ <!-- Java Style Guide: Horizontal whitespace -->
240232 <module name =" RedundantImport" /> <!-- Java Style Guide: No unused imports -->
241233 <module name =" RedundantModifier" /> <!-- Java Coding Guidelines: Avoid redundant modifiers -->
242234 <module name =" RegexpSinglelineJava" > <!-- Java Coding Guidelines: Use appropriate assertion methods -->
352344 </module >
353345 <module name =" RegexpSinglelineJava" >
354346 <property name =" format" value =" \bCharset.defaultCharset\(" />
355- <property name =" message" value =" Use explicit charset (e.g. StandardCharsets.UTF-8 ) instead of default." />
347+ <property name =" message" value =" Use explicit charset (e.g. StandardCharsets.UTF_8 ) instead of default." />
356348 </module >
357349 <module name =" RegexpSinglelineJava" >
358350 <property name =" format" value =" \bIOUtils\.toString\(" />
361353 <module name =" RegexpSinglelineJava" >
362354 <property name =" format" value =" \/\/TODO|\/\/ TODO(?!\([^()\s]+\): )" />
363355 <property name =" message" value =" TODO format: // TODO(#issue): explanation" />
356+ <property name =" ignoreCase" value =" true" />
364357 </module >
365358 <module name =" RegexpSinglelineJava" >
366359 <property name =" format" value =" (void setUp\(\))|(void setup\(\))|(void setupStatic\(\))|(void setUpStatic\(\))|(void beforeTest\(\))|(void teardown\(\))|(void tearDown\(\))|(void beforeStatic\(\))|(void afterStatic\(\))" />
367360 <property name =" message" value =" Test setup/teardown methods are called before(), beforeClass(), after(), afterClass(), but not setUp, teardown, etc." />
368361 </module >
369362 <module name =" RightCurly" > <!-- Java Style Guide: Nonempty blocks: K & R style -->
370363 <property name =" option" value =" same" />
371- <property name =" tokens" value =" LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO" />
364+ <property name =" tokens" value =" CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO" />
372365 </module >
373366 <module name =" RightCurly" > <!-- Java Style Guide: Nonempty blocks: K & R style -->
374367 <property name =" option" value =" alone" />
375- <property name =" tokens" value =" CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT" />
368+ <property name =" tokens" value =" LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT" />
376369 </module >
377370 <module name =" SeparatorWrap" > <!-- Java Style Guide: Where to break -->
378371 <property name =" tokens" value =" DOT" />
390383 <module name =" SuppressWarnings" >
391384 <property name =" format" value =" serial" />
392385 </module >
393- <module name =" SuppressWarningsHolder" /> <!-- Required for SuppressWarningsFilter -->
386+ <module name =" SuppressWarningsHolder" /> <!-- Required for SuppressWarningsFilter -->
394387 <module name =" TypeName" > <!-- Java Style Guide: Class names -->
395388 <message key =" name.invalidPattern" value =" Type name ''{0}'' must match pattern ''{1}''." />
396389 </module >
401394 <module name =" UpperEll" /> <!-- Java Style Guide: Numeric Literals -->
402395 <module name =" VisibilityModifier" /> <!-- Java Coding Guidelines: Minimize mutability -->
403396 <module name =" WhitespaceAfter" /> <!-- Java Style Guide: Horizontal whitespace -->
404- <module name =" WhitespaceAround" > <!-- Java Style Guide: Horizontal whitespace -->
405- <property name =" allowEmptyConstructors" value =" true" />
406- <property name =" allowEmptyMethods" value =" true" />
407- <property name =" allowEmptyTypes" value =" true" />
408- <property name =" allowEmptyLoops" value =" true" />
409- <property name =" allowEmptyLambdas" value =" true" />
410- <property name =" ignoreEnhancedForColon" value =" false" />
411- <message key =" ws.notFollowed" 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)" />
412- <message key =" ws.notPreceded" value =" WhitespaceAround: ''{0}'' is not preceded with whitespace." />
413- </module >
397+
414398
415399 <!-- Stricter checks begin: delete some or all of the following for faster prototyping, but please restore before pushing to production. -->
416400
423407 <property name =" ignoredAnnotations" value =" ParameterizedTest, Test, Before, BeforeEach, After, AfterEach, BeforeClass, BeforeAll, AfterClass, AfterAll" />
424408 </module >
425409 <module name =" JavadocMethod" > <!-- Java Style Guide: Where Javadoc is used -->
426- <property name =" scope " value =" public" />
410+ <property name =" accessModifiers " value =" public" />
427411 <property name =" allowMissingParamTags" value =" true" />
428- <property name =" allowMissingThrowsTags" value =" true" />
429412 <property name =" allowMissingReturnTag" value =" true" />
430- <property name =" minLineCount" value =" 99999999" />
431413 <property name =" allowedAnnotations" value =" Override, Test" />
432- <property name =" allowThrowsTagsForSubclasses" value =" true" />
433414 </module >
434415 <module name =" JavadocStyle" /> <!-- Java Style Guide: Javadoc -->
435416 <module name =" JavadocTagContinuationIndentation" > <!-- Java Style Guide: At-clauses -->
462443
463444 <!-- Stricter checks end -->
464445 </module >
465- </module >
446+ </module >
0 commit comments