[MediaWiki-commits] [Gerrit] Fixed RuboCop Style/AndOr offense - change (mediawiki/vagrant)
jenkins-bot has submitted this change and it was merged. Change subject: Fixed RuboCop Style/AndOr offense .. Fixed RuboCop Style/AndOr offense Additionally changed expression `not ARGV.empty?` to `ARGV.any?` which is slightly more readable and less prone to confusion over operator precedence. Bug: T106220 Change-Id: I276d60eb1e6155f71d523f22da22329b1678ec3e --- M .rubocop_todo.yml M lib/labs-vagrant.rb M lib/mediawiki-vagrant/paste-puppet.rb 3 files changed, 4 insertions(+), 10 deletions(-) Approvals: Dduvall: Looks good to me, approved jenkins-bot: Verified diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 758cf33..0762a50 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -25,12 +25,6 @@ # Offense count: 5 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/AndOr: - Enabled: false - -# Offense count: 5 -# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods. Style/BlockDelimiters: Enabled: false diff --git a/lib/labs-vagrant.rb b/lib/labs-vagrant.rb index ba0bac2..03ca12b 100755 --- a/lib/labs-vagrant.rb +++ b/lib/labs-vagrant.rb @@ -26,7 +26,7 @@ puts 'Use labs-vagrant enable-role labs-vagrant disable-role to customize.' when 'reset-roles' - if not ARGV.empty? or ['-h', '--help'].include? ARGV.first + if ARGV.any? || ['-h', '--help'].include?(ARGV.first) puts 'Disable all optional roles.' puts 'USAGE: labs-vagrant reset-roles' end @@ -36,7 +36,7 @@ puts COMMIT_CHANGES when 'enable-role' - if ARGV.empty? or ['-h', '--help'].include? ARGV.first + if ARGV.empty? || ['-h', '--help'].include?(ARGV.first) puts 'Enable an optional role (run labs-vagrant list-roles for a list).' puts 'USAGE: labs-vagrant enable-role ROLE' return 0 @@ -52,7 +52,7 @@ puts COMMIT_CHANGES when 'disable-role' - if ARGV.empty? or ['-h', '--help'].include? ARGV.first + if ARGV.empty? || ['-h', '--help'].include?(ARGV.first) puts 'Disable one or more optional roles.' puts 'USAGE: labs-vagrant disable-role ROLE' return 0 diff --git a/lib/mediawiki-vagrant/paste-puppet.rb b/lib/mediawiki-vagrant/paste-puppet.rb index 2b13c3c..cee1b74 100644 --- a/lib/mediawiki-vagrant/paste-puppet.rb +++ b/lib/mediawiki-vagrant/paste-puppet.rb @@ -16,7 +16,7 @@ def execute begin res = Net::HTTP.post_form URL, content: latest_logfile.read -raise unless res.value.nil? and res.body =~ /^[^]+$/ +raise unless res.value.nil? res.body =~ /^[^]+$/ rescue RuntimeError @env.ui.error Unexpected response from #{URL}. 1 -- To view, visit https://gerrit.wikimedia.org/r/233372 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I276d60eb1e6155f71d523f22da22329b1678ec3e Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Zfilipin zfili...@wikimedia.org Gerrit-Reviewer: BryanDavis bda...@wikimedia.org Gerrit-Reviewer: Dduvall dduv...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixed RuboCop Style/AndOr offense - change (mediawiki/vagrant)
Zfilipin has uploaded a new change for review. https://gerrit.wikimedia.org/r/233372 Change subject: Fixed RuboCop Style/AndOr offense .. Fixed RuboCop Style/AndOr offense Bug: T106220 Change-Id: I276d60eb1e6155f71d523f22da22329b1678ec3e --- M .rubocop_todo.yml M lib/labs-vagrant.rb M lib/mediawiki-vagrant/paste-puppet.rb 3 files changed, 4 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/72/233372/1 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 758cf33..0762a50 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -25,12 +25,6 @@ # Offense count: 5 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/AndOr: - Enabled: false - -# Offense count: 5 -# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods. Style/BlockDelimiters: Enabled: false diff --git a/lib/labs-vagrant.rb b/lib/labs-vagrant.rb index ba0bac2..b56c718 100755 --- a/lib/labs-vagrant.rb +++ b/lib/labs-vagrant.rb @@ -26,7 +26,7 @@ puts 'Use labs-vagrant enable-role labs-vagrant disable-role to customize.' when 'reset-roles' - if not ARGV.empty? or ['-h', '--help'].include? ARGV.first + if not ARGV.empty? || ['-h', '--help'].include?(ARGV.first) puts 'Disable all optional roles.' puts 'USAGE: labs-vagrant reset-roles' end @@ -36,7 +36,7 @@ puts COMMIT_CHANGES when 'enable-role' - if ARGV.empty? or ['-h', '--help'].include? ARGV.first + if ARGV.empty? || ['-h', '--help'].include?(ARGV.first) puts 'Enable an optional role (run labs-vagrant list-roles for a list).' puts 'USAGE: labs-vagrant enable-role ROLE' return 0 @@ -52,7 +52,7 @@ puts COMMIT_CHANGES when 'disable-role' - if ARGV.empty? or ['-h', '--help'].include? ARGV.first + if ARGV.empty? || ['-h', '--help'].include?(ARGV.first) puts 'Disable one or more optional roles.' puts 'USAGE: labs-vagrant disable-role ROLE' return 0 diff --git a/lib/mediawiki-vagrant/paste-puppet.rb b/lib/mediawiki-vagrant/paste-puppet.rb index 2b13c3c..cee1b74 100644 --- a/lib/mediawiki-vagrant/paste-puppet.rb +++ b/lib/mediawiki-vagrant/paste-puppet.rb @@ -16,7 +16,7 @@ def execute begin res = Net::HTTP.post_form URL, content: latest_logfile.read -raise unless res.value.nil? and res.body =~ /^[^]+$/ +raise unless res.value.nil? res.body =~ /^[^]+$/ rescue RuntimeError @env.ui.error Unexpected response from #{URL}. 1 -- To view, visit https://gerrit.wikimedia.org/r/233372 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I276d60eb1e6155f71d523f22da22329b1678ec3e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Zfilipin zfili...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixed RuboCop Style/AndOr offense - change (mediawiki/vagrant)
Zfilipin has uploaded a new change for review. https://gerrit.wikimedia.org/r/233366 Change subject: Fixed RuboCop Style/AndOr offense .. Fixed RuboCop Style/AndOr offense Bug: T106220 Change-Id: I23acf58f1a71f5b6d9dc2c6c0dcdc13e3ce169e4 --- M .rubocop_todo.yml M lib/labs-vagrant.rb M lib/mediawiki-vagrant/paste-puppet.rb 3 files changed, 3 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/66/233366/1 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c142606..8a2c09b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -41,12 +41,6 @@ # Offense count: 5 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/AndOr: - Enabled: false - -# Offense count: 5 -# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods. Style/BlockDelimiters: Enabled: false diff --git a/lib/labs-vagrant.rb b/lib/labs-vagrant.rb index ba0bac2..fbfaf4c 100755 --- a/lib/labs-vagrant.rb +++ b/lib/labs-vagrant.rb @@ -36,7 +36,7 @@ puts COMMIT_CHANGES when 'enable-role' - if ARGV.empty? or ['-h', '--help'].include? ARGV.first + if ARGV.empty? || ['-h', '--help'].include?(ARGV.first) puts 'Enable an optional role (run labs-vagrant list-roles for a list).' puts 'USAGE: labs-vagrant enable-role ROLE' return 0 @@ -52,7 +52,7 @@ puts COMMIT_CHANGES when 'disable-role' - if ARGV.empty? or ['-h', '--help'].include? ARGV.first + if ARGV.empty? || ['-h', '--help'].include?(ARGV.first) puts 'Disable one or more optional roles.' puts 'USAGE: labs-vagrant disable-role ROLE' return 0 diff --git a/lib/mediawiki-vagrant/paste-puppet.rb b/lib/mediawiki-vagrant/paste-puppet.rb index 2b13c3c..cee1b74 100644 --- a/lib/mediawiki-vagrant/paste-puppet.rb +++ b/lib/mediawiki-vagrant/paste-puppet.rb @@ -16,7 +16,7 @@ def execute begin res = Net::HTTP.post_form URL, content: latest_logfile.read -raise unless res.value.nil? and res.body =~ /^[^]+$/ +raise unless res.value.nil? res.body =~ /^[^]+$/ rescue RuntimeError @env.ui.error Unexpected response from #{URL}. 1 -- To view, visit https://gerrit.wikimedia.org/r/233366 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I23acf58f1a71f5b6d9dc2c6c0dcdc13e3ce169e4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Zfilipin zfili...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits