Open armanbilge opened 2 years ago
Welcome back ;)
A lot of interesting linter rules! I am all in for accepting them upstream (same pros and cons as described in https://github.com/scalacenter/scalafix/issues/1620#issuecomment-1167865240). Actually, I had started implementing https://nrinaudo.github.io/scala-best-practices/adts/ as rules but never published my WIP.
Maybe we could group them under some kind of SafeADT
rule, with some configuration allowing opt-out?
Fantastic! Glad to hear that :) thank you so much.
Maybe we could group them under some kind of
SafeADT
rule, with some configuration allowing opt-out?
Yes, that makes sense to me. Those ADT best practices look good too, although I'm curious about whether the advice to mark case object
s as final
is still relevant in modern Scala, and if so how it relates to the RedundantSyntax.finalObject
rule.
Edit: ah, I think that's covered in the docs :) https://github.com/scalacenter/scalafix/blob/3f6ebebe88095ad7009cf9eb95536226a812aeb4/docs/rules/RedundantSyntax.md?plain=1#L16
Back again, with more potential upstream candidates :)
@bplommer wrote us some very nice internal scalafix rules for http4s. They are generally applicable, particularly for OSS libraries that must be mindful about binary compatibility. So we would like to give you the right of first refusal before we upstream it to typelevel-scalafix 😉
noFinalObject
https://github.com/scalacenter/scalafix/pull/1496noNonFinalCaseClass
"Case classes should be final, sealed, or private"leakingSealedHierarchy
"descendants of sealed traits should be sealed, final, or private"nonValidatingCopyConstructor
"Case classes with private constructors should be abstract to prevent exposing a non-validating copy constructor"Thanks, appreciate your time to look into these!