Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    intellij plugin or pre-commit hook ideas?
    1 reply
    Chris Serra
    Has anyone created a Golang formatter for Spotless?
    1 reply
    Rajeev Kumar kallempudi

    i have integrated spotless gradle plugin in springboot application. build is successful in localmachine. But it is failing in aws code build.

    Error i get

    FAILURE: Build failed with an exception.
    * What went wrong:
    Could not determine the dependencies of task ':spotlessApply'.
    > Could not create task ':spotlessJavaApply'.
       > Could not create task ':spotlessJava'.
          > Cannot find git repository in any parent directory
    * 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
    BUILD FAILED in 25s
    @nedtwigg any help
    Ned Twigg
    You are using ratchetFrom
    But your CI is doing a bare checkout
    Search our GitHub isssues for bare checkout
    Chris Serra
    hi @nedtwigg -- we're looking to package up Spotless for Gradle as (to start) a Java formatter for internal Java projects. We'd like to limit the setup, so want to package it with an Eclipse XML, and other properties configured so that a Java project could just apply <our-wrapped-spotless> gradle plugin. I'm new to Gradle plugin development, so wondering if you had tips on this? As simple as possible -- just package up Eclipse XML, license header, and the spotless { ... } gradle task configurations so it's hands-off. Thanks!
    Ned Twigg
    1 reply
    Chris Serra
    cool, thanks!
    Ned Twigg
    Frank Vennemeyer
    Looking at the ⭕ CI history, it seems to me that the tests have sporadic problems to resolve / store Maven dependencies. The dependencies themselves and the repost configuration look fine to me. Is it a known problem? For different jobs and different dependencies (guava, slf4j,...) a NoSuchFileException occurs in the Gradle cache.
    Ned Twigg
    It has seemed flaky to me too (I very occasionally have to restart a test on a PR to fix a transient failure)
    I have no guesses re: cause
    David Smiley
    Hello. I'm investigating how best to forbid my Java source code from using C-style array declarations. I first went to the Google Java Formatter plugin and filed an issue -- google/google-java-format#615 but it's just a formatter so it was rejected. Error-Prone is another option but it seems more error oriented and less style oriented. Spotless seems like a sensible spot to add such a check maybe? Can someone suggest where/how the check might be added?
    Frank Vennemeyer
    FYI: Just preparing update of Eclipse based formatters for Eclipse release 4.20. JDT and Groovy formatters will no longer support Java 8. Hence Java 11 will be required for all new Eclipse formatters.
    Ned Twigg
    Sounds good! I think we should either A) adjust the default version based on the running JRE, or B) proactively throw an error about which versions require which JRE
    Probably should refactor the JRE detection to somewhere common, no opinion where
    Also fine to just let the errors and error reports come
    and we can add better error messages later
    Frank Vennemeyer
    I like the approach used for Google formatter step. Will provide a proposal.
    Hello! I've integrated spotless with Checkstyle in my project. There are few java files which Spotless ignores (might be because of the module directory) but checkstyle counts them, the tab space associate with the line and include it in the line length limit. As a result of this, I'm getting an error 'Line is longer than 140 characters'. Can someone help me with this?
    Gopal S Akshintala

    I see inconsistent continuation_indent for the same function call as I apply spotless. Top one has 8 while the bottom one has 4. Is this expected?


    My spotless config for java
    java {
        target("src/main/java/**/*.java", "src/test/java/**/*.java")
    Hi, spotless not removing the "unusedimports" in src/test/java files. My project is on Java11, gradle7 ..any solution for this issue ?