Skip to content

Commit

Permalink
Merge pull request #365 from willmeek/modulesync_rubocop
Browse files Browse the repository at this point in the history
Modulesync rubocop
  • Loading branch information
tphoney committed Dec 14, 2017
2 parents e7f938f + 1306238 commit 1c6b38e
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 24 deletions.
31 changes: 15 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
#This file is generated by ModuleSync, do not edit.
pkg/
Gemfile.lock
Gemfile.local
vendor/
spec/fixtures/manifests/
spec/fixtures/modules/
log/
junit/
.vagrant/
#This file is generated by ModuleSync, do not edit.Z
*.iml
.*.sw[op]
.DS_Store
.bundle/
coverage/
log/
.idea/
.metadata
*.iml
.*.sw[op]
.vagrant/
.yardoc
.yardwarns
.DS_Store
Gemfile.local
Gemfile.lock
bin/
coverage/
doc/
junit/
log/
pkg/
spec/fixtures/manifests/
spec/fixtures/modules/
tmp/
vendor/
doc/

2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ Style/AsciiComments:
Style/IfUnlessModifier:
Enabled: false
Style/SymbolProc:
Enabled: false
Enabled: false
12 changes: 10 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,19 @@ def location_for(place_or_version, fake_version = nil)
end

# Used for gem conditionals
supports_windows = false
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = "#{ruby_version_segments[0]}.#{ruby_version_segments[1]}"

# The following gems are not included by default as they require DevKit on Windows.
# You should probably include them in a Gemfile.local or a ~/.gemfile
#gem 'pry' #this may already be included in the gemfile
#gem 'pry-stack_explorer', :require => false
#if RUBY_VERSION =~ /^2/
# gem 'pry-byebug'
#else
# gem 'pry-debugger'
#end

group :development do
gem "puppet-module-posix-default-r#{minor_version}", :require => false, :platforms => "ruby"
gem "puppet-module-win-default-r#{minor_version}", :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
Expand Down Expand Up @@ -62,7 +71,6 @@ gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'])
gem 'facter', *location_for(ENV['FACTER_GEM_VERSION']) if ENV['FACTER_GEM_VERSION']
gem 'hiera', *location_for(ENV['HIERA_GEM_VERSION']) if ENV['HIERA_GEM_VERSION']


# Evaluate Gemfile.local if it exists
if File.exists? "#{__FILE__}.local"
eval(File.read("#{__FILE__}.local"), binding)
Expand Down
6 changes: 3 additions & 3 deletions lib/puppet/provider/vcsrepo/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def create
if @resource.value(:revision)
checkout
end
if !ensure_bare_or_mirror? && @resource.value(:submodules) == :true # rubocop:disable Lint/BooleanSymbol : Test's break if Boolean symbol is removed
if !ensure_bare_or_mirror? && @resource.value(:submodules) == :true
update_submodules
end

Expand Down Expand Up @@ -92,7 +92,7 @@ def revision=(desired)
end
end
# TODO: Would this ever reach here if it is bare?
if !ensure_bare_or_mirror? && @resource.value(:submodules) == :true # rubocop:disable Lint/BooleanSymbol : Test's break if Boolean symbol is removed
if !ensure_bare_or_mirror? && @resource.value(:submodules) == :true
update_submodules
end
update_owner_and_excludes
Expand Down Expand Up @@ -549,7 +549,7 @@ def git_version

# @!visibility private
def git_with_identity(*args)
if @resource.value(:trust_server_cert) == :true # rubocop:disable Lint/BooleanSymbol : Test's break if Boolean symbol is removed
if @resource.value(:trust_server_cert) == :true
git_ver = git_version
git_ver_err = "Can't set sslVerify to false, the -c parameter is not supported in Git #{git_ver}. Please install Git 1.7.2 or higher."
return raise(git_ver_err) unless Gem::Version.new(git_ver) >= Gem::Version.new('1.7.2')
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/vcsrepo/svn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def buildargs
args.push('--config-dir', @resource.value(:configuration))
end

if @resource.value(:trust_server_cert) != :false # rubocop:disable Lint/BooleanSymbol
if @resource.value(:trust_server_cert) != :false
args.push('--trust-server-cert')
end

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/vcsrepo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def insync?(is)
newparam :trust_server_cert do
desc 'Trust server certificate'
newvalues(true, false)
defaultto :false # rubocop:disable Lint/BooleanSymbol
defaultto :false
end

autorequire(:package) do
Expand Down

0 comments on commit 1c6b38e

Please sign in to comment.