From f90f9a03f5265baabf889bb82c24b300c5583463 Mon Sep 17 00:00:00 2001 From: Matt Brictson Date: Tue, 1 Mar 2016 20:13:57 -0800 Subject: [PATCH] Use %Q instead of bare % for string literals --- .rubocop.yml | 2 ++ features/support/remote_command_helpers.rb | 2 +- lib/capistrano/defaults.rb | 2 +- lib/capistrano/tasks/deploy.rake | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 6e1f8d25..e918c8ef 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,6 +3,8 @@ AllCops: DisplayStyleGuide: true TargetRubyVersion: 2.0 +Style/BarePercentLiterals: + EnforcedStyle: percent_q Style/ClassAndModuleChildren: Enabled: false Style/DoubleNegation: diff --git a/features/support/remote_command_helpers.rb b/features/support/remote_command_helpers.rb index 2f6a3ef3..bc25e8b5 100644 --- a/features/support/remote_command_helpers.rb +++ b/features/support/remote_command_helpers.rb @@ -12,7 +12,7 @@ module RemoteCommandHelpers end def exists?(type, path) - %{[ -#{type} "#{path}" ]} + %Q{[ -#{type} "#{path}" ]} end def safely_remove_file(_path) diff --git a/lib/capistrano/defaults.rb b/lib/capistrano/defaults.rb index 3cf07342..bbe3770d 100644 --- a/lib/capistrano/defaults.rb +++ b/lib/capistrano/defaults.rb @@ -1,7 +1,7 @@ validate :application do |_key, value| changed_value = value.gsub(/[^A-Z0-9\.\-]/i, "_") if value != changed_value - warn %(The :application value "#{value}" is invalid!) + warn %Q(The :application value "#{value}" is invalid!) warn "Use only letters, numbers, hyphens, dots, and underscores. For example:" warn " set :application, '#{changed_value}'" raise Capistrano::ValidationError diff --git a/lib/capistrano/tasks/deploy.rake b/lib/capistrano/tasks/deploy.rake index 677b23be..a8061a26 100644 --- a/lib/capistrano/tasks/deploy.rake +++ b/lib/capistrano/tasks/deploy.rake @@ -192,7 +192,7 @@ namespace :deploy do task :log_revision do on release_roles(:all) do within releases_path do - execute :echo, %{"#{revision_log_message}" >> #{revision_log}} + execute :echo, %Q{"#{revision_log_message}" >> #{revision_log}} end end end