Omit Needless Words
Every word in a name should carry information at the call site. Words that merely repeat type information already present in the signature are noise: `removeElement(_ element: Element)` is `remove(_ element: Element)`.…
$ prime install @ios-swift/rule-omit-needless-words Projection
Always in _index.xml · the agent never has to ask for this.
OmitNeedlessWords [rule] v0.1.0
Every word in a name should carry information at the call site. Words that merely repeat type information already present in the signature are noise: removeElement(_ element: Element) is remove(_ element: Element). Words restating the receiver are noise: string.appendString(...) is string.append(...). Words restating the return type are noise: tableView.numberOfSectionsInTableView is tableView.numberOfSections.
Loaded when retrieval picks the atom as adjacent / supporting.
OmitNeedlessWords [rule] v0.1.0
Every word in a name should carry information at the call site. Words that merely repeat type information already present in the signature are noise: removeElement(_ element: Element) is remove(_ element: Element). Words restating the receiver are noise: string.appendString(...) is string.append(...). Words restating the return type are noise: tableView.numberOfSectionsInTableView is tableView.numberOfSections.
Checks
- Read each word of the API name and ask: does removing this word make the call site less clear? If no, remove it.
- Method names do not repeat the type of an argument that already has its type spelled out (
add(observer:), notaddObserver(observer:)). - Method names do not repeat the receiver type (
Color.darker(), notColor.colorByMakingDarker()). - Property names do not repeat the type (
isFavorite: Bool, notfavoriteFlag: Bool;name: String, notnameString: String).
Label
Omit words that the type system already makes obvious
Loaded when retrieval picks the atom as a focal / direct hit.
OmitNeedlessWords [rule] v0.1.0
Every word in a name should carry information at the call site. Words that merely repeat type information already present in the signature are noise: removeElement(_ element: Element) is remove(_ element: Element). Words restating the receiver are noise: string.appendString(...) is string.append(...). Words restating the return type are noise: tableView.numberOfSectionsInTableView is tableView.numberOfSections.
Checks
- Read each word of the API name and ask: does removing this word make the call site less clear? If no, remove it.
- Method names do not repeat the type of an argument that already has its type spelled out (
add(observer:), notaddObserver(observer:)). - Method names do not repeat the receiver type (
Color.darker(), notColor.colorByMakingDarker()). - Property names do not repeat the type (
isFavorite: Bool, notfavoriteFlag: Bool;name: String, notnameString: String).
Label
Omit words that the type system already makes obvious
Label
Omit words that the type system already makes obvious
Source
prime-system/examples/ios-swift/primes/compiled/@ios-swift/rule-omit-needless-words/atom.yaml