Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Apply spotbugs plugin #2005

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ dependencies {
// https://mvnrepository.com/artifact/com.diffplug.spotless/spotless-lib-extra
implementation group: 'com.diffplug.spotless', name: 'spotless-lib-extra', version: spotlessLibVersion

implementation group: 'com.github.spotbugs.snom', name: 'spotbugs-gradle-plugin', version: spotbugsPluginVersion

implementation "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
implementation "com.diffplug.spotless:spotless-plugin-gradle:$spotlessVersion"

Expand Down
3 changes: 2 additions & 1 deletion buildSrc/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
spotlessVersion=6.11.0
spotlessLibVersion=2.30.0
kotlinVersion=1.6.21
shadowJarVersion=7.1.2
shadowJarVersion=7.1.2
spotbugsPluginVersion=5.1.3
10 changes: 10 additions & 0 deletions buildSrc/src/main/groovy/org.lflang.java-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'java'
id 'com.diffplug.spotless'
id 'org.lflang.platform'
id 'com.github.spotbugs'
}

repositories {
Expand All @@ -19,6 +20,15 @@ spotless {
}
}

spotbugs {
toolVersion = spotbugsToolVersion
excludeFilter.set(
rootProject.file('config/spotbugs/exclude.xml')
)
ignoreFailures = true
}


configurations.all {
resolutionStrategy {
dependencySubstitution {
Expand Down
20 changes: 20 additions & 0 deletions config/spotbugs/exclude.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<Match>
<Or>
<Package name="org.lflang.dsl*"/>
<Package name="org.lflang.parser.antlr"/>
<Package name="~org.lflang.parser.antlr\..*"/>
<Package name="org.lflang.lf"/>
<Package name="~org.lflang.lf\..*"/>
<Package name="org.lflang.services"/>
<Package name="~org.lflang.services\..*"/>
<Package name="org.lflang.serializer"/>
<Package name="~org.lflang.serializer\..*"/>
<Package name="org.lflang.ide.contentassist"/>
<Package name="~org.lflang.ide.contentassist\..*"/>
<Class name="org.lflang.ide.AbstractLFIdeModule"/>
<Class name="org.lflang.tests.LFInjectorProvider"/>
</Or>
</Match>
</FindBugsFilter>
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ xtextVersion=2.31.0
klighdVersion=2.3.0.v20230606
freehepVersion=2.4
swtVersion=3.124.0
spotbugsToolVersion=4.7.3

[manifestPropertyNames]
org.eclipse.xtext=xtextVersion
Expand Down