-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[#11836] should not offense single-quoted symbol containing double quotes in Lint/SymbolConversion
#11970
[#11836] should not offense single-quoted symbol containing double quotes in Lint/SymbolConversion
#11970
Conversation
Lint/SymbolConversion
Lint/SymbolConversion
Lint/SymbolConversion
changelog/fix_should_not_offence_single_quoted_symbol_containing_double_quotes.md
Outdated
Show resolved
Hide resolved
Lint/SymbolConversion
Lint/SymbolConversion
@@ -0,0 +1 @@ | |||
* [#11836](https://github.com/rubocop/rubocop/issues/11836): should not offense single-quoted symbol containing double quotes in `Lint/SymbolConversion`. ([@KessaPassa][]) |
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.
In order to pass the test, the changelog entry's sentence must start with an upper character.
rspec './spec/project_spec.rb[1:3:4:13:3:4:1]' # RuboCop Project Changelog future entries For D:/a/rubocop/rubocop/changelog/fix_should_not_offence_single_quoted_symbol_containing_double_quotes.md entry body does not start with a lower case
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.
Thank you for your advice!
I'm checking if the "bundle exec rake ascii_spec" command passes in the local environment.
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.
Yeah, for example, you may reproduce the minimal test results by running the following:
$ bundle exec rspec './spec/project_spec.rb[1:3:4:13:3:4:1]'
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.
Thank you!
I passed the rspec test.
d5b5268
to
747db16
Compare
expect_no_offenses(<<~RUBY) | ||
:'foo-bar' | ||
RUBY | ||
|
||
expect_no_offenses(<<~RUBY) | ||
:'foo-bar""' | ||
RUBY |
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.
That just my two cents. Can you split the tests for the sake of test independence? e.g.
expect_no_offenses(<<~RUBY) | |
:'foo-bar' | |
RUBY | |
expect_no_offenses(<<~RUBY) | |
:'foo-bar""' | |
RUBY | |
end | |
it 'does not register an offense for a symbol that requires single quotes' do | |
expect_no_offenses(<<~RUBY) | |
:'foo-bar' | |
RUBY | |
end | |
it 'does not register an offense for a symbol that requires single quotes, when it includes double quotes' do | |
expect_no_offenses(<<~RUBY) | |
:'foo-bar""' | |
RUBY |
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.
fixed
a90df2d
Looks good to me. Can you squash your commits into one? |
…g double quotes fix: split tests for independence
a90df2d
to
a263e4e
Compare
Thanks! |
Fixies #11836
This PR should not offense single-quoted symbol containing double quotes in
Lint/SymbolConversion
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.