Skip to content

Commit

Permalink
Make maven and gradle share checkstyle configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasPerkins1123 committed Feb 14, 2024
1 parent 531c3e0 commit 6522ab6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 7 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ tasks.named('test') {
}

checkstyle {
configFile file("${project.rootDir}/src/checkstyle/nohttp-checkstyle.xml")
configDirectory = project.file('src/checkstyle')
configFile = file('src/checkstyle/nohttp-checkstyle.xml')
}

checkstyleNohttp {
configDirectory = project.file('src/checkstyle')
configFile = file('src/checkstyle/nohttp-checkstyle.xml')
}

tasks.named("formatMain").configure { dependsOn("checkstyleMain") }
Expand Down
11 changes: 0 additions & 11 deletions config/nohttp/suppressions.xml

This file was deleted.

4 changes: 3 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,12 @@
<phase>validate</phase>
<configuration>
<configLocation>src/checkstyle/nohttp-checkstyle.xml</configLocation>
<suppressionsLocation>src/checkstyle/nohttp-checkstyle-suppressions.xml</suppressionsLocation>
<sourceDirectories>${basedir}</sourceDirectories>
<includes>**/*</includes>
<excludes>**/.git/**/*,**/.idea/**/*,**/target/**/,**/.flattened-pom.xml,**/*.class</excludes>
<propertyExpansion>
config_loc=${basedir}/src/checkstyle/
</propertyExpansion>
</configuration>
<goals>
<goal>check</goal>
Expand Down
3 changes: 3 additions & 0 deletions src/checkstyle/nohttp-checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
"https://checkstyle.org/dtds/configuration_1_2.dtd">
<module name="com.puppycrawl.tools.checkstyle.Checker">
<module name="io.spring.nohttp.checkstyle.check.NoHttpCheck"/>
<module name="SuppressionFilter">
<property name="file" value="${config_loc}/nohttp-checkstyle-suppressions.xml"/>
</module>
</module>

0 comments on commit 6522ab6

Please sign in to comment.