-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to exclude examples from the rule documentation #3834
Add option to exclude examples from the rule documentation #3834
Conversation
The option can be used if an example has mainly been added as another test case, but is not suitable as a user example. User examples should be easy to understand. They should clearly show where and why a rule is applied and where not. Complex examples with rarely used language constructs or pathological use cases which are indeed important to test but not helpful for understanding can be hidden from the documentation with this option.
Here's an example of your CHANGELOG entry: * Add option to exclude examples from the rule documentation.
[SimplyDanny](https://github.com/SimplyDanny)
[#issue_number](https://github.com/realm/SwiftLint/issues/issue_number) note: There are two invisible spaces after the entry's text. Generated by 🚫 Danger |
Codecov Report
@@ Coverage Diff @@
## master #3834 +/- ##
==========================================
- Coverage 92.13% 92.13% -0.01%
==========================================
Files 438 438
Lines 22529 22532 +3
==========================================
+ Hits 20758 20760 +2
- Misses 1771 1772 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks.
The option can be used if an example has mainly been added as another test case, but is not suitable as a user example. User examples should be easy to understand. They should clearly show where and why a rule is applied and where not. Complex examples with rarely used language constructs or pathological use cases which are indeed important to test but not helpful for understanding can be hidden from the documentation with this option.
The option can be used if an example has mainly been added as another test case, but is not suitable as a user example. User examples should be easy to understand. They should clearly show where and why a rule is applied and where not. Complex examples with rarely used language constructs or pathological use cases which are indeed important to test but not helpful for understanding can be hidden from the documentation with this option.
I want to use this option especially to clean up the examples in the
prefer_self_in_static_references
rule. Some of them are not very user-friendly.