Closed ineiti closed 4 years ago
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities (and 2 Security Hotspots to review)
13 Code Smells
@martinalig asks how to go forward with this, with regard to all the other PRs. My proposition is:
git fetch
# Either merge or rebase, according to your normal workflow
git merge/rebase origin/pre-linting
git checkout origin/develop .pre-commit-config.yaml .github/workflows/pre-commit.yaml
# The following command fails because it had to format all java files. If you run it again, it will succeed
pre-commit run --all-files
git commit -am "Branch with linted files"
git checkout origin/linter_done
git checkout -b old_branch_linted
git checkout old_branch .
git commit -am "Branch with linted files depending on develop"
git rebase origin/develop
Then the changes should be minimal.
Problem with this solution: you lose all commit-history!
Perfect, works for me!
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:
before every commit, or on Mac and Linux:
To have it automatically be run when committing.
This PR is huge, because it has the linter applied to the code.
Closes #223