Skip to content

Commit 8a730f6

Browse files
authored
Merge pull request #81 from harshsennnn/checkstyle-Identity-API
checkstyle for Identity-API
2 parents 1c05cc0 + 35a358f commit 8a730f6

File tree

4 files changed

+107
-1
lines changed

4 files changed

+107
-1
lines changed

.github/workflows/checkstyle.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Call Checkstyle
2+
3+
on:
4+
pull_request:
5+
branches: ["master", "develop"]
6+
paths:
7+
- '**/*.java'
8+
9+
jobs:
10+
style-check:
11+
uses: PSMRI/.github/.github/workflows/checkstyle.yml@main
12+
with:
13+
java-version: '17'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ nbdist/
2929
mvnw
3030
mvnw.cmd
3131
.mvn
32+
command_output.log
3233

3334
# Properties
3435
src/main/environment/1097_local.properties

checkstyle.xml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
3+
4+
<module name="Checker">
5+
<property name="severity" value="error" />
6+
<property name="fileExtensions" value="java" />
7+
8+
<!-- Checks for Size Violations -->
9+
<module name="FileLength">
10+
<property name="max" value="500" />
11+
</module>
12+
<module name="LineLength">
13+
<property name="max" value="120" />
14+
</module>
15+
16+
<module name="TreeWalker">
17+
<!-- Checks for Naming Conventions -->
18+
<module name="MethodName" />
19+
<module name="PackageName" />
20+
<module name="TypeName" />
21+
<module name="ParameterName" />
22+
<module name="LocalVariableName" />
23+
<module name="MemberName" />
24+
25+
<!-- Checks for imports -->
26+
<module name="AvoidStarImport" />
27+
<module name="IllegalImport" />
28+
<module name="RedundantImport" />
29+
<module name="UnusedImports" />
30+
31+
<!-- Checks for Size Violations -->
32+
<module name="MethodLength">
33+
<property name="max" value="50" />
34+
</module>
35+
36+
<!-- Checks for whitespace -->
37+
<module name="EmptyLineSeparator" />
38+
<module name="GenericWhitespace" />
39+
<module name="MethodParamPad" />
40+
<module name="NoWhitespaceAfter" />
41+
<module name="NoWhitespaceBefore" />
42+
<module name="ParenPad" />
43+
<module name="TypecastParenPad" />
44+
<module name="WhitespaceAfter" />
45+
<module name="WhitespaceAround" />
46+
47+
<!-- Modifier Checks -->
48+
<module name="ModifierOrder" />
49+
<module name="RedundantModifier" />
50+
51+
<!-- Checks for blocks -->
52+
<module name="EmptyBlock" />
53+
<module name="LeftCurly" />
54+
<module name="RightCurly" />
55+
<module name="NeedBraces" />
56+
57+
<!-- Checks for common coding problems -->
58+
<module name="EmptyStatement" />
59+
<module name="EqualsHashCode" />
60+
<module name="IllegalInstantiation" />
61+
<module name="MissingSwitchDefault" />
62+
<module name="SimplifyBooleanExpression" />
63+
<module name="SimplifyBooleanReturn" />
64+
</module>
65+
</module>

pom.xml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,34 @@
405405
</webResources>
406406
</configuration>
407407
</plugin>
408-
408+
<plugin>
409+
<groupId>org.apache.maven.plugins</groupId>
410+
<artifactId>maven-checkstyle-plugin</artifactId>
411+
<version>3.3.1</version>
412+
<dependencies>
413+
<dependency>
414+
<groupId>com.puppycrawl.tools</groupId>
415+
<artifactId>checkstyle</artifactId>
416+
<version>10.12.7</version>
417+
</dependency>
418+
</dependencies>
419+
<configuration>
420+
<configLocation>checkstyle.xml</configLocation>
421+
<encoding>UTF-8</encoding>
422+
<consoleOutput>true</consoleOutput>
423+
<failsOnError>true</failsOnError>
424+
<linkXRef>false</linkXRef>
425+
</configuration>
426+
<executions>
427+
<execution>
428+
<id>validate</id>
429+
<phase>validate</phase>
430+
<goals>
431+
<goal>check</goal>
432+
</goals>
433+
</execution>
434+
</executions>
435+
</plugin>
409436
</plugins>
410437
</build>
411438
<reporting>

0 commit comments

Comments
 (0)