Ensure CRLF stays out of the repo

Looks like I already failed that project a little :)

(cherry picked from commit 066771b2d15748edc72095b75c4626bf445266aa)
This commit is contained in:
Octavia Togami 2020-08-15 06:46:24 -04:00 committed by MattBDev
parent fd336feb46
commit 034b910d57
3 changed files with 243 additions and 203 deletions

4
.git-blame-ignore-revs Normal file
View File

@ -0,0 +1,4 @@
# CRLF -> LF
59ccc0a5af93d4b3d97df2bd6b946bba5a6d5c5c
# Checkstyle
eb52afa296fffc4397e2f4014c7eb8094f50240e

36
.gitattributes vendored
View File

@ -1,2 +1,34 @@
*.java diff=java * text=auto
#*.java merge=import-driver #TODO not implemented, I'm just using a merge tool instead # Force Batch files to CRLF
*.bat text=crlf
# Java sources
*.java text diff=java
*.kt text diff=java
*.gradle text diff=java
*.gradle.kts text diff=java
# These files are text and should be normalized (Convert crlf => lf)
*.css text diff=css
*.df text
*.htm text diff=html
*.html text diff=html
*.js text
*.jsp text
*.jspf text
*.jspx text
*.properties text
*.tld text
*.tag text
*.tagx text
*.xml text
# These files are binary and should be left untouched
# (binary is a macro for -text -diff)
*.class binary
*.dll binary
*.ear binary
*.jar binary
*.so binary
*.war binary
*.jks binary

View File

@ -1,201 +1,205 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE module PUBLIC <!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd"> "https://checkstyle.org/dtds/configuration_1_3.dtd">
<!-- <!--
Checks based on Google Checks, modified for EngineHub. Checks based on Google Checks, modified for EngineHub.
--> -->
<module name="Checker"> <module name="Checker">
<property name="charset" value="UTF-8"/> <property name="charset" value="UTF-8"/>
<property name="severity" value="error"/> <property name="severity" value="error"/>
<property name="fileExtensions" value="java, properties, xml"/> <property name="fileExtensions" value="java, properties, xml"/>
<!-- Checks for whitespace --> <!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html --> <!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="FileTabCharacter"> <module name="FileTabCharacter">
<property name="eachLine" value="true"/> <property name="eachLine" value="true"/>
</module> </module>
<module name="TreeWalker"> <module name="TreeWalker">
<module name="OuterTypeFilename"/> <module name="OuterTypeFilename"/>
<module name="IllegalTokenText"> <module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/> <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format" <property name="format"
value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/> value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message" value="Avoid using corresponding octal or Unicode escape."/> <property name="message" value="Avoid using corresponding octal or Unicode escape."/>
</module> </module>
<module name="AvoidEscapedUnicodeCharacters"> <module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/> <property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowByTailComment" value="true"/> <property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/> <property name="allowNonPrintableEscapes" value="true"/>
</module> </module>
<module name="AvoidStarImport"/> <module name="AvoidStarImport"/>
<module name="OneTopLevelClass"/> <module name="OneTopLevelClass"/>
<module name="NoLineWrap"/> <module name="NoLineWrap"/>
<module name="EmptyBlock"> <module name="EmptyBlock">
<property name="option" value="TEXT"/> <property name="option" value="TEXT"/>
<property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/> <property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module> </module>
<module name="NeedBraces"/> <module name="NeedBraces"/>
<module name="RightCurly"/> <module name="RightCurly"/>
<module name="RightCurly"> <module name="RightCurly">
<property name="option" value="alone"/> <property name="option" value="alone"/>
<property name="tokens" <property name="tokens"
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/> value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
</module> </module>
<module name="WhitespaceAround"> <module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/> <property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyMethods" value="true"/> <property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/> <property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/> <property name="allowEmptyLoops" value="true"/>
<message key="ws.notFollowed" <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)"/> 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)"/>
<message key="ws.notPreceded" <message key="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/> value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
</module> </module>
<module name="WhitespaceAfter"> <module name="WhitespaceAfter">
<message key="ws.notFollowed" <message key="ws.notFollowed"
value="WhitespaceAround: ''{0}'' is not followed by whitespace. (4.1.3)"/> value="WhitespaceAround: ''{0}'' is not followed by whitespace. (4.1.3)"/>
</module> </module>
<module name="NoWhitespaceBefore"/> <module name="NoWhitespaceBefore"/>
<module name="OneStatementPerLine"/> <module name="OneStatementPerLine"/>
<module name="MultipleVariableDeclarations"/> <module name="MultipleVariableDeclarations"/>
<module name="ArrayTypeStyle"/> <module name="ArrayTypeStyle"/>
<module name="MissingSwitchDefault"/> <module name="MissingSwitchDefault"/>
<module name="FallThrough"> <module name="FallThrough">
<property name="reliefPattern" value="FALL-THROUGH|falls?[ -]?thr(u|ough)"/> <property name="reliefPattern" value="FALL-THROUGH|falls?[ -]?thr(u|ough)"/>
</module> </module>
<module name="UpperEll"/> <module name="UpperEll"/>
<module name="ModifierOrder"/> <module name="ModifierOrder"/>
<module name="EmptyLineSeparator"> <module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/> <property name="allowNoEmptyLineBetweenFields" value="true"/>
</module> </module>
<module name="SeparatorWrap"> <module name="SeparatorWrap">
<property name="tokens" value="DOT"/> <property name="tokens" value="DOT"/>
<property name="option" value="nl"/> <property name="option" value="nl"/>
</module> </module>
<module name="SeparatorWrap"> <module name="SeparatorWrap">
<property name="tokens" value="COMMA"/> <property name="tokens" value="COMMA"/>
<property name="option" value="EOL"/> <property name="option" value="EOL"/>
</module> </module>
<module name="PackageName"> <module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/> <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern" <message key="name.invalidPattern"
value="Package name ''{0}'' must match pattern ''{1}''."/> value="Package name ''{0}'' must match pattern ''{1}''."/>
</module> </module>
<module name="TypeName"> <module name="TypeName">
<message key="name.invalidPattern" <message key="name.invalidPattern"
value="Type name ''{0}'' must match pattern ''{1}''."/> value="Type name ''{0}'' must match pattern ''{1}''."/>
</module> </module>
<module name="MemberName"> <module name="MemberName">
<property name="format" value="^([a-z][_a-zA-Z0-9]+|[xyz])$"/> <property name="format" value="^([a-z][_a-zA-Z0-9]+|[xyz])$"/>
<message key="name.invalidPattern" <message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/> value="Member name ''{0}'' must match pattern ''{1}''."/>
</module> </module>
<module name="ParameterName"> <module name="ParameterName">
<property name="format" value="^([a-z][_a-zA-Z0-9]*|[a-z])$"/> <property name="format" value="^([a-z][a-z0-9][_a-zA-Z0-9]*|[a-z])$"/>
<message key="name.invalidPattern" <message key="name.invalidPattern"
value="Parameter name ''{0}'' must match pattern ''{1}''."/> value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module> </module>
<module name="ClassTypeParameterName"> <module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|(^[A-Z][a-zA-Z0-9]*$)"/> <property name="format" value="(^[A-Z][0-9]?)$|(^[A-Z][a-zA-Z0-9]*$)"/>
<message key="name.invalidPattern" <message key="name.invalidPattern"
value="Class type name ''{0}'' must match pattern ''{1}''."/> value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module> </module>
<module name="MethodTypeParameterName"> <module name="MethodTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|(^[A-Z][a-zA-Z0-9]*$)"/> <property name="format" value="(^[A-Z][0-9]?)$|(^[A-Z][a-zA-Z0-9]*$)"/>
<message key="name.invalidPattern" <message key="name.invalidPattern"
value="Method type name ''{0}'' must match pattern ''{1}''."/> value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module> </module>
<module name="NoFinalizer"/> <module name="NoFinalizer"/>
<module name="GenericWhitespace"> <module name="GenericWhitespace">
<message key="ws.followed" <message key="ws.followed"
value="GenericWhitespace ''{0}'' is followed by whitespace."/> value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded" <message key="ws.preceded"
value="GenericWhitespace ''{0}'' is preceded with whitespace."/> value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow" <message key="ws.illegalFollow"
value="GenericWhitespace ''{0}'' should followed by whitespace."/> value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded" <message key="ws.notPreceded"
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/> value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
</module> </module>
<module name="Regexp"> <module name="Regexp">
<property name="format" value="[ \t]+$"/> <property name="format" value="[ \t]+$"/>
<property name="illegalPattern" value="true"/> <property name="illegalPattern" value="true"/>
<property name="message" value="Trailing whitespace"/> <property name="message" value="Trailing whitespace"/>
</module> </module>
<module name="Indentation"> <module name="Indentation">
<property name="basicOffset" value="4"/> <property name="basicOffset" value="4"/>
<property name="braceAdjustment" value="0"/> <property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="4"/> <property name="caseIndent" value="4"/>
<property name="throwsIndent" value="4"/> <property name="throwsIndent" value="4"/>
<property name="lineWrappingIndentation" value="4"/> <property name="lineWrappingIndentation" value="4"/>
<property name="arrayInitIndent" value="4"/> <property name="arrayInitIndent" value="4"/>
</module> </module>
<module name="CustomImportOrder"> <module name="CustomImportOrder">
<property name="sortImportsInGroupAlphabetically" value="true"/> <property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="customImportOrderRules" value="THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE###STATIC"/> <property name="customImportOrderRules" value="THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE###STATIC"/>
</module> </module>
<module name="MethodParamPad"/> <module name="MethodParamPad"/>
<module name="OperatorWrap"> <module name="OperatorWrap">
<property name="option" value="NL"/> <property name="option" value="NL"/>
<property name="tokens" <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 "/> value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
</module> </module>
<module name="AnnotationLocation"> <module name="AnnotationLocation">
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/> <property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
</module> </module>
<module name="AnnotationLocation"> <module name="AnnotationLocation">
<property name="tokens" value="VARIABLE_DEF"/> <property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/> <property name="allowSamelineMultipleAnnotations" value="true"/>
</module> </module>
<module name="NonEmptyAtclauseDescription"/> <module name="NonEmptyAtclauseDescription"/>
<module name="JavadocTagContinuationIndentation"/> <module name="JavadocTagContinuationIndentation"/>
<module name="SummaryJavadocCheck"> <module name="SummaryJavadocCheck">
<property name="forbiddenSummaryFragments" <property name="forbiddenSummaryFragments"
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/> value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
</module> </module>
<module name="JavadocParagraph"/> <module name="JavadocParagraph"/>
<module name="AtclauseOrder"> <module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/> <property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/> <property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module> </module>
<!-- No javadoc for now --> <!-- No javadoc for now -->
<!--<module name="JavadocMethod"> <!--<module name="JavadocMethod">
<property name="scope" value="public"/> <property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/> <property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/> <property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/> <property name="allowMissingReturnTag" value="true"/>
<property name="minLineCount" value="2"/> <property name="minLineCount" value="2"/>
<property name="allowedAnnotations" value="Override, Test"/> <property name="allowedAnnotations" value="Override, Test"/>
<property name="allowThrowsTagsForSubclasses" value="true"/> <property name="allowThrowsTagsForSubclasses" value="true"/>
</module>--> </module>-->
<module name="MethodName"> <module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/> <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern" <message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/> value="Method name ''{0}'' must match pattern ''{1}''."/>
</module> </module>
<module name="SingleLineJavadoc"> <module name="SingleLineJavadoc">
<property name="ignoreInlineTags" value="false"/> <property name="ignoreInlineTags" value="false"/>
</module> </module>
<module name="EmptyCatchBlock"> <module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected|ignored"/> <property name="exceptionVariableName" value="expected|ignored"/>
</module> </module>
<module name="CommentsIndentation"/> <module name="CommentsIndentation"/>
<!-- Validate String.to(Lower|Upper)Case() calls include Locale argument --> <!-- Validate String.to(Lower|Upper)Case() calls include Locale argument -->
<module name="Regexp"> <module name="Regexp">
<property name="message" value="Case-conversion calls must include an explicit Locale"/> <property name="message" value="Case-conversion calls must include an explicit Locale"/>
<property name="format" value="(?!Character)\.to(Lower|Upper)Case\(\)"/> <property name="format" value="(?!Character)\.to(Lower|Upper)Case\(\)"/>
<property name="illegalPattern" value="true"/> <property name="illegalPattern" value="true"/>
</module> </module>
</module> </module>
<!-- Validate that command annotations are formatted correctly --> <!-- Validate that command annotations are formatted correctly -->
<module name="RegexpMultiline"> <module name="RegexpMultiline">
<property name="format" value="^( +)@(Arg|Switch|Command)\(.*?\r?\n\1 {5,}"/> <property name="format" value="^( +)@(Arg|Switch|Command)\(.*?\r?\n\1 {5,}"/>
</module> </module>
<module name="SuppressionFilter"> <module name="RegexpMultiline">
<property name="file" value="${config_loc}/checkstyle-suppression.xml"/> <property name="format" value="(?s:(\r\n|\r).*)"/>
</module> <property name="message" value="CRLF and CR line endings are prohibited, but this file uses them."/>
</module> </module>
<module name="SuppressionFilter">
<property name="file" value="${config_loc}/checkstyle-suppression.xml"/>
</module>
</module>