Skip to content
Keep your code spotless
Java HTML Roff
Branch: master
Clone or download

Latest commit

nedtwigg Merge pull request #595 from diffplug/feat/dogfood
Dogfood our `ratchetFrom` feature.
Latest commit 26c00b7 Jun 3, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Figure out what the deprecation warning is, one of these days... Jun 3, 2020
.github/workflows Add `pull_request` to Wrapper Validation Triggers (#515) Jan 16, 2020
_ext Published ext-eclipse-wtp/3.15.3 Mar 26, 2020
_images Fixed images which got corrupted somehow. Nov 30, 2016
gradle Fix SelfTest import. Jun 3, 2020
ide Issue 483 (#519) Feb 3, 2020
lib-extra Refactor build to make JGit available in plugin-gradle. May 31, 2020
lib Reduce the diff even further. Jun 2, 2020
plugin-gradle Fix now-broken mains. Jun 3, 2020
plugin-maven Update documentation and javadoc. Jun 3, 2020
testlib Cleanup the license test. Jun 3, 2020
.editorconfig Add import order configuration to editorconfig Nov 11, 2019
.gitattributes Remove union merge strategy for .gitattributes. Nov 12, 2019
.gitignore Issue 483 (#519) Feb 3, 2020
CHANGES.md Improve changelog wording. Jun 3, 2020
CODE_OF_CONDUCT.md Bump readme and docs http to https. Feb 15, 2019
CONTRIBUTING.md Fix JitPack instructions post-Gradle 5.6 May 6, 2020
ECLIPSE_SCREENSHOTS.md Big update to the README structure. Jan 3, 2017
ISSUE_TEMPLATE.md Issue template should prompt for gradle or maven version. Feb 16, 2018
LICENSE.txt Initial commit: first version of the plugin Mar 15, 2014
PADDEDCELL.md Improve the padded cell documentation. May 2, 2020
PULL_REQUEST_TEMPLATE.md Ask people to update the plugin-maven changelog in their PRs. Aug 26, 2019
README.md Credit where credit is due. Jun 1, 2020
RELEASE_CHECKLIST.md Release checklist got a lot shorter. Jan 14, 2020
build.gradle Fix mdoclet and javadoc UTF-8 on windows. May 30, 2020
gradle.properties Refactor build to make JGit available in plugin-gradle. May 31, 2020
gradlew Update gradle to 6.2.2 Mar 5, 2020
gradlew.bat Bump gradle 6.2.2 -> 6.3 May 3, 2020
settings.gradle Update our dogfood to latest, and adjust for the 4.x deprecations Jun 3, 2020

README.md

Spotless: Keep your code spotless

Travis CI Live chat License Apache

Spotless can format <java | kotlin | scala | sql | groovy | javascript | flow | typeScript | css | scss | less | jsx | vue | graphql | json | yaml | markdown | license headers | anything> using <gradle | maven | anything>.

Ideally, a code formatter can do more than just find formatting errors - it should fix them as well. Such a formatter is really just a Function<String, String>, which returns a formatted version of its potentially unformatted input.

It's easy to build such a function, but there are some gotchas and lots of integration work (newlines, character encodings, idempotency, and build-system integration). Spotless tackles those for you so you can focus on just a simple Function<String, String> which can compose with any of the other formatters and build tools in Spotless' arsenal.

Current feature matrix

Feature / FormatterStep plugin-gradle plugin-maven (Your build tool here)
generic.EndWithNewlineStep 👍 👍
generic.IndentStep 👍 👍
generic.LicenseHeaderStep 👍 👍
generic.ReplaceRegexStep 👍 👍
generic.ReplaceStep 👍 👍
generic.TrimTrailingWhitespaceStep 👍 👍
cpp.EclipseFormatterStep 👍 👍
groovy.GrEclipseFormatterStep 👍
java.GoogleJavaFormatStep 👍 👍
java.ImportOrderStep 👍 👍
java.RemoveUnusedImportsStep 👍 👍
java.EclipseFormatterStep 👍 👍
kotlin.KtLintStep 👍 👍
kotlin.KtfmtStep 👍 👍
markdown.FreshMarkStep 👍
npm.PrettierFormatterStep 👍 👍
npm.TsFmtFormatterStep 👍 👍
scala.ScalaFmtStep 👍 👍
sql.DBeaverSQLFormatterStep 👍
wtp.EclipseWtpFormatterStep 👍 👍
(Your FormatterStep here)
Fast up-to-date checking 👍
Automatic idempotency safeguard 👍

Why are there empty squares? Many projects get harder to work on as they get bigger. Spotless is easier to work on than ever, and one of the reasons why is that we don't require contributors to "fill the matrix". If you want to add Bazel support, we'd happily accept the PR even if it only supports the one formatter you use. And if you want to add FooFormatter support, we'll happily accept the PR even if it only supports the one build system you use.

Once someone has filled in one square of the formatter/build system matrix, it's easy for interested parties to fill in any empty squares, since you'll now have a working example for every piece needed.

Acknowledgements

You can’t perform that action at this time.