Skip to content

Commit

Permalink
using spotless for managing eclipse formatter and import order manage…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
LewerenzM committed Jun 12, 2024
1 parent cd48ccc commit 7ffb218
Show file tree
Hide file tree
Showing 3 changed files with 465 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# ids.server: Server part of ICAT Data Server (IDS)

## Linting
The [formatter-maven-plugin](https://code.revelc.net/formatter-maven-plugin/) is used here for linting. It uses the same configuration like the Eclipse code formatting feature.
The [spotless-maven-plugin](https://mvnrepository.com/artifact/com.diffplug.spotless/spotless-maven-plugin) is used here for linting. It uses the Eclipse code formatting feature. The guidelines are defined in `eclipse-formatter.xml` which was initially exported from eclipse (so you can do it again: define rules in eclipse an export the file to use it here).

An automatically code formatting is triggered while local build. In CI builds the code is only validated.
You also can execute the commands manually:
* `mvn formatter:validate` for validation
* `mvn formatter:format` to update the source code like it is defined in the formatters configuration.
* `mvn spotless:check` for validation
* `mvn spotless:apply` to update the source code like it is defined in the formatters configuration.

The rules for the formatter are defined in `eclipse-formatter-config.xml`.
### Import order
The import order is also validated and applied by the spotless-maven-plugin. It is defined in its plugin configuration in the `pom.xml`. You can find it in `plugin.configuration.java.importOrder.order`

## Further Information
[![Build Status](https://github.com/icatproject/ids.server/workflows/CI%20Build/badge.svg?branch=master)](https://github.com/icatproject/ids.server/actions?query=workflow%3A%22CI+Build%22)
Expand Down
Loading

0 comments on commit 7ffb218

Please sign in to comment.