question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom Spotless Task

See original GitHub issue

Hello!

I’m trying to create a custom spotless task that only acts on files changed in git. I would also like the option to act on all files, so ideally I would have two separate tasks. For example, spotlessJavaCheck should check the pattern **/*.java, while spotlessChangedCheck should check only the files changed in git.

I’ve already written a function in the build script which identifies the changed files, and I would like to set the spotless target to these files.

Any advice?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:29 (29 by maintainers)

github_iconTop GitHub Comments

1reaction
t-rad679commented, Feb 18, 2020

Ok that makes sense. Thank you for all the input you’ve given up to this point! I sincerely appreciate it; it has been quite helpful. I will keep looking into this and report back to let you and anyone else who is curious what I find.

For now I’ll close the ticket. Feel free to reopen if you like.

0reactions
nedtwiggcommented, Jun 5, 2020

FYI, -PspotlessFiles has been deprecated and will be removed. Migration path available here: https://github.com/diffplug/spotless/pull/602

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spotless on Android - Medium
Automate pre-commit script setup. Let's go back to the spotless.gradle file (or wherever you choose to define your spotless configuration) and add this...
Read more >
diffplug/spotless - Gitter
First solution: just run ./gradlew spotlessApply build or ./gradlew spotlessApply check instead of just ./gradlew [build|check] . Spotless is reasonably fast, ...
Read more >
Step by Step: How to setup ktlint with spotless? - SourceLevel
There's a small problem with spotless: it does not support custom ... gist pretty straightforward Gradle task for ktlint and HTML reporter.
Read more >
FormatExtension (plugin-gradle 5.6.1 API) - Javadoc.io
Adds a spotless{Name}Check and spotless{Name}Apply task. ... An optional performance optimization if you are using any of the custom methods.
Read more >
Using a Code Formatter - WPILib Docs
In the plugins {} block of your build.gradle , add the Spotless plugin so it ... You can also specify a specific task...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found