File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323 - name : Check formatting (Google Java Style)
2424 run : mvn --batch-mode fmt:check
2525
26+ - name : Check style (Google Java Style)
27+ run : mvn --batch-mode checkstyle:check
28+
2629 test :
2730 runs-on : ubuntu-latest
2831 strategy :
Original file line number Diff line number Diff line change 77 @echo " make compile - Run clean compile on all supported JDKs ($( JDK_VERSIONS) )"
88 @echo " make format - Auto-format code (Google Java Style)"
99 @echo " make check-format - Check code formatting (Google Java Style)"
10+ @echo " make check-style - Run checkstyle (Google Java Style)"
1011 @echo " make examples - Regenerate EXAMPLES.md and README.md from test source code"
1112 @echo " make check-examples - Verify EXAMPLES.md and README.md are up to date"
1213 @echo " make version - Show current project version"
@@ -73,6 +74,10 @@ format:
7374check-format :
7475 mvn fmt:check
7576
77+ .PHONY : check-style
78+ check-style :
79+ mvn checkstyle:check
80+
7681.PHONY : examples
7782examples :
7883 python3 tools/generate_examples.py
Original file line number Diff line number Diff line change 284284 <artifactId >fmt-maven-plugin</artifactId >
285285 <version >2.29</version >
286286 </plugin >
287+ <plugin >
288+ <groupId >org.apache.maven.plugins</groupId >
289+ <artifactId >maven-checkstyle-plugin</artifactId >
290+ <version >3.6.0</version >
291+ <dependencies >
292+ <dependency >
293+ <groupId >com.puppycrawl.tools</groupId >
294+ <artifactId >checkstyle</artifactId >
295+ <version >10.23.1</version >
296+ </dependency >
297+ </dependencies >
298+ <configuration >
299+ <configLocation >google_checks.xml</configLocation >
300+ <suppressionsLocation >checkstyle-suppressions.xml</suppressionsLocation >
301+ <violationSeverity >warning</violationSeverity >
302+ <failOnViolation >true</failOnViolation >
303+ <consoleOutput >true</consoleOutput >
304+ </configuration >
305+ </plugin >
287306 <plugin >
288307 <groupId >org.apache.maven.plugins</groupId >
289308 <artifactId >maven-enforcer-plugin</artifactId >
525544 </execution >
526545 </executions >
527546 </plugin >
547+ <plugin >
548+ <groupId >org.apache.maven.plugins</groupId >
549+ <artifactId >maven-checkstyle-plugin</artifactId >
550+ <executions >
551+ <execution >
552+ <id >checkstyle</id >
553+ <phase >verify</phase >
554+ <goals >
555+ <goal >check</goal >
556+ </goals >
557+ </execution >
558+ </executions >
559+ </plugin >
528560 </plugins >
529561 </build >
530562 </profile >
You can’t perform that action at this time.
0 commit comments