-
-
Notifications
You must be signed in to change notification settings - Fork 279
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
Config formatter coverage #2031
Conversation
Thanks! I was about to raise an issue on this because of the String/Array mismatch. Glad you knew how to fix it! |
@@ -8,6 +8,12 @@ | |||
'AllCops' => { | |||
'Setting' => 'forty two' | |||
}, | |||
'Metrics/BlockLength' => { |
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.
Nice the spec explains the behavior now!
6764c53
to
73bc726
Compare
Its last use was before v3.0.0, before `RSpec/Capybara` was extracted.
AMENDMENTS was defined as a String, not an Array. And splatting the array into `#gsub` doesn't work if there is more than one element - we would need to use `Regexp.union` instead... but actually I ended up removing AMENDMENTS altogether. All we want to do is to add an extra newline before each cop entry. Only new cop entries starts at the beginning of line, and contains a slash character after the first word. This means we don't need AMENDMENTS at all, and we no longer need the capture in EXTENSION_ROOT_DEPARTMENT.
79a329f
to
e79ec49
Compare
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.
SUBDEPARTMENTS
was last used in ConfigFormatter before we released v3.0.0, beforeRSpec/Capybara
was extracted. It’s being removed in this PR.Also, initially wanting to improve spec branch coverage for ConfigFormatter,
I found thatActually I ended up removingAMENDMENTS
was defined as a String, not an Array. And splatting the array into#gsub
doesn't work if there is more than one element - we need to useRegexp.union
instead.AMENDMENDS
altogether.To avoid conflicts with other PRs improving code coverage, the .simplecov file is not updated here.
Before submitting the PR make sure the following are checked:
master
(if not - rebase it).Added an entry to theCHANGELOG.md
if the new code introduces user-observable changes.bundle exec rake
) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).