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
/// This prototype…prototype MyPrototype {}/// A class to…classMyClass{/// Tracks…varmyVar:Int/// The text for…letmyConst="a constant"/// Do…func myFunc(){varignore:Int// no need to document inside a function}}/// A struct to…structMyStruct{}/// An enum to…enumMyEnum{case myCase
}
Should the rule be configurable, if so what parameters should be configurable?
The rule should be configurable:
access-levels (members of public, internal, fileprivate, private); default; public & internal.
entity-types [class,function,prototype,variable]; default: all.
Should the rule be opt-in or enabled by default? Why?
Opt-in. Because lots of folks prefer not to include documentation comments.
The text was updated successfully, but these errors were encountered:
Turns out that I do have missing_docs active in my .swiftlint.yml file (along with various other opt_in_rules: that are working), but it is failing to generate warnings on my code that is missing docs.
Part of the problem is that missing_docs only checks public code for missing docs, but as I suggested above, I also need it for other access-levels (internal, etc.).
After some experimentation, I’ve found that missing_docs also ignores any cases where inheritance or a protocol is applied to a class/enum/struct. public struct Example {} gets a warning, but public struct Example: View {} does not. It seems that that, and the public requirement, are why I wasn’t seeing any warnings.
So, it seems that this issue is really 3 somewhat separate things:
Bug report for missing_docs excluding enums/classes/structs that use inheritance or protocols.
Feature request for options on missing_docs to include more access levels than just public.
Feature request for options on missing_docs to constrain which entities are checked for missing docs (class, enum, struct, prototype, function, variable, let constants).
This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!
New Issue Checklist
New rule request
require-docstrings
(e.g.,/// Documentation comment
) before functions, classes/enums/structs, protocols, and class/enum/struct variables.Enforce inclusion of documenting comments.
Invalid:
Valid:
The rule should be configurable:
public
,internal
,fileprivate
,private
); default; public & internal.class
,function
,prototype
,variable
]; default: all.Opt-in. Because lots of folks prefer not to include documentation comments.
The text was updated successfully, but these errors were encountered: