My coworkers keep adding code like
if (someCondition) {
assert(false, "Error message goes here")
}
While this is necessary in Obj-C, in Swift we should be using asssertionFailure("Error message") (and preconditionFailure("Error message")) instead. There's literally no reason to be writing assert(false, …) beyond lack of knowledge of assertionFailure(_:).
I don't see any configuration necessary here, and this should be opt-out because it's generally useful and the only reason to disable it is because you have hundreds of violations and don't want to fix them.
Hi @kballard, do you have plans to work on it? Otherwise I'll take it.
@ornithocoder I have no plans on doing this myself, so please go ahead.
Most helpful comment
@ornithocoder I have no plans on doing this myself, so please go ahead.