-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Fix broken doc style of Style/BracesAroundHashParameters cop
#4880
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
Fix broken doc style of Style/BracesAroundHashParameters cop
#4880
Conversation
|
Could you check yard doc also? We can the yard doc for this cop with |
6ca1306 to
1b6cefb
Compare
|
I was not checking with BeforeAfterThis will result in a unified format. |
|
On the other hand, if it seems preferable not to use |
|
It seem it was a mistake on our part to be using examples for listing code and bad cases, or at least this is the impression I had from this PR. Not sure what exactly would be the best course of action in general. I'd certainly prefer us to be consistent about this. |
|
The documentation for |
|
And here we have the option of the @lsegal himself (yard's author) https://gitter.im/lsegal/yard?at=59e530ea32e080696eeb2e38 |
|
Thank you for the pointer to the information. Example codes are described only in Explanations of 3 styles are redundant😓 , but it seems that description section and examples section role are separated. WDYT? |
|
This seems like a reasonable option as well 957d86d |
|
FYI, examples can have title lines in which you can summarize the purpose, instead of in comments. |
f524ff8 to
5c1720c
Compare
|
I appreciate your advice. First, I made the text of the explanation section simple. Next, I wrote the supported styles on the title line of I could not replace all the explanation with the code comment because I did not understand the text wrapping of title line (The length exceeds 80) 💦 But these are summaries so it may be good as well. |
|
Looks great! I guess we should adopt this style consistently for cops with multiple supported styles. |
Follow up of rubocop#4880 (comment). This commit is a change of document format. Because there are many cops to be changed, this commit applied a new style to some Layout department cops first.
Follow up of #4880 (comment). This commit is a change of document format. Because there are many cops to be changed, this commit applied a new style to some Layout department cops first.
Follow up of rubocop#4880 (comment). This commit is a change of document format. Cops of `naming` department are the target. Since example of `Naming/HeredocDelimiterCase` cop was the opposite of `bad` and `good`, it was rearranged for unification. Also added `default` information based on `config/default.yml`.
Follow up of #4880 (comment). This commit is a change of document format. Cops of `naming` department are the target. Since example of `Naming/HeredocDelimiterCase` cop was the opposite of `bad` and `good`, it was rearranged for unification. Also added `default` information based on `config/default.yml`.
Follow up of rubocop#4880 (comment). This commit applied a new style to some `Style` department cops, the same policy as rubocop#4978.
Follow up of #4880 (comment). This commit applied a new style to some `Style` department cops, the same policy as #4978.
Follow up of rubocop#4880 (comment). This commit is a change of document format. Cops of `Lint` department are the target.
Follow up of #4880 (comment) and #5699. This commit is a change of document format for `Layout/FirstParameterIndentation` cop. This PR uses `# rubocop:disable Metrics/LineLength` because line length of the following line exceeds 80. ```diff + # @example EnforcedStyle: special_for_inner_method_call_in_parentheses (default) ``` Descriptions of `EnforcedStyle` are quoted from default.yml. https://github.com/rubocop-hq/rubocop/blob/v0.57.1/config/default.yml#L365-L381
Follow up of #4880 (comment). This commit is a change of document format for `Rails/Delegate` cop.
Follow up of rubocop/rubocop#4880 (comment). This commit is a change of document format for `Rails/ActionFilter` cop.
Follow up of rubocop/rubocop#4880 (comment). This commit is a change of document format for `Rails/Date` cop.
Follow up of rubocop/rubocop#4880 (comment). This commit is a change of document format for `Rails/RequestReferer` cop.
Follow up of rubocop/rubocop#4880 (comment). This is only document change. This commit adds an example of `EnforcedStyle` to `Rails/TimeZone`.
Follow up of rubocop/rubocop#4880 (comment). This commit is a change of document format for `Rails/UniqBeforePluck` cop.
Follow up of rubocop/rubocop#4880 (comment). This commit is a change of document format for `Rails/Delegate` cop.
Follow up of rubocop#4880 (comment). This PR is a change of document format for `Style/MethodCallWithArgsParentheses` cop.
Follow up of #4880 (comment). This PR is a change of document format for `Style/MethodCallWithArgsParentheses` cop.
Follow up of rubocop#4880 (comment). This PR is a change of document format for `Lint/Void` cop.
Follow up of #4880 (comment). This PR is a change of document format for `Lint/Void` cop.
Follow up of rubocop#4880 (comment). This PR is a change of document format for `Style/NonNilCheck` cop.
Follow up of #4880 (comment). This PR is a change of document format for `Style/NonNilCheck` cop.
Follow up of rubocop#4880 (comment). This PR is a change of document format for `Style/NumericLiterals` cop.
Follow up of #4880 (comment). This PR is a change of document format for `Style/NumericLiterals` cop.
Follow up of rubocop#4880 (comment) This PR is a change of document format for `Style/CaseEquality` cop.
Follow up of #4880 (comment) This PR is a change of document format for `Style/CaseEquality` cop.




This PR fixes the broken document style that
goodandbadare displayed in the sidebar.https://rubocop.readthedocs.io/en/latest/cops_style/#bad
Before submitting the PR make sure the following are checked:
[Fix #issue-number](if the related issue exists).master(if not - rebase it).rake spec) are passing.rake internal_investigation.and description in grammatically correct, complete sentences.
rake generate_cops_documentation(required only when you've added a new cop or changed the configuration/documentation of an existing cop).