DP-3T / dp3t-sdk-backend

The backend implementation for DP3T
Mozilla Public License 2.0
198 stars 88 forks source link

Add automatic linter #224

Closed ineiti closed 4 years ago

ineiti commented 4 years ago

To make the code look better, apply an automatic linter. The chosen linter is the Google-java-formatter from https://github.com/google/google-java-format, which can also be installed in your IDE.

It is included as a https://pre-commit.com/ rule, so that it can be automatically applied whenever the code is committed. Additionally, a github-action makes sure that all code is correctly linted.

If you want to run this locally, you have to install https://pre-commit.com/. Then you can do:

pre-commit run

before every commit, or on Mac and Linux:

pre-commit install

To have it automatically be run when committing.

This PR is huge, because it has the linter applied to the code.

Closes #223

sonarcloud[bot] commented 4 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 2 Security Hotspots to review)
Code Smell A 13 Code Smells

73.5% 73.5% Coverage
2.6% 2.6% Duplication

ineiti commented 4 years ago

@martinalig asks how to go forward with this, with regard to all the other PRs. My proposition is:

Then the changes should be minimal.

Problem with this solution: you lose all commit-history!

martinalig commented 4 years ago

Perfect, works for me!