Skip to content

Commit

Permalink
Add Jacoco, Error Prone, CheckStyle (#75)
Browse files Browse the repository at this point in the history
* Prep for 3.0.0 release

* Add ErrorProne, CheckStyle, Jacoco, fix violations
  • Loading branch information
JPercival authored Feb 29, 2024
1 parent 1a52137 commit fd34939
Show file tree
Hide file tree
Showing 16 changed files with 180 additions and 36 deletions.
10 changes: 10 additions & 0 deletions .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
58 changes: 58 additions & 0 deletions config/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">

<!--
Derived Checkstyle configuration that checks the Google naming conventions from Google Java Style
that can be found at https://google.github.io/styleguide/javaguide.html Formatting conventions are
enforced by the spotless plugin.
This configuration is based on the Google Checks that can be found at:
https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
-->

<module name="Checker">
<property name="charset" value="UTF-8" />
<property name="fileExtensions" value="java, properties, xml" />

<module name="SuppressWarningsFilter" />

<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/filefilters/index.html -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$" />
</module>

<module name="TreeWalker">
<!-- Make the @SuppressWarnings annotations available to Checkstyle -->
<module name="SuppressWarningsHolder" />
<module name="AbstractClassName">
<property name="format" value="^(Base|Abstract).+$" />
</module>
<module name="MemberName">
<property name="format"
value="^(?!((m|s|my|our|the)[A-Z])[a-zA-Z0-9]*)([a-z][a-zA-Z0-9]*)$" />
<message key="name.invalidPattern"
value="Member ''{0}'' should be named with camelCase and without prefixes." />
</module>
<module name="ParameterName">
<property name="format"
value="^(?!((m|s|my|our|the)[A-Z])[a-zA-Z0-9]*)([a-z][a-zA-Z0-9]*)$" />
<message key="name.invalidPattern"
value="Member ''{0}'' should be named with camelCase and without prefixes." />
</module>
<module name="MethodName">
<property name="format"
value="^(?!((m|s|my|our|the)[A-Z])[a-zA-Z0-9]*)([a-z][a-zA-Z0-9]*)$" />
<message key="name.invalidPattern"
value="Member ''{0}'' should be named with camelCase and without prefixes." />
</module>
<module name="StaticVariableName">
<property name="format"
value="^(?!((m|s|my|our|the)[A-Z])[a-zA-Z0-9]*)([a-z][a-zA-Z0-9]*)$" />
<message key="name.invalidPattern"
value="Member ''{0}'' should be named with camelCase and without prefixes." />
</module>
<module name="NoFinalizer" />
</module>
</module>
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.opencds.cqf.cql.ls</groupId>
<artifactId>cql-ls</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
</parent>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions debug/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
<parent>
<groupId>org.opencds.cqf.cql.ls</groupId>
<artifactId>cql-ls</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<dependencies>
<dependency>
<groupId>org.opencds.cqf.cql.ls</groupId>
<artifactId>cql-ls-core</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
Expand Down
4 changes: 2 additions & 2 deletions debug/service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
<parent>
<groupId>org.opencds.cqf.cql.ls</groupId>
<artifactId>cql-ls</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<dependencies>
<dependency>
<groupId>org.opencds.cqf.cql.debug</groupId>
<artifactId>cql-debug-server</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
4 changes: 2 additions & 2 deletions ls/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.opencds.cqf.cql.ls</groupId>
<artifactId>cql-ls</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand All @@ -29,7 +29,7 @@
<dependency>
<groupId>org.opencds.cqf.cql.ls</groupId>
<artifactId>cql-ls-core</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.opencds.cqf.cql.ls.server.event;

abstract class Event<T> {
abstract class BaseEvent<T> {

private T params;

protected Event(T params) {
protected BaseEvent(T params) {
this.params = params;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.eclipse.lsp4j.DidChangeTextDocumentParams;

public class DidChangeTextDocumentEvent extends Event<DidChangeTextDocumentParams> {
public class DidChangeTextDocumentEvent extends BaseEvent<DidChangeTextDocumentParams> {
public DidChangeTextDocumentEvent(DidChangeTextDocumentParams params) {
super(params);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.eclipse.lsp4j.DidChangeWatchedFilesParams;

public class DidChangeWatchedFilesEvent extends Event<DidChangeWatchedFilesParams> {
public class DidChangeWatchedFilesEvent extends BaseEvent<DidChangeWatchedFilesParams> {
public DidChangeWatchedFilesEvent(DidChangeWatchedFilesParams params) {
super(params);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.eclipse.lsp4j.DidCloseTextDocumentParams;

public class DidCloseTextDocumentEvent extends Event<DidCloseTextDocumentParams> {
public class DidCloseTextDocumentEvent extends BaseEvent<DidCloseTextDocumentParams> {
public DidCloseTextDocumentEvent(DidCloseTextDocumentParams params) {
super(params);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.eclipse.lsp4j.DidOpenTextDocumentParams;

public class DidOpenTextDocumentEvent extends Event<DidOpenTextDocumentParams> {
public class DidOpenTextDocumentEvent extends BaseEvent<DidOpenTextDocumentParams> {
public DidOpenTextDocumentEvent(DidOpenTextDocumentParams params) {
super(params);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.eclipse.lsp4j.DidSaveTextDocumentParams;

public class DidSaveTextDocumentEvent extends Event<DidSaveTextDocumentParams> {
public class DidSaveTextDocumentEvent extends BaseEvent<DidSaveTextDocumentParams> {
public DidSaveTextDocumentEvent(DidSaveTextDocumentParams params) {
super(params);
}
Expand Down
4 changes: 2 additions & 2 deletions ls/service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
<parent>
<groupId>org.opencds.cqf.cql.ls</groupId>
<artifactId>cql-ls</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<dependencies>
<dependency>
<groupId>org.opencds.cqf.cql.ls</groupId>
<artifactId>cql-ls-server</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
6 changes: 3 additions & 3 deletions plugin/debug/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
<parent>
<groupId>org.opencds.cqf.cql.ls</groupId>
<artifactId>cql-ls</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../..</relativePath>
</parent>

<dependencies>
<dependency>
<groupId>org.opencds.cqf.cql.ls</groupId>
<artifactId>cql-ls-server</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.opencds.cqf.cql.debug</groupId>
<artifactId>cql-debug-server</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ public class DebugCommandContribution implements CommandContribution {

public DebugCommandContribution(CqlCompilationManager cqlCompilationManager) {
this.cqlCompilationManager = cqlCompilationManager;

// Temporary hack for unused variable
this.cqlCompilationManager.hashCode();
}

@Override
Expand Down
Loading

0 comments on commit fd34939

Please sign in to comment.