-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use single quotes in generated template steps #1323
Conversation
Looks like I missed some of the cucumber steps which effect my change. I will updated those. I also see that there is an error in some of the ruby version with the google-protobuf gem, which I think is a dependency through cucumber-messages? If I am reading that correctly. I will try to investigate, and at least give a link if there is already an issue opened for it. |
791e154
to
246504c
Compare
When pending steps are generated for undefined steps, the step name does not include any interpolation so double-quotes are not necessary. Only the single-quotes are necessary for those strings. This will make the generated steps allow consistent with the ruby style guide: https://github.com/rubocop-hq/ruby-style-guide#strings And with the default settings for Rubocop Style/StringLiterals cop: https://github.com/rubocop-hq/rubocop/blob/ab6346ed37d88a4b900c96979f8ef18959e8dcce/lib/rubocop/cop/style/string_literals.rb
a05c839
to
9307bbb
Compare
I think that I have fixed the errors related to my changes, and the test seem to be green on all the ruby versions. It appears that the jruby test is failing to install google-protbuf, probably because of this issue |
I think this PR also fixes #1291 which has been open for a while! |
LGTM! The other build errors are unrelated - sorry about that. |
Hi @acant, Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾 In return for this generous offer we hope you will:
On behalf of the Cucumber core team, |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Update the missing step generation template to use single-quotes for strings instead of double-quotes.
Details
When pending steps are generated for undefined steps, the step name does
not include any interpolation so double-quotes are not necessary. Only
the single-quotes are necessary for those strings.
This will make the generated steps allow consistent with the ruby style guide:
https://github.com/rubocop-hq/ruby-style-guide#strings
And with the default settings for Rubocop Style/StringLiterals cop:
https://github.com/rubocop-hq/rubocop/blob/ab6346ed37d88a4b900c96979f8ef18959e8dcce/lib/rubocop/cop/style/string_literals.rb
Motivation and Context
This will make it easier to use the generated steps, in a project using Rubocop, by making those steps already back the default Rubocop rules.
How Has This Been Tested?
I have updated the existing cucumber and rspec tests for the step generation.
Types of changes
Checklist:
Thank you to everyone who works on cucumber. I use in in my work and personal projects, and I am very grateful that it exists!
This is my first PR to a cucumber repo, so if there is anything that I got wrong, or can do to make it easier to merge, please let me know and I will try to update it quickly.