-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace scalafmtOnCompile with CI check #457
Replace scalafmtOnCompile with CI check #457
Conversation
d7f1d92
to
424ced1
Compare
This looks fantastic. I am not too sure about disabling |
Just want to confirm, does the new CI job also catch an ill-formatted |
Wait looks like there's already a librarymanagement/.github/workflows/ci.yml Lines 39 to 43 in 55893d3
Ehh Github does not have a button to rollback PR approval... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to #457 (comment), reserving approval for now.
Let me change it, sec |
5e39336
to
7fb67a2
Compare
@Friendseeker Done |
Thanks! I am not very familiar with the repo as evidenced by me initially overlooking the existence of 'scalafmtcheckAll'. Probably for the best to let Eugene or other people more experienced with the repo to proceed with the review. |
7fb67a2
to
30584d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This PR replaces
scalafmtOnCompile
with a github action that runs scalafmt-native that checks if the entire codebase is formatted. The advantage of this versus usingscalafmtOnCompile
is it doesn't mess up editors while developing and since it is its own github action check it runs in parallel to the main sbt build (this also means it will even run if the sbt fails to load/compile). The scalafmt-native check also only runs on files that are different toorigin/develop
and since its running in native the entire github check typically only takes around 5-10 seconds.Most critically it ensures that the code is actually properly formatted since with the current setup, its still possible to push unformatted code just by simply forgetting to compile before pushing (which is what happened before).
The only thing that needs to be done after this PR is merged is to add
Scalafmt / Code is formatted
as a github CI status check so that you cannot merge PR's if they are not formatted.