Browse Source

Sync basic module settings with icinga-icinga2

Markus Frosch 8 years ago
parent
commit
d91e8bdd4c
4 changed files with 67 additions and 26 deletions
  1. 32 4
      .gitignore
  2. 4 1
      .puppet-lint.rc
  3. 12 17
      Gemfile
  4. 19 4
      Rakefile

+ 32 - 4
.gitignore

@@ -1,6 +1,34 @@
+## MAC OS
 .DS_Store
-.bundle
+
+## editor
+*.tmproj
+tmtags
+*~
+\#*
+.\#*
+*.sw[op]
+tags
+.idea/
+
+## Bundler
 Gemfile.lock
-pkg
-spec/fixtures
-vendor
+.bundle
+vendor/
+
+## rbenv / rvm
+.rbenv*
+.rvmrc*
+.ruby-*
+
+## rspec
+spec/fixtures/
+
+## acceptance
+.vagrant/
+junit/
+log/
+
+## Puppet module
+pkg/
+coverage/

+ 4 - 1
.puppet-lint.rc

@@ -1 +1,4 @@
---no-80chars-check
+--fail-on-warnings
+--relative
+--no-80chars
+--no-class_inherits_from_params_class-check

+ 12 - 17
Gemfile

@@ -1,21 +1,16 @@
-source 'https://rubygems.org'
+source ENV['GEM_SOURCE'] || "https://rubygems.org"
 
-puppetversion = ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : ['>= 3.7.4']
-gem 'puppet', puppetversion
-
-if puppetversion =~ /^3/
-  ## rspec-hiera-puppet is puppet 3 only
-  gem 'rspec-hiera-puppet', '>=1.0.0'
+# special dependencies for Ruby 1.8
+# since there are still several OSes with it
+if RUBY_VERSION =~ /^1\.8\./
+  gem 'rspec-core', '~> 3.1.7'
+  gem 'nokogiri', '~> 1.5.0'
 end
 
-facterversion = ENV.key?('FACTER_VERSION') ? "~> #{ENV['FACTER_VERSION']}" : ['>= 2.4.1']
-
-gem 'facter', facterversion
-
-gem 'rake'
-gem 'rspec'
-gem 'puppet-lint', '>=1.1.0'
-gem 'rspec-puppet', :git => 'https://github.com/rodjek/rspec-puppet.git'
-gem 'puppetlabs_spec_helper', '>=0.8.2'
-gem 'puppet-syntax'
+gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}.0" : '>= 2.7'
+gem 'rspec-puppet', '~> 2.0'
+gem 'puppetlabs_spec_helper', '>= 0.1.0'
+gem 'puppet-lint', '>= 1'
+gem 'facter', '>= 1.7.0'
 
+gem 'puppet-lint-strict_indent-check'

+ 19 - 4
Rakefile

@@ -1,6 +1,21 @@
-require 'rake'
-
-require 'rspec/core/rake_task'
+require 'rubygems'
 require 'puppetlabs_spec_helper/rake_tasks'
+require 'puppet-lint/tasks/puppet-lint'
+
+if not ENV['SPEC_OPTS']
+  ENV['SPEC_OPTS'] = '--format documentation'
+end
+
+#PuppetLint.configuration.send('disable_documentation')
+#PuppetLint.configuration.send('disable_single_quote_string_with_variables')
+
+PuppetSyntax.exclude_paths = [ "vendor/**/*.*" ]
+PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "vendor/**/*.pp"]
+
+# Alternative configuration until https://github.com/rodjek/puppet-lint/pull/397 gets merged
+Rake::Task[:lint].clear
+PuppetLint::RakeTask.new :lint do |config|
+  config.ignore_paths = PuppetLint.configuration.ignore_paths
+end
 
-task :default => [:spec, :lint]
+task :all => [ :validate, :lint, :spec ]