rspec/rules/S1996/swift/rule.adoc

28 lines
843 B
Plaintext
Raw Normal View History

2020-06-30 12:47:33 +02:00
A file that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. This is doubly true for a file with multiple independent classes, extensions, protocols, enumerations or structures. It is strongly advised to define each individual type in separate source file.
== Exceptions
The case when file contains only class and its extensions is ignored.
2020-06-30 12:47:33 +02:00
----
class MyViewController: UIViewController {
// class stuff here
}
extension MyViewController: UITableViewDataSource {
// table view data source methods
}
extension MyViewController: UIScrollViewDelegate {
// scroll view delegate methods
}
----
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]