Skip to content

Commit

Permalink
Fix SpotBugs config to allow running multiple plugins (#256)
Browse files Browse the repository at this point in the history
Closes #255 

---

The semi-colon `;` is being interpreted as a command separator rather
than a separator for the plugin list. Changing it to colon `:` fixes the
issue.
  • Loading branch information
tharakadesilva authored Apr 23, 2024
1 parent 87f46b0 commit c3f1a38
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/tests_and_lints/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ spotbugs_config(
fail_on_warning = True,
plugin_list = [
"@maven//:com_h3xstream_findsecbugs_findsecbugs_plugin",
"@maven//:com_mebigfatguy_sb_contrib_sb_contrib",
],
visibility = ["//visibility:public"],
)
1 change: 1 addition & 0 deletions examples/tests_and_lints/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ maven.install(
"org.junit.platform:junit-platform-reporting:1.8.2",
"com.github.spotbugs:spotbugs:4.7.3",
"com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0",
"com.mebigfatguy.sb-contrib:sb-contrib:7.6.4",
],
fetch_sources = True,
lock_file = "//:maven_install.json",
Expand Down
70 changes: 68 additions & 2 deletions examples/tests_and_lints/maven_install.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL",
"__INPUT_ARTIFACTS_HASH": -2039795700,
"__RESOLVED_ARTIFACTS_HASH": 995485706,
"__INPUT_ARTIFACTS_HASH": 1135924492,
"__RESOLVED_ARTIFACTS_HASH": -40360662,
"conflict_resolution": {
"com.google.code.gson:gson:2.8.9": "com.google.code.gson:gson:2.9.1",
"com.google.errorprone:error_prone_annotations:2.3.2": "com.google.errorprone:error_prone_annotations:2.11.0"
Expand Down Expand Up @@ -98,13 +98,41 @@
},
"version": "1.12.0"
},
"com.mebigfatguy.sb-contrib:sb-contrib": {
"shasums": {
"jar": "2236944beeacaa89a2f2c95cd79b399c06975254c255b3d54251d6f79ae77d3e",
"sources": "c807ff6b7aa16a1e9233febfe3803a556ef585775ffadb750226a4f35fa6d330"
},
"version": "7.6.4"
},
"commons-codec:commons-codec": {
"shasums": {
"jar": "b3e9f6d63a790109bf0d056611fbed1cf69055826defeb9894a71369d246ed63",
"sources": "7019940b2298d333edb946e2db3d10f1caacbbd52bb64e85832cfd0017e049cc"
},
"version": "1.15"
},
"jakarta.activation:jakarta.activation-api": {
"shasums": {
"jar": "8b0a0f52fa8b05c5431921a063ed866efaa41dadf2e3a7ee3e1961f2b0d9645b",
"sources": "e9638b764202c0def1b4d54bd37a984c681b2ed46a548ae94ef3f7e4a4b58a31"
},
"version": "1.2.1"
},
"jakarta.annotation:jakarta.annotation-api": {
"shasums": {
"jar": "85fb03fc054cdf4efca8efd9b6712bbb418e1ab98241c4539c8585bbc23e1b8a",
"sources": "aa27e9291dce4ddbb0aea52a1cbef41c6330b96b0ae387a995ed412b68a3af7c"
},
"version": "1.3.5"
},
"jakarta.xml.bind:jakarta.xml.bind-api": {
"shasums": {
"jar": "69156304079bdeed9fc0ae3b39389f19b3cc4ba4443bc80508995394ead742ea",
"sources": "61ceb3ed35ecf99f1803eac9c4b8f12103c7531952beae38ba53cc727f405532"
},
"version": "2.3.2"
},
"jaxen:jaxen": {
"shasums": {
"jar": "70feef9dd75ad064def05a3ce8975aeba515ee7d1be146d12199c8828a64174c",
Expand Down Expand Up @@ -405,6 +433,13 @@
"org.checkerframework:checker-qual",
"org.ow2.asm:asm"
],
"com.mebigfatguy.sb-contrib:sb-contrib": [
"jakarta.annotation:jakarta.annotation-api",
"jakarta.xml.bind:jakarta.xml.bind-api"
],
"jakarta.xml.bind:jakarta.xml.bind-api": [
"jakarta.activation:jakarta.activation-api"
],
"junit:junit": [
"org.hamcrest:hamcrest-core"
],
Expand Down Expand Up @@ -653,6 +688,13 @@
"com.h3xstream.findsecbugs.xpath",
"com.h3xstream.findsecbugs.xss"
],
"com.mebigfatguy.sb-contrib:sb-contrib": [
"com.mebigfatguy.fbcontrib",
"com.mebigfatguy.fbcontrib.collect",
"com.mebigfatguy.fbcontrib.debug",
"com.mebigfatguy.fbcontrib.detect",
"com.mebigfatguy.fbcontrib.utils"
],
"commons-codec:commons-codec": [
"org.apache.commons.codec",
"org.apache.commons.codec.binary",
Expand All @@ -662,6 +704,22 @@
"org.apache.commons.codec.language.bm",
"org.apache.commons.codec.net"
],
"jakarta.activation:jakarta.activation-api": [
"javax.activation"
],
"jakarta.annotation:jakarta.annotation-api": [
"javax.annotation",
"javax.annotation.security",
"javax.annotation.sql"
],
"jakarta.xml.bind:jakarta.xml.bind-api": [
"javax.xml.bind",
"javax.xml.bind.annotation",
"javax.xml.bind.annotation.adapters",
"javax.xml.bind.attachment",
"javax.xml.bind.helpers",
"javax.xml.bind.util"
],
"jaxen:jaxen": [
"org.jaxen",
"org.jaxen.dom",
Expand Down Expand Up @@ -1289,8 +1347,16 @@
"com.google.truth:truth:jar:sources",
"com.h3xstream.findsecbugs:findsecbugs-plugin",
"com.h3xstream.findsecbugs:findsecbugs-plugin:jar:sources",
"com.mebigfatguy.sb-contrib:sb-contrib",
"com.mebigfatguy.sb-contrib:sb-contrib:jar:sources",
"commons-codec:commons-codec",
"commons-codec:commons-codec:jar:sources",
"jakarta.activation:jakarta.activation-api",
"jakarta.activation:jakarta.activation-api:jar:sources",
"jakarta.annotation:jakarta.annotation-api",
"jakarta.annotation:jakarta.annotation-api:jar:sources",
"jakarta.xml.bind:jakarta.xml.bind-api",
"jakarta.xml.bind:jakarta.xml.bind-api:jar:sources",
"jaxen:jaxen",
"jaxen:jaxen:jar:sources",
"junit:junit",
Expand Down
2 changes: 1 addition & 1 deletion java/private/spotbugs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def _spotbugs_impl(ctx):
runfiles.append(exclude_filter)

if plugin_list:
plugin_list_cli_flag = ";".join([plugin.short_path for plugin in plugin_list])
plugin_list_cli_flag = ":".join([plugin.short_path for plugin in plugin_list])
flags.extend(["-pluginList", plugin_list_cli_flag])
runfiles.extend(plugin_list)

Expand Down

0 comments on commit c3f1a38

Please sign in to comment.