weisJ / autostyle

Automatic code formatter for Gradle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Autostyle: fix code style automatically

Travis CI CI Status

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

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). Autostyle 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 Autostyle' arsenal.

Current feature matrix

Feature / FormatterStep plugin-gradle (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.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. Autostyle is easier to work on than ever, and one of the reasons why is that we don't require contributors to "fill the matrix". So far Autostyle works better with Gradle, however we would consider PRs 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

About

Automatic code formatter for Gradle

License:Apache License 2.0


Languages

Language:Java 63.5%Language:Kotlin 36.4%Language:Roff 0.1%