Skip to content

Commit

Permalink
Fix whitespace-related Rubocop warnings across the tree
Browse files Browse the repository at this point in the history
Fix:
- Extra empty line detected at block body beginning.
- Extra blank line detected.
- Inconsistent indentation detected.
- Operator => should be surrounded by a single space.
...across all Ruby files in the tree. Noop.

Change-Id: I8bff4a836f98ce82a4f855333ce77d44287279ea
  • Loading branch information
paravoid authored and akosiaris committed Jun 8, 2017
1 parent aee079f commit a056de0
Show file tree
Hide file tree
Showing 55 changed files with 15 additions and 90 deletions.
9 changes: 2 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ namespace :syntax do
'syntax:hiera',
'syntax:templates',
]

end

RuboCop::RakeTask.new(:rubocop)
Expand All @@ -93,7 +92,6 @@ PuppetLint::RakeTask.new :puppetlint_head do |config|
config.pattern = git_changed_in_head ['.pp']
end


task :default => [:help]

desc 'Run all build/tests commands (CI entry point)'
Expand All @@ -105,7 +103,6 @@ task lint: [:typos, :rubocop, :syntax, :puppetlint]
desc 'Run all linting commands against HEAD'
task lint_head: [:typos, :rubocop, :"syntax:head", :puppetlint_head]


desc 'Show the help'
task :help do
puts "Puppet helper for operations/puppet.git
Expand All @@ -121,8 +118,8 @@ Welcome #{ENV['USER']} to WMFs wonderful rake helper to play with puppet.
# Show our tasks list.
system "rake -T"

puts "-----------------------------------------------------------------------"
puts "
puts "-----------------------------------------------------------------------"
puts "
Examples:
Validate syntax for all puppet manifests:
Expand All @@ -134,7 +131,6 @@ Validate manifests/nfs.pp and manifests/apaches.pp
Run puppet-lint style checker:
rake puppetlint
"

end

desc "Build documentation"
Expand Down Expand Up @@ -170,7 +166,6 @@ end

desc "Run spec tests found in modules"
task :spec do

# Hold a list of modules not passing tests.
failed_modules = []
ignored_modules = ['mysql', 'osm', 'puppetdbquery', 'stdlib', 'wdqs']
Expand Down
1 change: 0 additions & 1 deletion modules/aptrepo/spec/classes/aptrepo_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe 'aptrepo', :type => :class do

let(:params) {{ :basedir => '/srv/wikimedia' }}

it { should compile }
Expand Down
2 changes: 0 additions & 2 deletions modules/aptrepo/spec/classes/distribution_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe 'aptrepo::distribution', :type => :class do

let(:params) {{
:basedir => '/srv/wikimedia',
:settings => {
Expand All @@ -21,5 +20,4 @@
'group' => 'root',
})
end

end
3 changes: 1 addition & 2 deletions modules/bacula/spec/defines/fileset_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

describe 'bacula::director::fileset', :type => :define do
let(:title) { 'something' }
let(:params) { { :includes => [ "/", "/var", ], } }
let(:params) { { :includes => [ "/", "/var", ], } }

it 'should create /etc/bacula/conf.d/fileset-something.conf' do
should contain_file('/etc/bacula/conf.d/fileset-something.conf').with({
Expand Down Expand Up @@ -34,5 +34,4 @@
.with_content(/File = \/tmp/)
end
end

end
1 change: 0 additions & 1 deletion modules/base/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ symlinks = { 'spec/fixtures/modules/%s/files' % modulename => '../../../../files
'spec/fixtures/modules/%s/templates' % modulename => '../../../../templates',
}


task :setup do
FileUtils.mkdir_p('spec/fixtures/modules/%s' % modulename)
extra_modules.each do |x|
Expand Down
1 change: 0 additions & 1 deletion modules/base/files/monitoring/check_puppetrun
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def time_ago(s)
"Indeterminate amount of time (see time_ago)"
end


if failcount == :failed
puts "CRITICAL: Catalog fetch fail. Either compilation failed or puppetmaster has issues"
exit 2
Expand Down
1 change: 0 additions & 1 deletion modules/base/lib/facter/initsystem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
confine :kernel => %w{Linux FreeBSD OpenBSD SunOS Darwin GNU/kFreeBSD}

setcode do

if FileTest.exists?("/run/systemd/system")
# also see sd_booted(3)
result = "systemd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
available init scripts, and returns the chosen one.
HEREDOC
) do |vals|
name, init_system, has_systemd, has_systemd_override, has_upstart, has_sysvinit, strict = vals
name, init_system, has_systemd, has_systemd_override, has_upstart, has_sysvinit, strict = vals
has_custom = (has_systemd || has_upstart || has_sysvinit)
# if we don't have custom scripts, we use the system defaults
return false unless has_custom
Expand Down
1 change: 0 additions & 1 deletion modules/base/spec/defines/expose_puppet_certs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@
it { should contain_file('/my/ssl/dir/ssl/cert.pem').with({ 'ensure' => 'absent' }) }
it { should contain_file('/my/ssl/dir/ssl/server.key').with({ 'ensure' => 'absent' }) }
end

end
2 changes: 0 additions & 2 deletions modules/base/spec/defines/service_unit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
should contain_file('/etc/init.d/nginx').that_notifies('Exec[systemd reload for nginx]').that_notifies('Service[nginx]')
should contain_exec('systemd reload for nginx').that_comes_before('Service[nginx]')
end

end
end
context 'with refresh false' do
Expand All @@ -54,7 +53,6 @@
it 'should refresh service' do
should contain_file('/etc/init.d/nginx').that_notifies('Service[nginx]')
end

end
context 'with upstart as init' do
let(:facts) { {:initsystem => 'upstart'} }
Expand Down
1 change: 0 additions & 1 deletion modules/base/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))


