-
Notifications
You must be signed in to change notification settings - Fork 64
Adds checkstyles to project #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| <code_scheme name="Spring gRPC" version="173"> | ||
| <option name="AUTODETECT_INDENTS" value="false"/> | ||
| <option name="OTHER_INDENT_OPTIONS"> | ||
| <value> | ||
| <option name="USE_TAB_CHARACTER" value="true"/> | ||
| </value> | ||
| </option> | ||
| <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="50"/> | ||
| <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="500"/> | ||
| <option name="IMPORT_LAYOUT_TABLE"> | ||
| <value> | ||
| <package name="java" withSubpackages="true" static="false"/> | ||
| <emptyLine/> | ||
| <package name="javax" withSubpackages="true" static="false"/> | ||
| <emptyLine/> | ||
| <package name="" withSubpackages="true" static="false"/> | ||
| <emptyLine/> | ||
| <package name="org.springframework" withSubpackages="true" static="false"/> | ||
| <emptyLine/> | ||
| <package name="" withSubpackages="true" static="true"/> | ||
| </value> | ||
| </option> | ||
| <option name="RIGHT_MARGIN" value="90"/> | ||
| <option name="ENABLE_JAVADOC_FORMATTING" value="false"/> | ||
| <option name="JD_ALIGN_PARAM_COMMENTS" value="false"/> | ||
| <option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false"/> | ||
| <option name="JD_KEEP_EMPTY_LINES" value="false"/> | ||
| <GroovyCodeStyleSettings> | ||
| <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="500"/> | ||
| <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="500"/> | ||
| <option name="IMPORT_LAYOUT_TABLE"> | ||
| <value> | ||
| <emptyLine/> | ||
| <package name="javax" withSubpackages="true" static="false"/> | ||
| <package name="java" withSubpackages="true" static="false"/> | ||
| <emptyLine/> | ||
| <package name="" withSubpackages="true" static="false"/> | ||
| <emptyLine/> | ||
| <package name="org.springframework" withSubpackages="true" | ||
| static="false"/> | ||
| <emptyLine/> | ||
| <package name="" withSubpackages="true" static="true"/> | ||
| </value> | ||
| </option> | ||
| </GroovyCodeStyleSettings> | ||
| <JavaCodeStyleSettings> | ||
| <option name="CLASS_NAMES_IN_JAVADOC" value="3"/> | ||
| <option name="INSERT_INNER_CLASS_IMPORTS" value="true"/> | ||
| <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="50"/> | ||
| <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="500"/> | ||
| <option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND"> | ||
| <value/> | ||
| </option> | ||
| <option name="IMPORT_LAYOUT_TABLE"> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These import order are in line w/ the ones in the checkstyle which allows us to easily optmize imports from w/in IDEA and have them match the checkstyles. I am sure there is something similar for other editors. I created a wiki page that tells how to do this for IDEA. W/ a TODO section for other editors. |
||
| <value> | ||
| <package name="" withSubpackages="true" static="true"/> | ||
| <emptyLine/> | ||
| <package name="java" withSubpackages="true" static="false"/> | ||
| <emptyLine/> | ||
| <package name="javax" withSubpackages="true" static="false"/> | ||
| <emptyLine/> | ||
| <package name="org" withSubpackages="true" static="false"/> | ||
| <emptyLine/> | ||
| <package name="org.springframework" withSubpackages="true" static="false"/> | ||
| </value> | ||
| </option> | ||
| <option name="ENABLE_JAVADOC_FORMATTING" value="false"/> | ||
| <option name="JD_ALIGN_PARAM_COMMENTS" value="false"/> | ||
| <option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false"/> | ||
| <option name="JD_KEEP_INVALID_TAGS" value="false"/> | ||
| <option name="JD_KEEP_EMPTY_LINES" value="false"/> | ||
| </JavaCodeStyleSettings> | ||
| <JetCodeStyleSettings> | ||
| <option name="PACKAGES_TO_USE_STAR_IMPORTS"> | ||
| <value> | ||
| <package name="java.util" withSubpackages="false" static="false"/> | ||
| <package name="kotlinx.android.synthetic" withSubpackages="false" | ||
| static="false"/> | ||
| </value> | ||
| </option> | ||
| <option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="20"/> | ||
| <option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="20"/> | ||
| </JetCodeStyleSettings> | ||
| <XML> | ||
| <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true"/> | ||
| </XML> | ||
| <editorconfig> | ||
| <option name="ENABLED" value="false"/> | ||
| </editorconfig> | ||
| <codeStyleSettings language="Groovy"> | ||
| <indentOptions> | ||
| <option name="USE_TAB_CHARACTER" value="true"/> | ||
| </indentOptions> | ||
| </codeStyleSettings> | ||
| <codeStyleSettings language="JAVA"> | ||
| <option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1"/> | ||
| <option name="BLANK_LINES_AROUND_FIELD" value="1"/> | ||
| <option name="BLANK_LINES_AROUND_FIELD_IN_INTERFACE" value="1"/> | ||
| <option name="ELSE_ON_NEW_LINE" value="true"/> | ||
| <option name="CATCH_ON_NEW_LINE" value="true"/> | ||
| <option name="FINALLY_ON_NEW_LINE" value="true"/> | ||
| <option name="ALIGN_MULTILINE_PARAMETERS" value="false"/> | ||
| <option name="SPACE_WITHIN_ARRAY_INITIALIZER_BRACES" value="true"/> | ||
| <option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true"/> | ||
| <option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true"/> | ||
| <option name="KEEP_SIMPLE_CLASSES_IN_ONE_LINE" value="true"/> | ||
| <option name="KEEP_MULTIPLE_EXPRESSIONS_IN_ONE_LINE" value="true"/> | ||
| <indentOptions> | ||
| <option name="USE_TAB_CHARACTER" value="true"/> | ||
| </indentOptions> | ||
| </codeStyleSettings> | ||
| <codeStyleSettings language="JSON"> | ||
| <indentOptions> | ||
| <option name="TAB_SIZE" value="2"/> | ||
| </indentOptions> | ||
| </codeStyleSettings> | ||
| <codeStyleSettings language="XML"> | ||
| <indentOptions> | ||
| <option name="USE_TAB_CHARACTER" value="true"/> | ||
| </indentOptions> | ||
| </codeStyleSettings> | ||
| <codeStyleSettings language="kotlin"> | ||
| <indentOptions> | ||
| <option name="USE_TAB_CHARACTER" value="true"/> | ||
| </indentOptions> | ||
| </codeStyleSettings> | ||
| </code_scheme> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,7 +78,7 @@ | |
| <spring-boot.version>3.3.4</spring-boot.version> | ||
| <jackson.version>2.17.2</jackson.version> | ||
| <junit.version>5.10.5</junit.version> | ||
|
|
||
| <assertj.version>3.26.3</assertj.version> | ||
| <!-- documentation dependencies --> | ||
| <io.spring.maven.antora-version>0.0.4</io.spring.maven.antora-version> | ||
| <asciidoctorj-pdf.version>1.6.2</asciidoctorj-pdf.version> <!-- FIXME build failure with | ||
|
|
@@ -103,8 +103,17 @@ | |
| <maven-site-plugin.version>4.0.0-M13</maven-site-plugin.version> | ||
| <maven-project-info-reports-plugin.version>3.4.5</maven-project-info-reports-plugin.version> | ||
| <maven-jar-plugin.version>3.3.0</maven-jar-plugin.version> | ||
| <spring-javaformat-maven-plugin.version>0.0.39</spring-javaformat-maven-plugin.version> | ||
|
|
||
| <!-- BEGIN format + checkstyle properties --> | ||
| <spring-javaformat-maven-plugin.version>0.0.43</spring-javaformat-maven-plugin.version> | ||
| <maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version> | ||
| <puppycrawl-tools-checkstyle.version>9.3</puppycrawl-tools-checkstyle.version> | ||
| <spring-javaformat-checkstyle.version>0.0.43</spring-javaformat-checkstyle.version> | ||
| <disable.format.checks>false</disable.format.checks> | ||
| <disable.checkstyle.checks>false</disable.checkstyle.checks> | ||
| <maven-checkstyle-plugin.failsOnError>true</maven-checkstyle-plugin.failsOnError> | ||
| <maven-checkstyle-plugin.failOnViolation>true</maven-checkstyle-plugin.failOnViolation> | ||
| <maven-checkstyle-plugin.includeTestSourceDirectory>true</maven-checkstyle-plugin.includeTestSourceDirectory> | ||
| <!-- END format + checkstyle properties --> | ||
| </properties> | ||
|
|
||
| <build> | ||
|
|
@@ -117,12 +126,53 @@ | |
| <execution> | ||
| <phase>validate</phase> | ||
| <inherited>true</inherited> | ||
| <configuration> | ||
| <skip>${disable.format.checks}</skip> | ||
| </configuration> | ||
| <goals> | ||
| <goal>validate</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-checkstyle-plugin</artifactId> | ||
| <version>${maven-checkstyle-plugin.version}</version> | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>com.puppycrawl.tools</groupId> | ||
| <artifactId>checkstyle</artifactId> | ||
| <version>${puppycrawl-tools-checkstyle.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.spring.javaformat</groupId> | ||
| <artifactId>spring-javaformat-checkstyle</artifactId> | ||
| <version>${spring-javaformat-checkstyle.version}</version> | ||
| </dependency> | ||
| </dependencies> | ||
| <executions> | ||
| <execution> | ||
| <id>checkstyle-validation</id> | ||
| <phase>validate</phase> | ||
| <inherited>true</inherited> | ||
| <configuration> | ||
| <configLocation>src/checkstyle/checkstyle.xml</configLocation> | ||
| <propertyExpansion> | ||
| config_loc=src/checkstyle | ||
| </propertyExpansion> | ||
| <skip>${disable.checkstyle.checks}</skip> | ||
| <includeTestSourceDirectory>${maven-checkstyle-plugin.includeTestSourceDirectory}</includeTestSourceDirectory> | ||
| <failsOnError>${maven-checkstyle-plugin.failsOnError}</failsOnError> | ||
| <failOnViolation>${maven-checkstyle-plugin.failOnViolation}</failOnViolation> | ||
| <consoleOutput>true</consoleOutput> | ||
| </configuration> | ||
| <goals> | ||
| <goal>check</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-site-plugin</artifactId> | ||
|
|
@@ -438,6 +488,20 @@ | |
| <type>pom</type> | ||
| <scope>import</scope> | ||
| </dependency> | ||
| <dependency> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These were required as the checkstyle enforce AssertJ over Junit assertEquals |
||
| <groupId>org.junit</groupId> | ||
| <artifactId>junit-bom</artifactId> | ||
| <version>${junit.version}</version> | ||
| <type>pom</type> | ||
| <scope>import</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.assertj</groupId> | ||
| <artifactId>assertj-bom</artifactId> | ||
| <version>${assertj.version}</version> | ||
| <type>pom</type> | ||
| <scope>import</scope> | ||
| </dependency> | ||
| </dependencies> | ||
| </dependencyManagement> | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this auto-generated from contribution-guidelines.adoc?