The rule discouraged_optional_collection enforces to never make collection types optional but instead just use empty collections. However, testing for != nil or == nil is way more expressive in tests than checking for an empty collection. Hence the rule needs to be disabled for test configurations,
The rule
discouraged_optional_collection
enforces to never make collection types optional but instead just use empty collections. However, testing for!= nil
or== nil
is way more expressive in tests than checking for an empty collection. Hence the rule needs to be disabled for test configurations,