Adding a TypeContent case of `type_contents_order`
- [x] Updated SwiftLint to the latest version
- [x] I searched for existing GitHub issues
Currently the TypeContent of type_contents_order is:
enum TypeContent: String {
case `case` = "case"
case typeAlias = "type_alias"
case associatedType = "associated_type"
case subtype = "subtype"
case typeProperty = "type_property"
case instanceProperty = "instance_property"
case ibOutlet = "ib_outlet"
case ibInspectable = "ib_inspectable"
case initializer = "initializer"
case typeMethod = "type_method"
case viewLifeCycleMethod = "view_life_cycle_method"
case ibAction = "ib_action"
case otherMethod = "other_method"
case `subscript` = "subscript"
case deinitializer = "deinitializer"
}
It distinguishes between ib_outlet and instance_property, ib_action and other_method.
Would it be nice to have ib_segue_action as a case?
Hi
Do we have to add a new case for 'ib_segue_action'. If so then I am not able to figure out what else is needed to change.
I have added an image for the changes I could figure out to make.
Thanks
The change in the image is enough. Thanks!
By the way, I don't know the proper order of ibSegueAction in the default configuration.
Hi Do we have to add a new case for 'ib_segue_action'. If so then I am not able to figure out what else is needed to change. I have added an image for the changes I could figure out to make. Thanks
You should also adapt TypeContentsOrderRule.swift, specifically the typeContent method.
And .ibSegueAction should not become part of the default configuration to avoid causing surprises when people update to a newer SwiftLint version.
Hi @SimplyDanny I was trying to figure out when should I return .ibSegueAction in typeContent method. Will this a part of functionMethodInstance. Or should i return at the place of .otherMethod because as I can see it has no use case as of now.
Hi @SimplyDanny I was trying to figure out when should I return .ibSegueAction in typeContent method. Will this a part of functionMethodInstance. Or should i return at the place of .otherMethod because as I can see it has no use case as of now.
This should be implemented in the same way as it is done for .ibAction.
I think it would be easier to discuss this in a PR.
Hi, I created a PR but tests were failing and I am not able to figure out why this is happening. I am new to open source. If you got some time from you busy schedule can you please tell me what needs to be taken care of to pass all the tests. Or does it mean my implemetation was wrong?
If you got some time from you busy schedule can you please tell me what needs to be taken care of to pass all the tests. Or does it mean my implemetation was wrong?
I've just given you a hint in the PR.
