Skip to content

Commit

Permalink
Add spotless for common code style
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiX committed Oct 7, 2021
1 parent 2b62356 commit de2394f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,18 @@ node {
}
```

## Development

### Code Style

This plugin tries to migrate to [Google Java Code Style], please try to adhere
to that style whenever adding new files or making changes to existing files.
The style is enforced using the [spotless] plugin, if the build fails because
you were using the "wrong" style, you can fix it by running:

$ mvn spotless:apply

to reformat Java code in the proper style.

[Google Java Code Style]: https://google.github.io/styleguide/javaguide.html
[spotless]: https://github.com/diffplug/spotless
27 changes: 27 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,31 @@
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>

<build>
<plugins>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.17.0</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- get better with time -->
<ratchetFrom>origin/master</ratchetFrom>
<java>
<endWithNewline />
<importOrder />
<removeUnusedImports />
<googleJavaFormat />
</java>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit de2394f

Please sign in to comment.