-
Notifications
You must be signed in to change notification settings - Fork 8
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
Make case classes final #69
Conversation
@@ -3,4 +3,4 @@ package com.github.sbt.sbom | |||
import org.cyclonedx.Version | |||
import sbt.Configuration | |||
|
|||
case class BomExtractorParams(schemaVersion: Version, configuration: Configuration) | |||
final case class BomExtractorParams(schemaVersion: Version, configuration: Configuration) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idiomatically all case classes are assumed to be final. Any attempt to extend them is non-idiomatic, and asking for trouble. For sbt plugins I don't think putting this guardrail is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is universally 'idiomatic' to explicitly mark case classes as final, and I personally find that in this case it adds noise for questionable benefit, but if you feel strongly I'm OK with it.
e256c70
to
7bd9638
Compare
Yeah tbh this is something that should be solved by a linting tool, there was a big discussion somewhere that So you are right that its not idiomatic to mark |
Yes, no disagreement there :) |
Its idiomatic for case classes to be final since users overriding the case class can cause unexpected behaviour