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

Misc: Initial scalafmt config (WIP / Draft) #167

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

raquo
Copy link
Owner

@raquo raquo commented Aug 16, 2024

Initial attempt to make scalafmt produce code style matching my IntelliJ formatter config that I used for my OSS projects. Not too bad, but still some issues remaining, especially with binpacking. Formatting in tests is disabled for this reason for now.

The bulk of Laminar development is happening in next-v18 branch. Once I finalize the scalafmt confg, this scalafmt branch will likely be nuked instead of rebased, I'm just using it to keep track of changes I make to .scalafmt.conf and their effect.

Note to self: make sure to review the diff, scalafmt needs manual changes sometimes to stabilize the output on the right style (e.g. with implicit keyword placement).

TODO for Laminar:

  • See #TODO[Format] comments
  • Figure out binpacking that would keep expectedNode arrangement as-is in tests (e.g. SplitVarSpec)
  • Can we keep the leading empty line before comment in InputController.scala?
  • Build setup
    • How / when to run scalafmt on the whole project?
    • Add CI check to make sure running scalafmt produces no changes
    • How to make IntelliJ understand project.excludePaths?
    • sbt command to style everything - use their plugin?
  • Docs
    • Add some info to Contributing, incl. about scalafmt limitations (e.g. implicit keyword, line length, etc.)

TODO for other projects:

  • How to use a common scalafmt file? Ideally w/o publishing an sbt plugin?
  • Scala DOM Types
  • Laminar Shoelace (needs Scala 3 config)
  • Airstream (FlattenStrategy needs newlines in type param definitions)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant