Skip to content
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

Update scalafmt #328

Merged
merged 3 commits into from
Oct 1, 2024
Merged

Update scalafmt #328

merged 3 commits into from
Oct 1, 2024

Conversation

mdedetrich
Copy link
Contributor

@mdedetrich mdedetrich commented Sep 30, 2024

This PR does the following things

  • Updates scalfamt to the latest version as well as applying project.git = true. Not only is this faster since it only applies scalafmt on diffed files (as determined by git) but its neccessary so that scalafmt doesn't format git submodules
    • Also adds specific source files which are sensitive to formatting explicitly to the excludePaths list. There are other solutions for this (such as using format:off/format:on in the source file) but this to me appears the least brittle when it comes to testing.
  • Applies scalafmt and places this in its own separate commit so that it can optionally be ignored with .git-blame-ignore-revs in a future PR
  • Adds a github workflow action that checks if the entire codebase is committed. This can be added as a branch check to essentially prevent merging of PR's that are not formatted. I personally find this the best quality of life way to enforce code formatting (as opposed to solutions such as formatting on commit)

@mdedetrich
Copy link
Contributor Author

mdedetrich commented Sep 30, 2024

@rolandtritsch The PR is ready, when merging it either do Merge commit or Rebase and merge but NOT squash and merge since I need the Apply scalafmt commit to remain in tact as I will add that to .git-blame-ignore-revs in a future PR.

Also you can add the Scalafmt / Code is formatted to the github repo branch status check after this PR is merged.

@rolandtritsch rolandtritsch merged commit cef3625 into scoverage:main Oct 1, 2024
5 checks passed
@rolandtritsch
Copy link
Member

Hi @mdedetrich. Looks good. Rebased/merged it.

@mdedetrich mdedetrich deleted the update-scalafmt branch October 1, 2024 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants