Skip to content

Commit

Permalink
Merge pull request #2005 from lf-lang/spotbugs
Browse files Browse the repository at this point in the history
Apply spotbugs plugin
  • Loading branch information
cmnrd authored Sep 14, 2023
2 parents ddf67f3 + 9ea0a85 commit 30271bd
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
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

0 comments on commit 30271bd

Please sign in to comment.