InseeFrLab / Trevas-Jupyter

Jupyter notebook providing VTL support through Trevas engine
MIT License
2 stars 2 forks source link

Integrate Spotless in the pom.xml #115

Closed jornfranke closed 9 months ago

jornfranke commented 9 months ago

Spotless is a popular tool to check that the code is correctly formatted and, if needed, can automatically format code according to a standard.

It has also a Maven plugin: https://github.com/diffplug/spotless/tree/main/plugin-maven

The goal of this issue is simply to integrate it into the pom.xml

Note: This will make Spotless only available in the project. I recommend that the maintainers of Trevas-Jupyter run the automated formatting and then commit all changed files (as probably many files will change the first time the tool is run):

./mvnw spotless:apply

Then, I leave it also to the maintainers to integrate it in Github actions. Eg. when using this command Github actions will fail if a developer committed files that do not correspond to the standard format:

./mvnw spotless:check

One could also add some documentation on how to add it as a Git pre-commit hook: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks, to ensure that wrongly formated code can be committed in the first place.

Unfortunately, this has to be done by the developer manually.

NicoLaval commented 9 months ago

Fix 85eccea13b3bce04ab13bd339281ca4859a8af4a