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

ScalaFix linters #5497

Open
3 of 9 tasks
bplommer opened this issue Oct 27, 2021 · 2 comments
Open
3 of 9 tasks

ScalaFix linters #5497

bplommer opened this issue Oct 27, 2021 · 2 comments
Labels
CI Relates to the health of our builds

Comments

@bplommer
Copy link
Member

bplommer commented Oct 27, 2021

I raised in #5484 the possibility of using scalafix to enforce naming conventions. Other rules that could be useful to improve consistency and reduce maintenance burden:

  • organize imports - this will introduce a lot of merge conflicts when introduced but should subsequently reduce them
  • Disallow use of fs2's sync compiler - Add scalafix linter for use of fs2 Sync compiler #5536
  • Disallow use of throw in parsers not prefixed with unsafe
  • No non-final case classes (added but not yet linting at error level)
  • No final case objects
  • Recurring headers must have a semigroup instance (unless they're called Set-Cookie)
  • Contents of internal packages must be package-private
  • case classes with private constructors leaking public copy constructors
  • Replace assert(a == b) with assertEquals(a, b), assert(a != b) with assertNotEquals(a, b)
@bplommer bplommer added RFC Design ideas that we'd like to spur discussion CI Relates to the health of our builds labels Oct 27, 2021
@rossabaker
Copy link
Member

All of these are wonderful ideas, except I don't know why final case objects are bad. Is it just redundancy? Redundancy is bad.

@armanbilge
Copy link
Member

armanbilge commented Oct 27, 2021

Scala 3 complains about them actually. We don't have fatal warnings in 0.22 but they get removed up in 0.23 anyway.

https://github.com/http4s/http4s/pull/5474/files#diff-e372aa8a2995d9def1db9dc2b9274a92d0fdbf3203e57087f1e0caee1486178b

@bplommer bplommer changed the title Add ScalaFix to the build ScalaFix linters Nov 8, 2021
@bplommer bplommer removed the RFC Design ideas that we'd like to spur discussion label Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Relates to the health of our builds
Projects
None yet
Development

No branches or pull requests

3 participants