-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add linting workflow and address identified issues (#120)
* Add pmd plugin and address identified issues * Add checkstyle plugin for linting and address formatting and linting issues * Add GitHub Actions workflow for Java linting with Checkstyle and PMD
- Loading branch information
1 parent
077ebab
commit 30f54d6
Showing
23 changed files
with
915 additions
and
583 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Java Linting | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: maven | ||
|
||
- name: Install dependencies | ||
run: mvn install -DskipTests | ||
|
||
- name: Run Checkstyle | ||
run: mvn checkstyle:check | ||
|
||
- name: Run PMD | ||
run: mvn pmd:check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE module PUBLIC | ||
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" | ||
"https://checkstyle.org/dtds/configuration_1_3.dtd"> | ||
|
||
<module name="Checker"> | ||
<module name="FileTabCharacter"> | ||
<property name="eachLine" value="true"/> | ||
</module> | ||
<module name="LineLength"> | ||
<property name="max" value="120"/> | ||
</module> | ||
<!-- Coding style rules --> | ||
<module name="TreeWalker"> | ||
|
||
<!-- Naming conventions --> | ||
<module name="ConstantName"/> | ||
<module name="LocalVariableName"/> | ||
<module name="MemberName"/> | ||
<module name="MethodName"/> | ||
<module name="PackageName"/> | ||
<module name="ParameterName"/> | ||
<module name="TypeName"/> | ||
|
||
<!-- Imports --> | ||
<module name="UnusedImports"/> | ||
|
||
<!-- Formatting --> | ||
<module name="WhitespaceAround"/> | ||
<module name="WhitespaceAfter"/> | ||
<module name="Indentation"/> | ||
<module name="LeftCurly"/> | ||
<module name="RightCurly"/> | ||
|
||
<!-- Miscellaneous --> | ||
<module name="VisibilityModifier"/> | ||
<module name="NestedIfDepth"> | ||
<property name="max" value="3"/> | ||
</module> | ||
</module> | ||
</module> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.