|
1 | 1 | # <img align="left" src="_images/spotless_logo.png"> Spotless: Keep your code spotless
|
2 | 2 |
|
3 |
| -<!---freshmark shields |
4 |
| -output = [ |
5 |
| - link(image('Circle CI', 'https://circleci.com/gh/diffplug/spotless/tree/main.svg?style=shield'), 'https://circleci.com/gh/diffplug/spotless/tree/main'), |
6 |
| - link(shield('Live chat', 'gitter', 'chat', 'brightgreen'), 'https://gitter.im/{{org}}/{{name}}'), |
7 |
| - link(shield('License Apache', 'license', 'apache', 'brightgreen'), 'https://tldrlegal.com/license/apache-license-2.0-(apache-2.0)') |
8 |
| - ].join('\n'); |
9 |
| ---> |
10 |
| -[](https://circleci.com/gh/diffplug/spotless/tree/main) |
11 |
| -[](https://gitter.im/diffplug/spotless) |
12 |
| -[](https://tldrlegal.com/license/apache-license-2.0-(apache-2.0)) |
13 |
| -<!---freshmark /shields --> |
| 3 | +[](plugin-gradle) |
| 4 | +[](plugin-maven) |
| 5 | +[](https://github.com/moznion/sbt-spotless) |
14 | 6 |
|
15 |
| -Spotless can format <antlr | c | c# | c++ | css | flow | graphql | groovy | html | java | javascript | json | jsx | kotlin | less | license headers | markdown | objective-c | protobuf | python | scala | scss | sql | typeScript | vue | yaml | anything> using <gradle | maven | anything>. |
| 7 | +Spotless can format <antlr | c | c# | c++ | css | flow | graphql | groovy | html | java | javascript | json | jsx | kotlin | less | license headers | markdown | objective-c | protobuf | python | scala | scss | sql | typeScript | vue | yaml | anything> using <gradle | maven | sbt | anything>. |
16 | 8 |
|
17 | 9 | You probably want one of the links below:
|
18 | 10 |
|
19 | 11 | ## [❇️ Spotless for Gradle](plugin-gradle) (with integrations for [VS Code](https://marketplace.visualstudio.com/items?itemName=richardwillis.vscode-spotless-gradle) and [IntelliJ](https://plugins.jetbrains.com/plugin/18321-spotless-gradle))
|
| 12 | + |
| 13 | +```console |
| 14 | +user@machine repo % ./gradlew build |
| 15 | +:spotlessJavaCheck FAILED |
| 16 | + The following files had format violations: |
| 17 | + src\main\java\com\diffplug\gradle\spotless\FormatExtension.java |
| 18 | + -\t\t····if·(targets.length·==·0)·{ |
| 19 | + +\t\tif·(targets.length·==·0)·{ |
| 20 | + Run './gradlew spotlessApply' to fix these violations. |
| 21 | +user@machine repo % ./gradlew spotlessApply |
| 22 | +:spotlessApply |
| 23 | +BUILD SUCCESSFUL |
| 24 | +user@machine repo % ./gradlew build |
| 25 | +BUILD SUCCESSFUL |
| 26 | +``` |
| 27 | + |
20 | 28 | ## [❇️ Spotless for Maven](plugin-maven)
|
| 29 | + |
| 30 | +```console |
| 31 | +user@machine repo % mvn spotless:check |
| 32 | +[ERROR] > The following files had format violations: |
| 33 | +[ERROR] src\main\java\com\diffplug\gradle\spotless\FormatExtension.java |
| 34 | +[ERROR] -\t\t····if·(targets.length·==·0)·{ |
| 35 | +[ERROR] +\t\tif·(targets.length·==·0)·{ |
| 36 | +[ERROR] Run 'mvn spotless:apply' to fix these violations. |
| 37 | +user@machine repo % mvn spotless:apply |
| 38 | +[INFO] BUILD SUCCESS |
| 39 | +user@machine repo % mvn spotless:check |
| 40 | +[INFO] BUILD SUCCESS |
| 41 | +``` |
| 42 | + |
21 | 43 | ## [❇️ Spotless for SBT (external for now)](https://github.com/moznion/sbt-spotless)
|
22 | 44 | ## [Other build systems](CONTRIBUTING.md#how-to-add-a-new-plugin-for-a-build-system)
|
23 | 45 |
|
|
0 commit comments