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 deactivated StyleGuideBaseURL
for Layout/ClassStructure
#6865
Fix deactivated StyleGuideBaseURL
for Layout/ClassStructure
#6865
Conversation
`StyleGuide` config for `Layout/ClassStructure` was written as an absolute URL instead of a relative URL. This prevents custom `StyleGuideBaseURL` from taking precedence over original rubocop-hq URL. This patch fix the issue by specifying fragment as the `StyleGuide` of `Layout/ClassStructure`.
4e59646
to
344a678
Compare
Sorry, it seems like I had uncommitted changes in my local workspace. Now all the diff is uploaded. |
@@ -7,6 +7,7 @@ | |||
* [#6855](https://github.com/rubocop-hq/rubocop/pull/6855): Fix an exception in `Rails/RedundantReceiverInWithOptions` when the body is empty. ([@ericsullivan][]) | |||
* [#6856](https://github.com/rubocop-hq/rubocop/pull/6856): Fix auto-correction for `Style/BlockComments` when the file is missing a trailing blank line. ([@ericsullivan][]) | |||
* [#6858](https://github.com/rubocop-hq/rubocop/issues/6858): Fix an incorrect auto-correct for `Lint/ToJSON` when there are no `to_json` arguments. ([@koic][]) | |||
* [#6865](https://github.com/rubocop-hq/rubocop/pull/6865): Fix deactivated `StyleGuideBaseURL` for `Layout/ClassStructure`. ([@aeroastro][]) |
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.
Change log entry is not required because there is no impact to users.
Thank you for the quick review. 🐱 PrerequisitesLet's assume we have the following AllCops:
StyleGuideBaseURL: https://github.com/aeroastro/ruby-style-guide
Layout/ClassStructure:
Enabled: true # :nodoc:
class Test
private
def hoge
end
HOGE = 3
end The reason why I changed the
c.f #3535 ImpactThen, run rubocop with $ ruby -v
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin16]
$ bundle exec rubocop -v
0.66.0
$ bundle exec rubocop --display-style-guide test.rb Before
After
You can see that the style guide URL of Additional InformationOn the current master, only
|
I see. Thanks! |
StyleGuide
config forLayout/ClassStructure
waswritten as an absolute URL instead of a relative URL.
This prevents custom
StyleGuideBaseURL
from taking precedenceover original rubocop-hq URL.
https://github.com/rubocop-hq/rubocop/blob/86f35b21a9de380028bc7bc7cf1a6e212106e6b9/config/default.yml#L74-L76
This patch fix the issue by specifying fragment as the
StyleGuide
ofLayout/ClassStructure
.Since this is a bug fix in default config, I think we can omit a test.
If required, please let me know.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).and description in grammatically correct, complete sentences.
bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.