Skip to content

Commit

Permalink
Added spotify formatter (expect failure)
Browse files Browse the repository at this point in the history
Signed-off-by: or-shachar <[email protected]>
  • Loading branch information
or-shachar committed Apr 26, 2022
1 parent 8a20cb1 commit 01d007d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ jobs:
paths:
- ~/.m2
key: circleci-demo-java-spring-{{ checksum "pom.xml" }}
- run:
name: Check formatting
command: |
if (mvn fmt:format);
then
echo "Code is well formatted"
else
echo "Code is not formatted well. Please run 'mvn fmt:format' and commit changes"
exit 1
fi
- run: mvn package
publish_image:
docker:
Expand Down
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ Prometheus uses GitHub to manage reviews of pull requests.
This will avoid unnecessary work and surely give you and us a good deal
of inspiration.

# Formatting

Code is automatically formatted with [Spotify fmt mavne-plugin](https://github.com/spotify/fmt-maven-plugin) whenever you run standard `mvn install`.

CI builds will fail if code is not formatted that way.

To simply run the formatter you can always run: `mvn fmt:format` (requires JVM > 11)
# Releasing

For release instructions, see [RELEASING](RELEASING.md).
12 changes: 12 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,18 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify.fmt</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.18</version>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit 01d007d

Please sign in to comment.