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

Add Spotless Fail Fast to the build process #7515

Merged
merged 5 commits into from
Aug 27, 2024

Conversation

7suyash7
Copy link
Contributor

#6588
Add Spotless fail fast to the build process.

Output:

 ./gradlew build            ok  3s  19:34:06

> Configure project :
Generating project version as supplied is version not semver: unspecified

> Task :ethereum:core:spotlessJavaCheck FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ethereum:core:spotlessJavaCheck'.
> The following files had format violations:
      src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java
          @@ -337,15 +337,15 @@
           ······return·Optional.empty();
           ····}

          -········transactionBuilder.guessType();
          +····transactionBuilder.guessType();
           ····if·(transactionBuilder.getTransactionType().supportsBlob())·{
           ······transactionBuilder.maxFeePerBlobGas(maxFeePerBlobGas);
           ····}
           ····if·(transactionBuilder.getTransactionType().requiresChainId())·{
          -····transactionBuilder.chainId(
          +······transactionBuilder.chainId(
           ··········protocolSchedule
          -······.getChainId()
          -······.orElse(BigInteger.ONE));·//·needed·to·make·some·transactions·valid
          +··············.getChainId()
          +··············.orElse(BigInteger.ONE));·//·needed·to·make·some·transactions·valid
           ····}

           ····final·Transaction·transaction·=·transactionBuilder.build();
  Run './gradlew :ethereum:core:spotlessApply' to fix these violations.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.8/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 15s
253 actionable tasks: 4 executed, 249 up-to-date

Signed-off-by: 7suyash7 <suyashnyn1@gmail.com>
@macfarla macfarla requested a review from usmansaleem August 26, 2024 02:55
build.gradle Outdated
}

check.dependsOn spotlessCheckFast
Copy link
Member

Choose a reason for hiding this comment

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

can you move it line number 470 i.e. check.dependsOn('checkPluginAPIChanges', 'checkMavenCoordinateCollisions', 'spotlessCheckFast') ?

Copy link
Member

@usmansaleem usmansaleem left a comment

Choose a reason for hiding this comment

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

One minor change, otherwise looks good to me.

Signed-off-by: 7suyash7 <suyashnyn1@gmail.com>
@7suyash7
Copy link
Contributor Author

One minor change, otherwise looks good to me.

Done

@usmansaleem usmansaleem enabled auto-merge (squash) August 27, 2024 01:39
@usmansaleem usmansaleem linked an issue Aug 27, 2024 that may be closed by this pull request
@usmansaleem usmansaleem merged commit c656ece into hyperledger:main Aug 27, 2024
40 checks passed
@fab-10
Copy link
Contributor

fab-10 commented Aug 28, 2024

Can we have the spotless check enabled only when calling ./gradlew build? Because now it runs every compilation tasks, for example also when making a simple code change and running a test, this add a delay and it is also a bit useless to do spotless check when just commenting some lines or testing a quick change

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.

gradle build - fail fast if spotless errors
4 participants