Skip to content

Commit 4411e13

Browse files
committed
chore: initial commit
0 parents  commit 4411e13

24 files changed

+787
-0
lines changed

.checkstyle/checkstyle.xml

Lines changed: 286 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,286 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
3+
<module name="Checker">
4+
<property name="charset" value="UTF-8"/>
5+
<property name="fileExtensions" value="java, properties, xml"/>
6+
<property name="severity" value="error"/>
7+
8+
<!-- https://checkstyle.org/config_filefilters.html#BeforeExecutionExclusionFileFilter -->
9+
<module name="BeforeExecutionExclusionFileFilter">
10+
<property name="fileNamePattern" value="module\-info\.java$"/>
11+
</module>
12+
13+
<!-- https://checkstyle.org/config_whitespace.html#FileTabCharacter -->
14+
<module name="FileTabCharacter">
15+
<property name="eachLine" value="true"/>
16+
</module>
17+
18+
<!-- https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
19+
<module name="NewlineAtEndOfFile"/>
20+
21+
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
22+
<module name="SuppressionFilter">
23+
<property name="file" value="${configDirectory}/suppressions.xml"/>
24+
</module>
25+
26+
<!-- https://checkstyle.org/config_filters.html#SuppressWarningsFilter -->
27+
<module name="SuppressWarningsFilter"/>
28+
29+
<!-- https://checkstyle.org/config_filters.html#SuppressWithPlainTextCommentFilter -->
30+
<module name="SuppressWithPlainTextCommentFilter"/>
31+
32+
<module name="TreeWalker">
33+
<!-- https://checkstyle.org/config_misc.html#ArrayTypeStyle -->
34+
<module name="ArrayTypeStyle"/>
35+
36+
<!-- https://checkstyle.org/config_javadoc.html#AtclauseOrder -->
37+
<module name="AtclauseOrder">
38+
<property name="violateExecutionOnNonTightHtml" value="true"/>
39+
<property name="tagOrder" value="@author, @deprecated, @exception, @param, @return, @serial, @serialData, @serialField, @throws, @see, @since, @version"/>
40+
</module>
41+
42+
<!-- https://checkstyle.org/config_imports.html#AvoidStarImport -->
43+
<module name="AvoidStarImport"/>
44+
45+
<!-- https://checkstyle.org/config_misc.html#AvoidEscapedUnicodeCharacters -->
46+
<module name="AvoidEscapedUnicodeCharacters">
47+
<property name="allowByTailComment" value="true"/>
48+
<property name="allowEscapesForControlCharacters" value="true"/>
49+
<property name="allowNonPrintableEscapes" value="true"/>
50+
</module>
51+
52+
<!-- https://checkstyle.org/config_misc.html#CommentsIndentation -->
53+
<module name="CommentsIndentation"/>
54+
55+
<!-- https://checkstyle.org/config_naming.html#ConstantName -->
56+
<module name="ConstantName"/>
57+
58+
<!-- https://checkstyle.org/config_imports.html#CustomImportOrder -->
59+
<module name="CustomImportOrder">
60+
<property name="customImportOrderRules" value="THIRD_PARTY_PACKAGE###STATIC"/>
61+
<property name="standardPackageRegExp" value="^$"/>
62+
<property name="sortImportsInGroupAlphabetically" value="true"/>
63+
</module>
64+
65+
<!-- https://checkstyle.org/config_whitespace.html#EmptyForInitializerPad -->
66+
<module name="EmptyForInitializerPad"/>
67+
68+
<!-- https://checkstyle.org/config_whitespace.html#EmptyForIteratorPad -->
69+
<module name="EmptyForIteratorPad"/>
70+
71+
<!-- https://checkstyle.org/config_whitespace.html#EmptyLineSeparator -->
72+
<module name="EmptyLineSeparator">
73+
<property name="allowMultipleEmptyLines" value="false"/>
74+
<property name="allowMultipleEmptyLinesInsideClassMembers" value="false"/>
75+
<property name="allowNoEmptyLineBetweenFields" value="true"/>
76+
<property name="tokens" value="CLASS_DEF, CTOR_DEF, ENUM_DEF, IMPORT, INSTANCE_INIT, INTERFACE_DEF, METHOD_DEF, STATIC_IMPORT, STATIC_INIT, VARIABLE_DEF"/> <!-- remove PACKAGE_DEF, temporarily remove COMPACT_CTOR_DEF, RECORD_DEF -->
77+
</module>
78+
79+
<!-- https://checkstyle.org/config_coding.html#FallThrough -->
80+
<module name="FallThrough">
81+
<property name="checkLastCaseGroup" value="true"/>
82+
</module>
83+
84+
<!-- https://checkstyle.org/config_design.html#FinalClass -->
85+
<module name="FinalClass"/>
86+
87+
<!-- https://checkstyle.org/config_coding.html#FinalLocalVariable -->
88+
<module name="FinalLocalVariable">
89+
<property name="tokens" value="PARAMETER_DEF, VARIABLE_DEF"/> <!-- add PARAMETER_DEF -->
90+
<property name="validateEnhancedForLoopVariable" value="true"/>
91+
</module>
92+
93+
<!-- https://checkstyle.org/config_whitespace.html#GenericWhitespace -->
94+
<module name="GenericWhitespace"/>
95+
96+
<!-- https://checkstyle.org/config_design.html#HideUtilityClassConstructor -->
97+
<module name="HideUtilityClassConstructor"/>
98+
99+
<!-- https://checkstyle.org/config_imports.html#IllegalImport -->
100+
<module name="IllegalImport">
101+
<property name="illegalPkgs" value="sun, jdk, com.sun"/>
102+
</module>
103+
104+
<!-- https://checkstyle.org/config_coding.html#IllegalTokenText -->
105+
<module name="IllegalTokenText">
106+
<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)"/>
107+
<property name="message" value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
108+
<property name="tokens" value="CHAR_LITERAL, STRING_LITERAL"/>
109+
</module>
110+
111+
<!-- https://checkstyle.org/config_misc.html#Indentation -->
112+
<module name="Indentation">
113+
<property name="arrayInitIndent" value="2"/>
114+
<property name="basicOffset" value="2"/>
115+
<property name="braceAdjustment" value="0"/>
116+
<property name="caseIndent" value="2"/>
117+
<property name="lineWrappingIndentation" value="0"/>
118+
<property name="throwsIndent" value="2"/>
119+
</module>
120+
121+
<!-- https://checkstyle.org/config_javadoc.html#InvalidJavadocPosition -->
122+
<module name="InvalidJavadocPosition"/>
123+
124+
<!-- https://checkstyle.org/config_javadoc.html#JavadocContentLocation -->
125+
<module name="JavadocContentLocation"/>
126+
127+
<!-- https://checkstyle.org/config_javadoc.html#JavadocMissingWhitespaceAfterAsterisk -->
128+
<module name="JavadocMissingWhitespaceAfterAsterisk"/>
129+
130+
<!-- https://checkstyle.org/config_javadoc.html#JavadocParagraph -->
131+
<module name="JavadocParagraph"/>
132+
133+
<!-- https://checkstyle.org/config_javadoc.html#JavadocMissingWhitespaceAfterAsterisk -->
134+
<module name="JavadocTagContinuationIndentation"/>
135+
136+
<!-- https://checkstyle.org/config_blocks.html#LeftCurly -->
137+
<module name="LeftCurly"/>
138+
139+
<!-- https://checkstyle.org/config_naming.html#MethodName -->
140+
<module name="MethodName">
141+
<property name="format" value="^(?:(?:.{1,3})|(?:[gs]et[^A-Z].*)|(?:(?:[^gsA-Z]..|.[^e].|..[^t]).+))$"/>
142+
</module>
143+
144+
<!-- https://checkstyle.org/config_whitespace.html#MethodParamPad -->
145+
<module name="MethodParamPad"/>
146+
147+
<!-- https://checkstyle.org/config_javadoc.html#MissingJavadocMethod -->
148+
<module name="MissingJavadocMethod"/>
149+
150+
<!-- https://checkstyle.org/config_javadoc.html#MissingJavadocPackage -->
151+
<module name="MissingJavadocPackage"/>
152+
153+
<!-- https://checkstyle.org/config_javadoc.html#MissingJavadocType -->
154+
<module name="MissingJavadocType"/>
155+
156+
<!-- https://checkstyle.org/config_coding.html#MultipleVariableDeclarations -->
157+
<module name="MultipleVariableDeclarations"/>
158+
159+
<!-- https://checkstyle.org/config_coding.html#NoClone -->
160+
<module name="NoClone"/>
161+
162+
<!-- https://checkstyle.org/config_coding.html#NoFinalizer -->
163+
<module name="NoFinalizer"/>
164+
165+
<!-- https://checkstyle.org/config_whitespace.html#NoLineWrap -->
166+
<module name="NoLineWrap"/>
167+
168+
<!-- https://checkstyle.org/config_javadoc.html#NonEmptyAtclauseDescription -->
169+
<module name="NonEmptyAtclauseDescription"/>
170+
171+
<!-- https://checkstyle.org/config_whitespace.html#NoWhitespaceAfter -->
172+
<module name="NoWhitespaceAfter">
173+
<property name="allowLineBreaks" value="false"/>
174+
</module>
175+
176+
<!-- https://checkstyle.org/config_whitespace.html#NoWhitespaceBefore -->
177+
<module name="NoWhitespaceBefore">
178+
<property name="allowLineBreaks" value="true"/>
179+
<property name="tokens" value="COMMA, DOT, LABELED_STAT, METHOD_REF, POST_DEC, POST_INC, SEMI"/> <!-- remove ELLIPSIS -->
180+
</module>
181+
182+
<!-- https://checkstyle.org/config_coding.html#OneStatementPerLine -->
183+
<module name="OneStatementPerLine"/>
184+
185+
<!-- https://checkstyle.org/config_misc.html#OuterTypeFilename -->
186+
<module name="OuterTypeFilename"/>
187+
188+
<!-- https://checkstyle.org/config_imports.html#RedundantImport -->
189+
<module name="RedundantImport"/>
190+
191+
<!-- https://checkstyle.org/config_modifier.html#RedundantModifier -->
192+
<module name="RedundantModifier">
193+
<property name="tokens" value="ANNOTATION_FIELD_DEF, CLASS_DEF, CTOR_DEF, ENUM_DEF, INTERFACE_DEF, VARIABLE_DEF"/> <!-- remove METHOD_DEF and RESOURCE -->
194+
</module>
195+
196+
<!-- https://checkstyle.org/config_javadoc.html#RequireEmptyLineBeforeBlockTagGroup -->
197+
<module name="RequireEmptyLineBeforeBlockTagGroup"/>
198+
199+
<!-- https://checkstyle.org/config_coding.html#RequireThis -->
200+
<module name="RequireThis">
201+
<property name="validateOnlyOverlapping" value="false"/>
202+
</module>
203+
204+
<!-- https://checkstyle.org/config_blocks.html#RightCurly -->
205+
<module name="RightCurly">
206+
<property name="id" value="RightCurlyAlone"/>
207+
<property name="option" value="alone"/>
208+
<property name="tokens" value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_DEF, INSTANCE_INIT, LITERAL_FOR, LITERAL_WHILE, METHOD_DEF, STATIC_INIT"/>
209+
</module>
210+
<module name="RightCurly">
211+
<property name="id" value="RightCurlySame"/>
212+
<property name="option" value="same"/>
213+
<property name="tokens" value="LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_IF, LITERAL_TRY"/> <!-- add LITERAL_DO -->
214+
</module>
215+
216+
<!-- https://checkstyle.org/config_whitespace.html#SeparatorWrap -->
217+
<module name="SeparatorWrap">
218+
<property name="id" value="SeparatorWrapEol"/>
219+
<property name="option" value="eol"/>
220+
<property name="tokens" value="COMMA, SEMI, ELLIPSIS, RBRACK, ARRAY_DECLARATOR, METHOD_REF"/>
221+
</module>
222+
<module name="SeparatorWrap">
223+
<property name="id" value="SeparatorWrapNl"/>
224+
<property name="option" value="nl"/>
225+
<property name="tokens" value="DOT, AT"/>
226+
</module>
227+
228+
<!-- https://checkstyle.org/config_coding.html#SimplifyBooleanExpression -->
229+
<module name="SimplifyBooleanExpression"/>
230+
231+
<!-- https://checkstyle.org/config_coding.html#SimplifyBooleanReturn -->
232+
<module name="SimplifyBooleanReturn"/>
233+
234+
<!-- https://checkstyle.org/config_whitespace.html#SingleSpaceSeparator -->
235+
<module name="SingleSpaceSeparator">
236+
<property name="validateComments" value="true"/>
237+
</module>
238+
239+
<!-- https://checkstyle.org/config_javadoc.html#SummaryJavadoc -->
240+
<module name="SummaryJavadoc"/>
241+
242+
<!-- https://checkstyle.org/config_annotation.html#SuppressWarningsHolder -->
243+
<module name="SuppressWarningsHolder"/>
244+
245+
<!-- https://checkstyle.org/config_whitespace.html#TypecastParenPad -->
246+
<module name="TypecastParenPad"/>
247+
248+
<!-- https://checkstyle.org/config_coding.html#UnnecessaryParentheses -->
249+
<module name="UnnecessaryParentheses"/>
250+
251+
<!-- https://checkstyle.org/config_imports.html#UnusedImports -->
252+
<module name="UnusedImports"/>
253+
254+
<!-- https://checkstyle.org/config_whitespace.html#WhitespaceAfter -->
255+
<module name="WhitespaceAfter"/>
256+
257+
<!-- https://checkstyle.org/config_whitespace.html#WhitespaceAround -->
258+
<module name="WhitespaceAround">
259+
<property name="ignoreEnhancedForColon" value="false"/>
260+
<property name="allowEmptyTypes" value="true"/>
261+
<property name="allowEmptyLambdas" value="true"/>
262+
<property name="tokens" value="ASSIGN, COLON, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/>
263+
</module>
264+
265+
<!--
266+
#####################
267+
#### third-party ####
268+
#####################
269+
-->
270+
271+
<!-- https://checkstyle.org/config_javadoc.html#WriteTag -->
272+
<!-- https://gitlab.com/stellardrift/stylecheck/-/blob/dev/src/main/java/ca/stellardrift/stylecheck/FilteringWriteTag.java -->
273+
<module name="FilteringWriteTag">
274+
<property name="tag" value="@since\s"/>
275+
<property name="tagFormat" value="\d\.\d+\.\d+"/>
276+
<property name="tagSeverity" value="ignore"/>
277+
<property name="minimumScope" value="public"/>
278+
<property name="tokens" value="INTERFACE_DEF, CLASS_DEF, ENUM_DEF, ANNOTATION_DEF, RECORD_DEF, METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, RECORD_DEF, COMPACT_CTOR_DEF"/>
279+
</module>
280+
281+
<!-- https://gitlab.com/stellardrift/stylecheck/-/blob/dev/src/main/java/ca/stellardrift/stylecheck/StatementNoWhitespaceAfter.java -->
282+
<module name="StatementNoWhitespaceAfter">
283+
<property name="tokens" value="LITERAL_CATCH, LITERAL_FOR, LITERAL_IF, LITERAL_TRY, LITERAL_WHILE"/>
284+
</module>
285+
</module>
286+
</module>

