Zfilipin has uploaded a new change for review. https://gerrit.wikimedia.org/r/233370
Change subject: Fixed Style/AlignParameters RuboCop offense ...................................................................... Fixed Style/AlignParameters RuboCop offense Bug: T106220 Change-Id: Ia729f16012d5b7898d68ecede88af69e6b4ae268 --- M .rubocop_todo.yml M Vagrantfile M lib/mediawiki-vagrant/settings/definitions.rb M spec/mediawiki_vagrant/settings_definer_spec.rb 4 files changed, 47 insertions(+), 53 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/70/233370/1 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 6e20716..758cf33 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -23,12 +23,6 @@ Metrics/LineLength: Max: 129 -# Offense count: 15 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/AlignParameters: - Enabled: false - # Offense count: 5 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. diff --git a/Vagrantfile b/Vagrantfile index 2ec15e3..dd120a3 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -116,12 +116,12 @@ end config.vm.network :forwarded_port, - guest: 80, host: settings[:http_port], id: 'http' + guest: 80, host: settings[:http_port], id: 'http' settings[:forward_ports].each { |guest_port,host_port| config.vm.network :forwarded_port, - :host => host_port, :guest => guest_port, - auto_correct: true + :host => host_port, :guest => guest_port, + auto_correct: true } unless settings[:forward_ports].nil? root_share_options = {:id => 'vagrant-root'} @@ -149,9 +149,9 @@ # however, so avoid that in puppet code and account for it in shell # scripts. config.vm.synced_folder './logs', '/vagrant/logs', - id: 'vagrant-logs', - owner: 'www-data', - group: 'www-data' + id: 'vagrant-logs', + owner: 'www-data', + group: 'www-data' end config.vm.provider :virtualbox do |vb| @@ -179,7 +179,7 @@ config.vm.provider :lxc do |lxc, _override| lxc.customize 'cgroup.memory.limit_in_bytes', - "#{settings[:vagrant_ram]}M" + "#{settings[:vagrant_ram]}M" end config.vm.provision :lsb_check do |lsb| diff --git a/lib/mediawiki-vagrant/settings/definitions.rb b/lib/mediawiki-vagrant/settings/definitions.rb index 836a0d7..76d7030 100644 --- a/lib/mediawiki-vagrant/settings/definitions.rb +++ b/lib/mediawiki-vagrant/settings/definitions.rb @@ -3,61 +3,61 @@ module MediaWikiVagrant Settings.define do setting :git_user, - description: "Your git/Gerrit username", - help: "Enter 'anonymous' for anonymous access, leave blank to manage it yourself", - allows_empty: true + description: "Your git/Gerrit username", + help: "Enter 'anonymous' for anonymous access, leave blank to manage it yourself", + allows_empty: true setting :vagrant_ram, - description: "Amount of RAM (in MB) allocated to the guest VM", - help: "Specify 'auto' to automatically allocate 1/4 of your system's memory", - default: 1536, - auto: -> { Environment.total_memory / 4 }, - coercion: ->(setting, new) { [setting.default, new.to_i].max }, - combiner: ->(setting, new) { setting.value + new.to_i } + description: "Amount of RAM (in MB) allocated to the guest VM", + help: "Specify 'auto' to automatically allocate 1/4 of your system's memory", + default: 1536, + auto: -> { Environment.total_memory / 4 }, + coercion: ->(setting, new) { [setting.default, new.to_i].max }, + combiner: ->(setting, new) { setting.value + new.to_i } setting :vagrant_cores, - description: "CPU cores allocated to the guest VM", - help: "All of your host system's cores are allocated by default.", - default: :auto, - auto: -> { Environment.total_cpus }, - coercion: ->(_setting, new) { new && new.to_i } + description: "CPU cores allocated to the guest VM", + help: "All of your host system's cores are allocated by default.", + default: :auto, + auto: -> { Environment.total_cpus }, + coercion: ->(_setting, new) { new && new.to_i } setting :static_ip, - description: "IP address assigned to the guest VM", - default: "10.11.12.13" + description: "IP address assigned to the guest VM", + default: "10.11.12.13" setting :http_port, - description: "Host port forwarded to the guest VM's HTTP server (port 80)", - default: 8080, - coercion: ->(_setting, new) { new && new.to_i } + description: "Host port forwarded to the guest VM's HTTP server (port 80)", + default: 8080, + coercion: ->(_setting, new) { new && new.to_i } setting :nfs_shares, - description: "Use synced folders backed by NFS", - help: "Enter 'yes' or 'no'. NFS is faster, but unsupported on Windows and with some encrypted filesystems on Linux", - default: defined?(Vagrant::Util::Platform) ? !Vagrant::Util::Platform.windows? : true, - coercion: ->(_setting, new) { !!(new.to_s =~ /^(true|t|yes|y|1)$/i) } + description: "Use synced folders backed by NFS", + help: "Enter 'yes' or 'no'. NFS is faster, but unsupported on Windows and with some encrypted filesystems on Linux", + default: defined?(Vagrant::Util::Platform) ? !Vagrant::Util::Platform.windows? : true, + coercion: ->(_setting, new) { !!(new.to_s =~ /^(true|t|yes|y|1)$/i) } setting :nfs_cache, - description: "Use cachefilesd to speed up NFS file access (EXPERIMENTAL)", - help: "Enter 'yes' or 'no'. If your VM is currently running, reload it after changing this setting.", - default: false, - coercion: ->(_setting, new) { !!(new.to_s =~ /^(true|t|yes|y|1)$/i) } + description: "Use cachefilesd to speed up NFS file access (EXPERIMENTAL)", + help: "Enter 'yes' or 'no'. If your VM is currently running, reload it after changing this setting.", + default: false, + coercion: ->(_setting, new) { !!(new.to_s =~ /^(true|t|yes|y|1)$/i) } setting :forward_agent, - description: "Enable agent forwarding over SSH connections by default", - help: "Enter 'yes' or 'no'. Agent forwarding requires an SSH agent running on the host computer.", - default: false, - coercion: ->(_setting, new) { !!(new.to_s =~ /^(true|t|yes|y|1)$/i) } + description: "Enable agent forwarding over SSH connections by default", + help: "Enter 'yes' or 'no'. Agent forwarding requires an SSH agent running on the host computer.", + default: false, + coercion: ->(_setting, new) { !!(new.to_s =~ /^(true|t|yes|y|1)$/i) } setting :forward_ports, - internal: true, - default: {}, - coercion: ->(setting, new) { setting.value.merge(Hash[new.map { |kv| kv.map(&:to_i) }]) } + internal: true, + default: {}, + coercion: ->(setting, new) { setting.value.merge(Hash[new.map { |kv| kv.map(&:to_i) }]) } setting :forward_x11, - description: "Enable X11 forwarding over SSH connections by default", - help: "Enter 'yes' or 'no'. X11 forwarding enables GUI applications to be run on the guest.", - default: true, - coercion: ->(_setting, new) { !!(new.to_s =~ /^(true|t|yes|y|1)$/i) } + description: "Enable X11 forwarding over SSH connections by default", + help: "Enter 'yes' or 'no'. X11 forwarding enables GUI applications to be run on the guest.", + default: true, + coercion: ->(_setting, new) { !!(new.to_s =~ /^(true|t|yes|y|1)$/i) } end end diff --git a/spec/mediawiki_vagrant/settings_definer_spec.rb b/spec/mediawiki_vagrant/settings_definer_spec.rb index c30dde0..0635b6e 100644 --- a/spec/mediawiki_vagrant/settings_definer_spec.rb +++ b/spec/mediawiki_vagrant/settings_definer_spec.rb @@ -13,8 +13,8 @@ context 'when settings have been defined' do let(:foo_setting) do settings_class.setting :foo, - description: 'foo setting', - help: 'help with foo' + description: 'foo setting', + help: 'help with foo' end before { foo_setting } -- To view, visit https://gerrit.wikimedia.org/r/233370 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia729f16012d5b7898d68ecede88af69e6b4ae268 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