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

Gradle spotlessCheck task gets stuck if java text blocks are used #1655

Open
sujeet100 opened this issue Apr 5, 2023 · 0 comments
Open

Gradle spotlessCheck task gets stuck if java text blocks are used #1655

sujeet100 opened this issue Apr 5, 2023 · 0 comments
Labels

Comments

@sujeet100
Copy link

sujeet100 commented Apr 5, 2023

summary of problem
When java text blocks (multi line strings) are used in the code and when indentWithTabs(2) and indentWithSpaces(4) both the rules are included then the gradle task gets stuck

gradle or maven version
gradle: 7.6.1

spotless version
6.17.0

operating system and version
MacOS Ventura 13.1

spotless config

spotless {
    format 'misc', {
        target '*.gradle', '*.md', '.gitignore'

        trimTrailingWhitespace()
        indentWithTabs() // or spaces. Takes an integer argument if you don't like 4
        endWithNewline()
    }
    java {
        googleJavaFormat()
        indentWithTabs(2)
        indentWithSpaces(4)
        formatAnnotations()
        removeUnusedImports()
        trimTrailingWhitespace()
    }
}

test repo: https://github.com/sujeet100/spotless-bug

output of ./gradlew spotlessCheck --debug
`2023-04-05T11:38:16.945+0530 [DEBUG] [org.gradle.api.internal.tasks.execution.TaskExecution] Executing actions for task ':spotlessJava'.
2023-04-05T11:38:16.946+0530 [INFO] [org.gradle.api.Task] Not incremental: removing prior outputs
2023-04-05T11:38:16.946+0530 [DEBUG] [org.gradle.internal.file.impl.DefaultDeleter] Deleting /Users/sujit/projects/personal/spotless-bug/build/spotless/spotlessJava
2023-04-05T11:38:16.947+0530 [DEBUG] [org.gradle.api.Task] Applying format to /Users/sujit/projects/personal/spotless-bug/src/main/java/com/example/spotlessbug/SpotlessBugApplication.java and writing to /Users/sujit/projects/personal/spotless-bug/build/spotless/spotlessJava/src/main/java/com/example/spotlessbug/SpotlessBugApplication.java
2023-04-05T11:38:16.959+0530 [DEBUG] [org.gradle.api.Task] Applying format to /Users/sujit/projects/personal/spotless-bug/src/main/java/com/example/spotlessbug/Test.java and writing to /Users/sujit/projects/personal/spotless-bug/build/spotless/spotlessJava/src/main/java/com/example/spotlessbug/Test.java
2023-04-05T11:38:24.386+0530 [LIFECYCLE] [org.gradle.cache.internal.DefaultFileLockManager]
2023-04-05T11:38:24.386+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-04-05T11:38:24.386+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-04-05T11:38:24.387+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-04-05T11:38:24.387+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-04-05T11:38:24.387+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-04-05T11:38:24.387+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-04-05T11:38:34.386+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-04-05T11:38:34.386+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-04-05T11:38:34.386+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-04-05T11:38:34.386+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-04-05T11:38:34.387+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-04-05T11:38:34.387+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-04-05T11:38:44.386+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-04-05T11:38:44.387+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-04-05T11:38:44.387+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-04-05T11:38:44.388+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-04-05T11:38:44.388+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-04-05T11:38:44.388+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-04-05T11:38:46.920+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker: acquired lock on worker lease
2023-04-05T11:38:46.921+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker: released lock on worker lease
2023-04-05T11:38:46.921+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker: acquired lock on worker lease
2023-04-05T11:38:46.921+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker: released lock on worker lease
2023-04-05T11:38:46.921+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 10: acquired lock on worker lease
2023-04-05T11:38:46.921+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 10: released lock on worker lease
2023-04-05T11:38:46.921+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 9: acquired lock on worker lease
2023-04-05T11:38:46.922+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 9: released lock on worker lease
2023-04-05T11:38:46.922+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 8: acquired lock on worker lease
2023-04-05T11:38:46.922+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 8: released lock on worker lease
2023-04-05T11:38:46.922+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 7: acquired lock on worker lease
2023-04-05T11:38:46.922+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 7: released lock on worker lease
2023-04-05T11:38:46.922+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 4: acquired lock on worker lease
2023-04-05T11:38:46.922+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 4: released lock on worker lease
2023-04-05T11:38:46.922+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 6: acquired lock on worker lease
2023-04-05T11:38:46.922+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 6: released lock on worker lease
2023-04-05T11:38:46.922+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 5: acquired lock on worker lease
2023-04-05T11:38:46.922+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 5: released lock on worker lease
2023-04-05T11:38:46.923+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 3: acquired lock on worker lease
2023-04-05T11:38:46.923+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 3: released lock on worker lease
2023-04-05T11:38:46.923+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 2: acquired lock on worker lease
2023-04-05T11:38:46.923+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 2: released lock on worker lease
2023-04-05T11:38:46.923+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 11: acquired lock on worker lease
2023-04-05T11:38:46.923+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 11: released lock on worker lease
2023-04-05T11:38:54.386+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-04-05T11:38:54.386+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-04-05T11:38:54.386+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-04-05T11:38:54.387+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-04-05T11:38:54.387+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-04-05T11:38:54.387+0530 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
<==-----------> 16% EXECUTING [42s]

:spotlessJava

`
The gradle task gets stuck

@nedtwigg nedtwigg added the bug label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants