Skip to content
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

Merged

Conversation

KessaPassa
Copy link
Contributor

@KessaPassa KessaPassa commented Jun 23, 2023

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:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@KessaPassa KessaPassa changed the title [Fix rubocop#11836] should not offence single-quoted symbol containing double quotes [Fix rubocop#11836] should not offence single-quoted symbol containing double quotes in Lint/SymbolConversion Jun 23, 2023
@KessaPassa KessaPassa changed the title [Fix rubocop#11836] should not offence single-quoted symbol containing double quotes in Lint/SymbolConversion [#11836] should not offence single-quoted symbol containing double quotes in Lint/SymbolConversion Jun 23, 2023
@KessaPassa KessaPassa changed the title [#11836] should not offence single-quoted symbol containing double quotes in Lint/SymbolConversion [#11836] should not offense single-quoted symbol containing double quotes in Lint/SymbolConversion Jun 23, 2023
@@ -0,0 +1 @@
* [#11836](https://github.com/rubocop/rubocop/issues/11836): should not offense single-quoted symbol containing double quotes in `Lint/SymbolConversion`. ([@KessaPassa][])
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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]'

Copy link
Contributor Author

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.

@KessaPassa KessaPassa force-pushed the feat/symbol-conversion-in-double-quote branch from d5b5268 to 747db16 Compare June 23, 2023 05:24
@KessaPassa KessaPassa marked this pull request as ready for review June 23, 2023 05:56
Comment on lines 50 to 60
expect_no_offenses(<<~RUBY)
:'foo-bar'
RUBY

expect_no_offenses(<<~RUBY)
:'foo-bar""'
RUBY
Copy link
Member

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.

Suggested change
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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed
a90df2d

@koic
Copy link
Member

koic commented Jun 23, 2023

Looks good to me. Can you squash your commits into one?

…g double quotes

fix: split tests for independence
@KessaPassa KessaPassa force-pushed the feat/symbol-conversion-in-double-quote branch from a90df2d to a263e4e Compare June 24, 2023 05:19
@koic koic merged commit 2339e26 into rubocop:master Jun 24, 2023
28 checks passed
@koic
Copy link
Member

koic commented Jun 24, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants