Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Timur
    @timkabot
    image.png
    Alexey Kotlyarov
    @koterpillar
    Does spotless (for Gradle) add jcenter repository to the build?
    Ned Twigg
    @nedtwigg
    Spotless uses, but does not modify, the buildscript repositories. In older versions of Gradle, I think the buildscript repository defaults includes jcenter
    Frank Vennemeyer
    @fvgh
    @nedtwigg , please have a look at the latest : eclipse-groovy:changelogPush . Looks like a ⭕ setup problem to me.
    Ned Twigg
    @nedtwigg
    @fvgh I think it's a deeper issue from the jcenter sunset. We have always published via jcenter -> mavencentral, but jcenter stopped accepting new uploads. I promise I'll have it resolved by end of the week, hopefully sooner.
    Jonathan Bluett-Duncan
    @jbduncan
    @nedtwigg If there's anything we can do to help, please let us know. :)
    Ned Twigg
    @nedtwigg
    @fvgh the ⭕problem is fixed, ext deploy works again, groovy 4.0 is published now: diffplug/spotless@6e40b41
    Frank Vennemeyer
    @fvgh
    Thanks Ned. Will provide the Eclipse updates this weekend.
    gmmurugan
    @gmmurugan
    intellij plugin or pre-commit hook ideas?
    1 reply
    Chris Serra
    @chris-serra
    Has anyone created a Golang formatter for Spotless?
    1 reply
    Rajeev Kumar kallempudi
    @rajeevprasanna

    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
    @nedtwigg
    You are using ratchetFrom
    But your CI is doing a bare checkout
    Search our GitHub isssues for bare checkout
    Chris Serra
    @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
    @nedtwigg
    1 reply
    Chris Serra
    @chris-serra
    cool, thanks!
    Ned Twigg
    @nedtwigg
    Frank Vennemeyer
    @fvgh
    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
    @nedtwigg
    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
    @dsmiley
    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
    @fvgh
    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
    @nedtwigg
    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
    @fvgh
    I like the approach used for Google formatter step. Will provide a proposal.
    Owais
    @owaiskazi19_twitter
    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
    @overfullstack
    image.png

    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?

    java

    My spotless config for java
    java {
        target("src/main/java/**/*.java", "src/test/java/**/*.java")
        targetExclude("$buildDir/generated/**/*.*")
        importOrder()
        removeUnusedImports()
        googleJavaFormat("1.11.0")
        trimTrailingWhitespace()
        indentWithSpaces(2)
        endWithNewline()
      }
    hyginous29
    @hyginous29
    Hi, spotless not removing the "unusedimports" in src/test/java files. My project is on Java11, gradle7 ..any solution for this issue ?