Mercurial equivalent for ratchetFrom

Open
#2,116 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
git, kotlin
Domain
build-system

Research direction

Start by reading the ratchetFrom support exposed through SpotlessExtension and the spotlessApply task, then examine how the current Git-only behavior relates to the requested Mercurial workflow. Done means Spotless can run formatting only on modified files in the reported Gradle/Kotlin setup through a documented Mercurial equivalent.

Written by the indexing model from the issue text.

Description

enhancement

We have a large Kotlin project where we use spotless.
However, it is pretty slow. I came across the ratchetFrom property but seems like it is only for Git.
How can I make spotless run on just modified files to make the build faster?
 

  • Gradle
  • spotless version - 6.23.3
  • operating system and version - Mac OSX 14.4.1

configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
target("/*.kt", "/.kts")
targetExclude("$buildDir/**/
", "/build//", "/node_modules//")
ktfmt(findProperty("cbrKtfmtVersion")!! as String)
}
}

tasks.getByName("build") {
group = "build"
dependsOn("spotlessApply")
}

Dominant language
Java
Stars
5.7k
Forks
560
Avg merge
1d 13h
Merged PRs (30d)
43

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from diffplug/spotless

All issues in diffplug/spotless

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.