diffplug / diffplug/spotless

Task Failures with gradle LockMode.STRICT

Ouverte
#2,906 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
5.7k
Forks
561
Merge moyen
1 j 14 h
PR mergées (30 j)
43

Description

I enabled gradle dependency locking by following https://docs.gradle.org/current/userguide/dependency_locking.html

When setting the following in the root configuration:

```kotlin
dependencyLocking {
lockAllConfigurations()
lockMode = LockMode.STRICT
}
```

I get failures when running `spotlessCheck` and `spotlessApply`:

```
> Task :spotlessKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':spotlessKotlin'.
> You need to add a repository containing the '[com.pinterest.ktlint:ktlint-cli:1.8.0]' artifact in 'build.gradle'.
E.g.: 'repositories { mavenCentral() }'
```

A workaround is to override the `lockMode` in the `spotless` configuration:

```kotlin
spotless {
configurations.compileClasspath {
dependencyLocking {
lockMode = LockMode.LENIENT
}
}
}
```

But it would be nice if it were possible to lock the ktlint version and allow running with `LockMode.STRICT` all the way :)

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la configuration root de dependencyLocking et la configuration de Spotless présentées dans le rapport, puis reproduisez l’échec avec spotlessCheck et spotlessApply sous LockMode.STRICT. Comparez les configurations stricte et permissive et vérifiez que la version de ktlint peut être verrouillée tandis que les deux tâches Spotless se terminent correctement.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
kotlin
Domaine
build-system
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
55/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.