Keep your code spotless
Clone or download
fvgh Provides Eclipse 4.9 JDT. (#316)
Switch default Eclipse JDT version to 4.9.
Latest commit d57e26d Nov 3, 2018
Permalink
Failed to load latest commit information.
.ci Make the npm tests run on CI. Sep 7, 2018
_ext XML Extension (#293) Sep 15, 2018
_images Fixed images which got corrupted somehow. Nov 30, 2016
gradle Include Maven version requirement in the generated POM Aug 30, 2018
ide Improved ide. Dec 22, 2016
javadoc-publish Fix javadoc-publish. Jan 9, 2017
lib-extra Provides Eclipse 4.9 JDT. (#316) Nov 3, 2018
lib Eclipse-WTP CSS integration (#311) Oct 25, 2018
plugin-gradle Provides Eclipse 4.9 JDT. (#316) Nov 3, 2018
plugin-maven Provides Eclipse 4.9 JDT. (#316) Nov 3, 2018
testlib Eclipse-WTP CSS integration (#311) Oct 25, 2018
.editorconfig .md files are now indented by 2 spaces, for better GitHub code fences Jan 19, 2018
.gitattributes Update gradle version to 4.4.1. (#186) Jan 8, 2018
.gitignore Common Spotless Eclipse Framework which can be used by most Spotless … ( Jul 15, 2018
.travis.yml Make the npm tests run on CI. Sep 7, 2018
CHANGES.md Publish lib & plugin-maven 1.16.0, plugin-gradle 3.16.0. Oct 31, 2018
CODE_OF_CONDUCT.md Add code of conduct, per GitHub's suggestion. Feb 2, 2018
CONTRIBUTING.md Fixed broken links in CONTRIBUTING.md and README.md (#282) Aug 17, 2018
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 .md files are now indented by 2 spaces, for better GitHub code fences Jan 19, 2018
PULL_REQUEST_TEMPLATE.md Add note to PR template to ensure contributors can edit PRs. (#201) Feb 9, 2018
README.md Update @fvgh's credits, and add @simschla's. Sep 24, 2018
build.gradle Begin updating for support for JDK 10 (#271) Aug 1, 2018
gradle.properties Bump to 3.17.0-SNAPSHOT. Oct 31, 2018
gradlew Update gradle version to 4.4.1. (#186) Jan 8, 2018
gradlew.bat Reverting gradle wrapper back to 2.14.1, from 3.2.1. 3.2.1 seems not … Dec 21, 2016
settings.gradle Introduced the testlib package, and moved ResourceHarness into it. Dec 7, 2016
spotless.eclipseformat.xml XML Extension (#293) Sep 15, 2018
spotless.groovyformat.prefs Fixes according to review by @jbduncan (as far as possible, using the… Apr 8, 2017
spotless.importorder Moving spotless to a subfolder didn't work at all, it turns out. Whoops. Jan 6, 2017
spotless.license Moving spotless to a subfolder didn't work at all, it turns out. Whoops. Jan 6, 2017
spotless.xmlformat.prefs XML Extension (#293) Sep 15, 2018
spotlessSelf.gradle XML Extension (#293) Sep 15, 2018

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 👍 👍 ⬜️
markdown.FreshMarkStep 👍 ⬜️ ⬜️
npm.PrettierFormatterStep 👍 ⬜️ ⬜️
npm.TsFmtFormatterStep 👍 ⬜️ ⬜️
scala.ScalaFmtStep 👍 👍 ⬜️
sql.DBeaverSQLFormatterStep 👍 ⬜️ ⬜️
wtp.WtpEclipseFormatterStep 👍 👍 ⬜️
(Your FormatterStep here) ⬜️ ⬜️ ⬜️
Fast up-to-date checking 👍 ⬜️ ⬜️
Automatic idempotency safeguard 👍 ⬜️ ⬜️

Acknowledgements