Update Gemfile and modernize Rakefile
This commit is contained in:
parent
3b97ec6626
commit
d85effdf41
11
Gemfile
11
Gemfile
@ -1,14 +1,15 @@
|
||||
source ENV['GEM_SOURCE'] || "https://rubygems.org"
|
||||
|
||||
group :test do
|
||||
gem "rake", '< 11.0'
|
||||
gem "puppet", ENV['PUPPET_GEM_VERSION'] || '~> 3.8.0'
|
||||
gem "rspec", '<= 3.1.0'
|
||||
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 4.9']
|
||||
gem "rake"
|
||||
gem "puppet", puppetversion
|
||||
gem "rspec", '> 3.4.0'
|
||||
gem "rspec-puppet"
|
||||
gem "puppetlabs_spec_helper"
|
||||
gem "metadata-json-lint"
|
||||
gem "rspec-puppet-facts"
|
||||
gem 'rubocop', '0.33.0'
|
||||
gem 'rubocop', '0.42.0'
|
||||
gem 'simplecov', '>= 0.11.0'
|
||||
gem 'simplecov-console'
|
||||
|
||||
@ -28,6 +29,8 @@ group :development do
|
||||
gem "travis-lint" if RUBY_VERSION >= '2.1.0'
|
||||
gem "puppet-blacksmith"
|
||||
gem "guard-rake" if RUBY_VERSION >= '2.2.5' # per dependency https://rubygems.org/gems/ruby_dep
|
||||
gem 'yard'
|
||||
gem 'puppet-strings'
|
||||
end
|
||||
|
||||
group :system_tests do
|
||||
|
||||
58
Rakefile
58
Rakefile
@ -1,40 +1,68 @@
|
||||
require 'rubygems'
|
||||
require 'bundler/setup'
|
||||
|
||||
require 'puppetlabs_spec_helper/rake_tasks'
|
||||
require 'puppet/version'
|
||||
require 'puppet-lint/tasks/puppet-lint'
|
||||
require 'puppet-syntax/tasks/puppet-syntax'
|
||||
require 'metadata-json-lint/rake_task'
|
||||
require 'rubocop/rake_task'
|
||||
|
||||
if Puppet.version.to_f >= 4.9
|
||||
require 'semantic_puppet'
|
||||
elsif Puppet.version.to_f >= 3.6 && Puppet.version.to_f < 4.9
|
||||
require 'puppet/vendor/semantic/lib/semantic'
|
||||
end
|
||||
|
||||
# These gems aren't always present, for instance
|
||||
# on Travis with --without development
|
||||
begin
|
||||
require 'puppet_blacksmith/rake_tasks'
|
||||
rescue LoadError # rubocop:disable Lint/HandleExceptions
|
||||
end
|
||||
|
||||
#RuboCop::RakeTask.new
|
||||
|
||||
exclude_paths = [
|
||||
'bundle/**/*',
|
||||
'pkg/**/*',
|
||||
'vendor/**/*',
|
||||
'spec/**/*'
|
||||
"bundle/**/*",
|
||||
"pkg/**/*",
|
||||
"vendor/**/*",
|
||||
"spec/**/*",
|
||||
]
|
||||
|
||||
# Coverage from puppetlabs-spec-helper requires rcov which
|
||||
# doesn't work in anything since 1.8.7
|
||||
#Rake::Task[:coverage].clear
|
||||
|
||||
Rake::Task[:lint].clear
|
||||
|
||||
PuppetLint.configuration.relative = true
|
||||
PuppetLint.configuration.disable_80chars
|
||||
PuppetLint.configuration.disable_class_inherits_from_params_class
|
||||
PuppetLint.configuration.disable_class_parameter_defaults
|
||||
PuppetLint.configuration.fail_on_warnings = true
|
||||
|
||||
PuppetLint::RakeTask.new :lint do |config|
|
||||
config.fail_on_warnings = true
|
||||
config.ignore_paths = exclude_paths
|
||||
config.disable_checks = [
|
||||
'80chars',
|
||||
'class_parameter_defaults',
|
||||
'documentation',
|
||||
'autoloader_layout'
|
||||
]
|
||||
end
|
||||
|
||||
PuppetSyntax.exclude_paths = exclude_paths
|
||||
|
||||
desc "Run acceptance tests"
|
||||
RSpec::Core::RakeTask.new(:acceptance) do |t|
|
||||
t.pattern = 'spec/acceptance'
|
||||
end
|
||||
|
||||
task :metadata do
|
||||
sh 'metadata-json-lint metadata.json'
|
||||
desc "Populate CONTRIBUTORS file"
|
||||
task :contributors do
|
||||
system("git log --format='%aN' | sort -u > CONTRIBUTORS")
|
||||
end
|
||||
|
||||
desc 'Run syntax, lint, and spec tests.'
|
||||
desc "Run syntax, lint, and spec tests."
|
||||
task :test => [
|
||||
:metadata_lint,
|
||||
:syntax,
|
||||
:lint,
|
||||
:rubocop,
|
||||
:spec,
|
||||
:metadata
|
||||
]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user