RSpec.configure do |c|
c.module_path = File.expand_path("../..", File.dirname(__FILE__))
c.manifest_dir = File.join(fixture_path, 'manifests')
Expand Down
2 changes: 0 additions & 2 deletions modules/conftool/files/pooler_loop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
require 'net/http'
require 'facter'


PATH_ROOT = '/usr/local/bin/'

# default values
Expand Down Expand Up @@ -107,7 +106,6 @@ def check_pooled_state(ip, port, pool, host, want_pooled)
end
end


# do the whole procedure args[:cycles] times
(1..args[:cycles]).each do
# try to (de)pool the host we are on
Expand Down
1 change: 0 additions & 1 deletion modules/elasticsearch/spec/classes/elasticsearch_rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
.with_content(/-XX:\+PrintGCDateStamps$/)
}
end

end
1 change: 0 additions & 1 deletion modules/elasticsearch/spec/classes/https_rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@
should contain_package('nginx-full').with({ 'ensure' => 'absent' })
end
end

end
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe 'elasticsearch', :type => :class do

describe 'when NOT sending logs to logstash' do
let(:params) { { :cluster_name => 'my_cluster_name' } }
let(:facts) { { :lsbdistrelease => 'ubuntu',
Expand Down
1 change: 0 additions & 1 deletion modules/etcd/lib/puppet/type/etcd_role.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ def insync?(is)
is == should
end
end

end
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ def calc_url(aggregator, ip_octet)
format('%s:%d', url, port)
end


module Puppet::Parser::Functions
newfunction(:ganglia_aggregator_config, :type => :rvalue) do |_|
config = {}
Expand Down
2 changes: 0 additions & 2 deletions modules/git/spec/defines/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
require 'spec_helper'

describe 'git::userconfig', :type => :define do

let(:title) { 'gitconfig' }

context "Setting up user name and email" do
Expand All @@ -26,5 +25,4 @@
.with_content(/email = [email protected]\n/)
}
end

end
2 changes: 0 additions & 2 deletions modules/graphite/spec/functions/configparser_format_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe 'configparser_format' do

it 'should format hash into ini format' do
run.with_params({:section => {:param1 => 'value1', :param2 => 'value2'}})
.and_return(
Expand Down Expand Up @@ -37,5 +36,4 @@
"param1 = item1,item2\n"\
)
end

end
1 change: 0 additions & 1 deletion modules/graphite/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))


RSpec.configure do |c|
c.module_path = File.expand_path("../..", File.dirname(__FILE__))
c.manifest_dir = File.join(fixture_path, 'manifests')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe 'install_server::dhcp_server', :type => :class do

it { should compile }

it 'should have isc-dhcp-server' do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe 'install_server::preseed_server', :type => :class do

it { should compile }

it do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
require 'spec_helper'

describe 'install_server::tftp_server', :type => :class do

it { should compile }

it { should contain_package('atftpd').with_ensure('present') }

it do
Expand All @@ -16,10 +14,10 @@

it do
should contain_file('/srv/tftpboot').with({
'mode' => '0444',
'owner' => 'root',
'group' => 'root',
'recurse' => 'remote',
'mode' => '0444',
'owner' => 'root',
'group' => 'root',
'recurse' => 'remote',
})
end
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe 'install_server::web_server', :type => :class do

# Please wmflib.os_version()
let(:facts) { {
:lsbdistrelease => '8.5',
Expand Down
1 change: 0 additions & 1 deletion modules/mirrors/spec/classes/mirrors_debian_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe 'mirrors::debian', :type => :class do

it do
should contain_file('/srv/mirrors/debian').with({
'ensure' => 'directory',
Expand Down
1 change: 0 additions & 1 deletion modules/mirrors/spec/classes/mirrors_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe 'mirrors', :type => :class do

it { should contain_user('mirror') }
it { should contain_group('mirror') }
it { should contain_file('/srv/mirrors') }
Expand Down
1 change: 0 additions & 1 deletion modules/mirrors/spec/classes/mirrors_ubuntu_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe 'mirrors::ubuntu', :type => :class do

it do
should contain_file('/srv/mirrors/ubuntu/').with({
'ensure' => 'directory',
Expand Down
1 change: 0 additions & 1 deletion modules/nrpe/spec/defines/check_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@
should_not contain_file('/etc/nagios/nrpe.d/something.cfg')
end
end

end
1 change: 0 additions & 1 deletion modules/osm/spec/defines/osm_planet_sync_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@
it { should contain_file('/usr/local/bin/replicate-osm').with_content(/--input-reader xml/) }
end
end

end
4 changes: 2 additions & 2 deletions modules/postgresql/spec/classes/postgresql_ganglia.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

describe 'postgresql::ganglia', :type => :class do
let(:params) { {
:ensure => 'present',
:ensure => 'present',
}
}

Expand All @@ -14,7 +14,7 @@

describe 'postgresql::slave', :type => :class do
let(:params) { {
:ensure => 'absent',
:ensure => 'absent',
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/postgresql/spec/classes/postgresql_slave_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
:ensure => 'present',
:master_server => 'test',
:replication_pass => 'pass',
:root_dir => '/srv/postgres',
:root_dir => '/srv/postgres',
}
}
let(:facts) { { :lsbdistcodename => 'jessie' } }
Expand Down
1 change: 0 additions & 1 deletion modules/puppet_statsd/lib/puppet/reports/statsd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
Puppet::Reports.register_report(:statsd) do
desc = 'Send Puppet metrics to StatsD'


def load_config
config_file = File.join Puppet.settings[:confdir], 'statsd.yaml'
raise Puppet::ParseError, "#{config_file} is missing" unless File.exists? config_file
Expand Down
3 changes: 0 additions & 3 deletions modules/puppetmaster/files/puppet_ecdsacert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class PuppetECDSAGenError < StandardError
asn1_oid: 'prime256v1'
}


Log = Logger.new(STDOUT)

Log.level = Logger::INFO
Expand All @@ -39,7 +38,6 @@ class PuppetECDSAGenError < StandardError
format("%s %-5s (puppet-ecdsacert): %s\n", date_format, severity, msg)
end


# Ecdsa certificates generator class
# Generates the cert, the CSR, and sends the signing request to the puppetmaster
class PuppetECDSAGen
Expand Down Expand Up @@ -179,7 +177,6 @@ class CertificateAuthority
end
end


OptionParser.new do |opts|
opts.banner = "Usage: puppetecdsamanager [-c configfile] [-a SAN1,SAN2] common-name "
opts.on('-c', '--configfile CONF', 'Location of the config file') do |conf|
Expand Down
1 change: 0 additions & 1 deletion modules/scap/spec/types/scap_source_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
end
end


context "Default values" do
subject do
resource_class.new(:name => 'test/deploy')
Expand Down
Loading

0 comments on commit a056de0

Please sign in to comment.