Suggested rule: require override
Suppose you have
trait FooTrait {
def bar(): Unit
}
class Foo extends FooTrait {
def bar() = { }
}
Under this new rule, the above would give an error, but the below would pass
class Foo extends FooTrait {
override def bar() = { }
}
I'd really like to have that rule but I'm not sure if it can be done using scapegoat.
I think this is the article by @nrinaudo on the same topic: https://nrinaudo.github.io/scala-best-practices/oop/always_override.html
I'd personally love to have this, but it's important to realise it's a controversial stance. Many people told me to never use override unless it'd result in a compilation error.
Understood. Thanks for chipping in! I think we can implement that and if someone is against it, they can disable the rule. I bet we have other controversial rules already.