.checkstyle/suppressions.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE suppressions PUBLIC "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN" "http://checkstyle.org/dtds/suppressions_1_2.dtd">
3+
<suppressions>
4+
</suppressions>

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_size = 2
6+
indent_style = space
7+
insert_final_newline = true
8+
max_line_length = off

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: ["kashike"]

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "gradle"
5+
directory: "/"
6+
labels:
7+
- "dependencies: java"
8+
open-pull-requests-limit: 10
9+
schedule:
10+
interval: "daily"

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "build"
2+
3+
on: ["pull_request", "push"]
4+
5+
jobs:
6+
build:
7+
# Only run on PRs if the source branch is on someone else's repo
8+
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
9+
strategy:
10+
matrix:
11+
os: ["ubuntu-latest", "windows-latest"]
12+
runs-on: ${{ matrix.os }}
13+
steps:
14+
- name: "checkout repository"
15+
uses: "actions/checkout@v2"
16+
- name: "setup jdk 11"
17+
uses: "actions/setup-java@v2"
18+
with:
19+
distribution: "adopt"
20+
java-version: "16"
21+
- name: "build"
22+
run: "./gradlew build"
23+
- name: "publish"
24+
if: ${{ runner.os == 'Linux' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
25+
run: "./gradlew publish"
26+
env:
27+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
28+
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}

.github/workflows/codeql-analysis.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "codeql"
2+
3+
on:
4+
pull_request:
5+
push:
6+
schedule:
7+
- cron: "00 14 * * 1"
8+
9+
jobs:
10+
analyze:
11+
name: "analyze"
12+
runs-on: "ubuntu-latest"
13+
steps:
14+
- name: "checkout repository"
15+
uses: "actions/checkout@v2"
16+
- name: "setup jdk 11"
17+
uses: "actions/setup-java@v2"
18+
with:
19+
distribution: "adopt"
20+
java-version: "11"
21+
- name: "codeql init"
22+
uses: "github/codeql-action/init@v1"
23+
with:
24+
languages: "java"
25+
- name: "codeql autobuild"
26+
uses: "github/codeql-action/autobuild@v1"
27+
- name: "codeql analysis"
28+
uses: "github/codeql-action/analyze@v1"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "validate gradle wrapper"
2+
3+
on: ["pull_request", "push"]
4+
5+
jobs:
6+
build:
7+
runs-on: "ubuntu-latest"
8+
steps:
9+
- name: "checkout repository"
10+
uses: "actions/checkout@v2"
11+
- name: "validate gradle wrapper"
12+
uses: "gradle/wrapper-validation-action@v1"

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/.gradle/
2+
/.idea/
3+
/build/
4+
/build-logic/.gradle/
5+
/build-logic/build/
6+
/run/
7+
/*.iml

0 commit comments

Comments
 (0)