-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Normalize heredoc delimiters #3533
Conversation
🤔 I see there are various There are two related cops we can consider to use as well if you're doing https://rubocop.readthedocs.io/en/latest/cops_naming/#namingheredocdelimitercase |
8094c7a
to
3410bb6
Compare
Good point @simi. I enabled |
@simi You ok with this? |
@@ -401,11 +401,11 @@ def self.paths=(env) | |||
target[k] = v | |||
when Array | |||
unless Gem::Deprecate.skip | |||
warn <<-eowarn | |||
warn <<-EOWARN |
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.
Can we unify this to use WARNING
as well?
@@ -23,11 +23,11 @@ def setup | |||
|
|||
def test_self_build | |||
File.open File.join(@ext, 'CMakeLists.txt'), 'w' do |cmakelists| | |||
cmakelists.write <<-eo_cmake | |||
cmakelists.write <<-EO_CMAKE |
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.
Would CMAKE
be enough here?
@@ -81,7 +81,7 @@ class TestGemRemoteFetcher < Gem::TestCase | |||
# Generated via: | |||
# x = OpenSSL::PKey::DH.new(2048) # wait a while... | |||
# x.to_s => pem | |||
TEST_KEY_DH2048 = OpenSSL::PKey::DH.new <<-_end_of_pem_ | |||
TEST_KEY_DH2048 = OpenSSL::PKey::DH.new <<-_END_OF_PEM_ |
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.
PEM
?
@@ -396,9 +396,9 @@ def test_resolve_git | |||
rs = Gem::RequestSet.new | |||
|
|||
tf = Tempfile.open 'gem.deps.rb' do |io| | |||
io.puts <<-gems_deps_rb | |||
io.puts <<-GEMS_DEPS_RB |
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.
If I understand it well, this is also just code ruby block. Any reason to not use RUBY
as well?
@@ -359,7 +359,7 @@ def test_show_release_notes | |||
@cmd.options[:previous_version] = Gem::Version.new '2.0.2' | |||
|
|||
File.open 'History.txt', 'w' do |io| | |||
io.puts <<-History_txt | |||
io.puts <<-HISTORY_TXT |
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.
Would TEXT
be enough here?
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.
Also can't we use
File.write('History.txt', <<-TEXT)
...
TEXT
here?
@deivid-rodriguez I left some minor non-blocking comments from my side. |
@simi I only made the necessary changes to get the Let me get this in and iterate on your suggestions next time I work on a style PR, ok? :) |
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.
Sure, good job anyway!
Description:
On another PR, I noticed that while normally we use
RUBY
as the delimiter for heredocs including ruby code, sometimes we useRB
.RUBY
is better so I'm replacingRB
occurrences withRUBY
.Tasks:
I will abide by the code of conduct.