-
Notifications
You must be signed in to change notification settings - Fork 356
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
Add 'scalafmt' to the project #1989
Conversation
3151a10
to
fd5531c
Compare
Thank you! I'll find an opportune time to run this and merge this in (to avoid conflicts in all other PRs) |
fd5531c
to
fdf052a
Compare
@jatcwang , I've actualized the PR: rebased onto main, updated scalafmt version, re-applied formattings and .git-blame-ignore-revs Let me know if you have any suggestions/concerns please. |
Thanks @satorg. Originally I wanted to merge this after RC6 because I didn't know about .git-blame-ignore-revs. But now I think we can get this in before RC6. I have a change with quite some lines of changes I'm working on so I'll sort this one out after that 🙏 |
@jatcwang sure, np. Let me know please when I should update this PR to synchronize it with the upstream. Also I think that once this PR gets settled in main, it would make sense to enforce scalafmt checks in CI/CD with a follow-up PR. I think I could take on that too – just let me know when to step in please. Thank you! |
@satorg I agree about the enforcement in CI. Feel free to implement it as part of this PR :) |
fdf052a
to
4d57329
Compare
The PR is updated:
|
@jatcwang , turns out the new Scalafmt version (3.8.2) started reformatting in multiline strings a little more aggressively. The changes don't break the build but look a bit awkward to me.
Wdyt? |
Looks like the CI failed because The problem here is that if I apply However, if I don't apply formatting to those files, then scalafmt checks will begin failing. Perhaps the simplest way to resolve this conundrum could be excluding auto-generated files from scalafmt's scope. I'll try to accomplish it shortly. |
ace7de2
to
d1a9ece
Compare
The PR is updated:
|
@jatcwang, hopefully, the CI issue has been resolved now. |
@jatcwang , just in case – in regards to the auto-generated sources: Perhaps, in makes sense to bring in an approach that is used in Cats for that: I.e. all the auto-generated sources are written into directories like I feel, this PR is ready to go, so I would refrain from adopting this technique right in here. Just because doing that would require even more seemingly unrelated changes to this PR. However, if you like such an approach and don't mind landing it in this repo, I could take on it in a follow-up PR. |
# Conflicts: # build.sbt # project/plugins.sbt
@satorg Yes I do agree that we should use sourceGenerators. I did try it before when I was improving/fixing the code generation but I can't remember what was the show stopper 🤔 Perhaps I wanted to keep the generated code committed in git so people can look at it on github. |
Big thanks for sorting this out @satorg! |
This PR: