Skip to content

Commit

Permalink
Added infrastructure for lint checks via spotbugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
eriq-augustine committed Jul 4, 2021
1 parent 8f80c38 commit 35062c0
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .ci/spotbugs-exclude.xml
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter
xmlns="https://github.com/spotbugs/filter/3.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">

<Match>
<!-- Note that the reports we want to ignore occur in anynonymous classes, so we need a regex. -->
<Class name="~org.linqs.psl.application.learning.weight.maxlikelihood.MaxPiecewisePseudoLikelihood\$\d+" />
<Bug pattern="DMI_RANDOM_USED_ONLY_ONCE" />
</Match>

<Match>
<Class name="org.linqs.psl.application.learning.weight.search.bayesian.SquaredExpKernel" />
<Method name="kernel" />
<Bug pattern="RV_RETURN_VALUE_IGNORED_INFERRED" />
</Match>

<Match>
<Class name="org.linqs.psl.reasoner.term.MemoryVariableTermStore" />
<Method name="updateModelAtoms" />
<Bug pattern="WMI_WRONG_MAP_ITERATOR" />
</Match>

<Match>
<Class name="org.linqs.psl.util.RandUtils" />
<Bug pattern="DMI_RANDOM_USED_ONLY_ONCE" />
</Match>

</FindBugsFilter>
16 changes: 16 additions & 0 deletions pom.xml
Expand Up @@ -65,6 +65,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<rootdir>${project.basedir}</rootdir>
</properties>

<dependencies>
Expand Down Expand Up @@ -127,6 +128,21 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.2.0</version>
<dependencies>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs</artifactId>
<version>4.2.3</version>
</dependency>
</dependencies>
<configuration>
<excludeFilterFile>${rootdir}/.ci/spotbugs-exclude.xml</excludeFilterFile>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
4 changes: 4 additions & 0 deletions psl-cli/pom.xml
Expand Up @@ -29,6 +29,10 @@
<version>2.3.0-SNAPSHOT</version>
</parent>

<properties>
<rootdir>${project.basedir}/..</rootdir>
</properties>

<dependencies>
<dependency>
<groupId>org.linqs</groupId>
Expand Down
4 changes: 4 additions & 0 deletions psl-core/pom.xml
Expand Up @@ -29,6 +29,10 @@
<version>2.3.0-SNAPSHOT</version>
</parent>

<properties>
<rootdir>${project.basedir}/..</rootdir>
</properties>

<dependencies>
<!-- linear algebra dependencies -->
<dependency>
Expand Down
4 changes: 4 additions & 0 deletions psl-java/pom.xml
Expand Up @@ -29,6 +29,10 @@
<version>2.3.0-SNAPSHOT</version>
</parent>

<properties>
<rootdir>${project.basedir}/..</rootdir>
</properties>

<dependencies>
<dependency>
<groupId>org.linqs</groupId>
Expand Down
4 changes: 4 additions & 0 deletions psl-parser/pom.xml
Expand Up @@ -30,6 +30,10 @@
<version>2.3.0-SNAPSHOT</version>
</parent>

<properties>
<rootdir>${project.basedir}/..</rootdir>
</properties>

<dependencies>
<dependency>
<groupId>org.linqs</groupId>
Expand Down
4 changes: 4 additions & 0 deletions psl-python/pom.xml
Expand Up @@ -30,6 +30,10 @@
<version>2.3.0-SNAPSHOT</version>
</parent>

<properties>
<rootdir>${project.basedir}/..</rootdir>
</properties>

<dependencies>
<dependency>
<groupId>org.linqs</groupId>
Expand Down

0 comments on commit 35062c0

Please sign in to comment.