You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At Lyft, we've seen several places where someone adds a disable between a docstring and whatever it's describing like this:
/// My great property
// swiftlint:disable:next force_unwrap
varmyGreatProperty:String!
This prevents Xcode from properly rendering the docstring.
I created a very simple rule for this that doesn't catch several things:
orphan_docstring:
name: For a docstring to work correctly, it must be next to what it is describing.regex: '///\w*\n\s*//(?!/)'
Ideally, it would ensure the following line is some value property, type, function, etc. Doing this would also catch /// instead of // for regular comments inside a method body or something.
It would be great if there was a more sophisticated official rule to properly figure out when a docstring is orphaned and warn the user.
Activity
Add orphaned_doc_comment rule
Add orphaned_doc_comment rule
Add orphaned_doc_comment rule
Add orphaned_doc_comment rule (#3014)