Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

java: add proper lint task to CI #581

Merged
merged 3 commits into from
Mar 23, 2021
Merged

java: add proper lint task to CI #581

merged 3 commits into from
Mar 23, 2021

Conversation

axic
Copy link
Member

@axic axic commented Mar 22, 2021

@axic
Copy link
Member Author

axic commented Mar 22, 2021

Current failures:

* What went wrong:
Execution failed for task ':spotlessJava'.
> The following files had format violations:
      java/src/main/java/org/ethereum/evmc/EvmcLoaderException.java
          @@ -4,7 +4,7 @@
           package·org.ethereum.evmc;
           
           public·class·EvmcLoaderException·extends·Exception·{
          -···public·EvmcLoaderException(String·message)·{
          -······super(message);
          -···}
          +··public·EvmcLoaderException(String·message)·{
          +····super(message);
          +··}
           }
      java/src/main/java/org/ethereum/evmc/EvmcVm.java
          @@ -3,8 +3,6 @@
           //·Licensed·under·the·Apache·License,·Version·2.0.
           package·org.ethereum.evmc;
           
          -import·org.ethereum.evmc.EvmcLoaderException;
          -
           import·java.nio.ByteBuffer;
           import·java.util.Objects;
           
          @@ -21,7 +19,7 @@
           ···*·This·method·loads·the·specified·evm·shared·library·and·loads/initializes·the·jni·bindings.
           ···*
           ···*·@param·filename·/path/filename·of·the·evm·shared·object
          -···*·@throws·EvmcLoaderException
          +···*·@throws·org.ethereum.evmc.EvmcLoaderException
           ···*/
           ··public·static·EvmcVm·create(String·filename)·throws·EvmcLoaderException·{
           ····if·(!EvmcVm.isEvmcLibraryLoaded)·{
          @@ -49,7 +47,7 @@
           ···*
           ···*·@param·Path·to·the·dynamic·object·representing·the·EVM·implementation.
           ···*·@return·Internal·object·pointer.
          -···*·@throws·EvmcLoaderException
          +···*·@throws·org.ethereum.evmc.EvmcLoaderException
           ···*/
           ··private·static·native·ByteBuffer·load_and_create(String·filename)·throws·EvmcLoaderException;
           
          @@ -152,9 +150,7 @@
           ··/**·get·size·of·result·struct·*/
           ··private·static·native·int·get_result_size();
           
          -··/**
          -···*·This·method·cleans·up·resources.
          -···*/
          +··/**·This·method·cleans·up·resources.·*/
           ··@Override
           ··public·void·close()·{
      ... (1 more lines that didn't fit)
  Violations also present in:
      java/src/main/java/org/ethereum/evmc/Host.java
  Run 'gradlew spotlessApply' to fix these violations.

@@ -8,6 +8,9 @@ SOURCE_DIR = $(realpath $(CURDIR)/../..)
OUT_DIR = $(CURDIR)/c/build
BUILD_DIR = $(OUT_DIR)/_cmake_build

lint: gradlew
./gradlew --no-daemon clean spotlessCheck

build: gradlew $(OUT_DIR)/lib/libevmc-java.so
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also make build depend on lint. And rename the gradlew task to gradle-setup. And reorder the file.

- run:
name: "Java Test"
command: |
cd bindings/java && make test
command: cd bindings/java && make test
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove these whitespaces changes.

@axic axic requested review from chfast and atoulme March 22, 2021 22:58
@axic axic marked this pull request as ready for review March 22, 2021 22:59
@axic axic mentioned this pull request Mar 22, 2021
Copy link
Collaborator

@atoulme atoulme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@chfast chfast merged commit 77122cf into master Mar 23, 2021
@chfast chfast deleted the java-lint branch March 23, 2021 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants