Skip to content
New issue

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

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

Already on GitHub? # to your account

IllegalArgumentException if analysing file in root of Windows mountpoint #760

Closed
davidburstromspotify opened this issue Dec 25, 2020 · 1 comment · Fixed by #769
Closed
Labels

Comments

@davidburstromspotify
Copy link

Given these Gradle files, if they are put in the root of a Windows mount point, the subpath extraction fails when running the spotlessGroovyGradle task.

settings.gradle:

rootProject.name = 'bug' // required because of a Gradle bug/feature when the project is in the root

build.gradle:

plugins {
    id 'com.diffplug.spotless' version '5.8.2'
}

spotless {
    groovyGradle {
        target('*.gradle')
        greclipse()
    }   
}

Relevant failure output:

$ gradle :spotlessGroovyGradle -s
> Task :spotlessGroovyGradle FAILED

Caused by: java.lang.IllegalArgumentException: Expected 'S:/build.gradle' to start with 'S://'
        at com.diffplug.spotless.FileSignature.subpath(FileSignature.java:203)
        at com.diffplug.spotless.extra.GitAttributesLineEndings$CachedEndings.endingFor(GitAttributesLineEndings.java:127)
        at com.diffplug.spotless.extra.GitAttributesLineEndings$RelocatablePolicy.getEndingFor(GitAttributesLineEndings.java:95)
        at com.diffplug.spotless.Formatter.computeLineEndings(Formatter.java:211)
        at com.diffplug.spotless.PaddedCell.calculateDirtyState(PaddedCell.java:203)
        at com.diffplug.spotless.PaddedCell.calculateDirtyState(PaddedCell.java:188)
        at com.diffplug.gradle.spotless.SpotlessTaskImpl.processInputFile(SpotlessTaskImpl.java:71)
        at com.diffplug.gradle.spotless.SpotlessTaskImpl.performAction(SpotlessTaskImpl.java:57)

Gradle version: 6.7.1
Spotless version: 5.8.2.
JDK version: 1.8.0_252
Operating System: Windows 10 in VirtualBox VM

@nedtwigg
Copy link
Member

nedtwigg commented Jan 4, 2021

Fixed in plugin-gradle 5.9.0 and plugin-maven 2.7.0.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants