SwiftLint
SwiftLint copied to clipboard
#5461 added ib_segue_action case in TypeContent
Hey! I have added a new case to TypeContent enum for ib_segue_action. And also adapted the change in TypeContentsOrderRule.swift.
| 21 Messages | |
|---|---|
| :book: | Linting Aerial with this PR took 0.91s vs 0.92s on main (1% faster) |
| :book: | Linting Alamofire with this PR took 1.26s vs 1.26s on main (0% slower) |
| :book: | Linting Brave with this PR took 7.17s vs 7.17s on main (0% slower) |
| :book: | Linting DuckDuckGo with this PR took 5.3s vs 5.32s on main (0% faster) |
| :book: | Linting Firefox with this PR took 10.68s vs 10.76s on main (0% faster) |
| :book: | Linting Kickstarter with this PR took 10.13s vs 10.14s on main (0% faster) |
| :book: | Linting Moya with this PR took 0.53s vs 0.53s on main (0% slower) |
| :book: | Linting NetNewsWire with this PR took 2.9s vs 2.9s on main (0% slower) |
| :book: | Linting Nimble with this PR took 0.78s vs 0.78s on main (0% slower) |
| :book: | Linting PocketCasts with this PR took 8.61s vs 8.58s on main (0% slower) |
| :book: | Linting Quick with this PR took 0.44s vs 0.44s on main (0% slower) |
| :book: | Linting Realm with this PR took 4.47s vs 4.49s on main (0% faster) |
| :book: | Linting Sourcery with this PR took 2.31s vs 2.33s on main (0% faster) |
| :book: | Linting Swift with this PR took 4.5s vs 4.5s on main (0% slower) |
| :book: | Linting VLC with this PR took 1.25s vs 1.28s on main (2% faster) |
| :book: | Linting Wire with this PR took 17.91s vs 17.89s on main (0% slower) |
| :book: | Linting WordPress with this PR took 11.38s vs 11.37s on main (0% slower) |
| :book: | This PR fixed a violation in DuckDuckGo: /DuckDuckGo/BookmarksViewController.swift:620:20: warning: Type Contents Order Violation: An 'other_method' should not be placed amongst the type content(s) 'instance_property' (type_contents_order) |
| :book: | This PR fixed a violation in DuckDuckGo: /DuckDuckGo/BookmarksViewController.swift:647:20: warning: Type Contents Order Violation: An 'other_method' should not be placed amongst the type content(s) 'instance_property' (type_contents_order) |
| :book: | This PR fixed a violation in DuckDuckGo: /DuckDuckGo/TabViewController.swift:974:5: warning: Type Contents Order Violation: An 'other_method' should not be placed amongst the type content(s) 'instance_property' (type_contents_order) |
| :book: | This PR fixed a violation in DuckDuckGo: /DuckDuckGo/TabViewController.swift:980:13: warning: Type Contents Order Violation: An 'other_method' should not be placed amongst the type content(s) 'instance_property' (type_contents_order) |
Generated by :no_entry_sign: Danger
Hi, @SimplyDanny still the build is not passing, is there something else needed to be done?
Hi, @SimplyDanny still the build is not passing, is there something else needed to be done?
Now that you have removed the entry from the default list, the test reference update needs to be reverted.
Hey @SimplyDanny. Now that the build has passed, is there anything else needs to be done or is it enough to merge and close the issue?
Hey @SimplyDanny. Now that the build has passed, is there anything else needs to be done or is it enough to merge and close the issue?
- This change needs tests. See
TypeContentsOrderRuleTests. - A changelog entry needs to be added. See
CHANGELOG.md.
Hi, thanks for adding this new case to the type_contents_order rule :)
It seems the documentation has not been updated, and I could not find where ib_segue_action is located in the default configuration for this rule, making it difficult to know where SwiftLint expects me to put my @IBSegueAction methods 😕
EDIT: It seems that putting the @IBSegueAction methods at the end of the enclosing type's implementation makes SwiftLint happy.
Hi, thanks for adding this new case to the
type_contents_orderrule :)It seems the documentation has not been updated, and I could not find where
ib_segue_actionis located in the default configuration for this rule, making it difficult to know where SwiftLint expects me to put my@IBSegueActionmethods 😕EDIT: It seems that putting the
@IBSegueActionmethods at the end of the enclosing type's implementation makes SwiftLint happy.
We intentionally didn't specify a default expectation because the new type was added on top of the already existing ones. And what's not explicitly specified is expected last by the rule.
@guillaumealgis: Do you think a default would be reasonable (also for documentation purposes) instead of leaving it unspecified? If so, what would be a decent order? Is putting it on the same level as @IBAction a good idea?
Do you think a default would be reasonable (also for documentation purposes) instead of leaving it unspecified?
I think SwiftLint should explicitly define an order for all defined cases. This makes the expected position of the elements clearer for everyone.
I have honestly no strong opinion on where to put ib_segue_action in the list. Same level / right after ib_action seems fine, between other_method and subscript would be fine also, end of list is not outrageous 🤷🏼♂️
what's not explicitly specified is expected last by the rule
Seems pretty logical, but it's not documented, so when SwiftLint started complaining after I updated it was not clear where I should put my code to satisfy it :)
I have honestly no strong opinion on where to put
ib_segue_actionin the list. Same level / right afterib_actionseems fine, betweenother_methodandsubscriptwould be fine also, end of list is not outrageous 🤷🏼♂️
Same level as ib_action should be fine then: #5956.