Commit 78e94a55 authored by Markus Frosch's avatar Markus Frosch 📣

Add rubocop

parent 8faf2e92
require: rubocop-rspec
AllCops:
TargetRubyVersion: 1.9
Include:
- ./**/*.rb
Exclude:
- vendor/**/*
- .vendor/**/*
- pkg/**/*
- spec/fixtures/**/*
# We don't use rspec in this way
RSpec/DescribeClass:
Enabled: False
RSpec/ImplicitExpect:
Enabled: False
# Example length is not necessarily an indicator of code quality
RSpec/ExampleLength:
Enabled: False
RSpec/NamedSubject:
Enabled: False
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 2.7' gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 2.7'
gem 'rspec-puppet', '~> 2.0' gem 'rspec-puppet', '>= 2.0'
gem 'puppetlabs_spec_helper', '>= 0.1.0' gem 'puppetlabs_spec_helper', '>= 0.1.0'
gem 'puppet-lint', '>= 1' gem 'puppet-lint', '>= 1'
gem 'facter', '>= 1.7.0' gem 'facter', '>= 1.7.0'
gem 'rspec-puppet-facts', :require => false gem 'rspec-puppet-facts', :require => false
gem 'puppet-lint-strict_indent-check' gem 'puppet-lint-strict_indent-check'
gem 'puppet-lint-absolute_classname-check'
gem 'puppet-lint-leading_zero-check'
gem 'puppet-lint-trailing_comma-check'
gem 'puppet-lint-version_comparison-check'
gem 'puppet-lint-classes_and_types_beginning_with_digits-check'
gem 'puppet-lint-unquoted_string-check'
gem 'puppet-lint-variable_contains_upcase'
gem 'metadata-json-lint'
gem 'rubocop-rspec', '~> 1.6', :require => false if RUBY_VERSION >= '2.3.0'
...@@ -2,12 +2,10 @@ require 'rubygems' ...@@ -2,12 +2,10 @@ require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks' require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint' require 'puppet-lint/tasks/puppet-lint'
if not ENV['SPEC_OPTS'] ENV['SPEC_OPTS'] = '--format documentation' unless ENV['SPEC_OPTS']
ENV['SPEC_OPTS'] = '--format documentation'
end
PuppetSyntax.exclude_paths = [ "vendor/**/*.*" ] PuppetSyntax.exclude_paths = ['vendor/**/*.*']
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "vendor/**/*.pp"] PuppetLint.configuration.ignore_paths = %w(spec/**/*.pp pkg/**/*.pp vendor/**/*.pp)
# Alternative configuration until https://github.com/rodjek/puppet-lint/pull/397 gets merged # Alternative configuration until https://github.com/rodjek/puppet-lint/pull/397 gets merged
Rake::Task[:lint].clear Rake::Task[:lint].clear
...@@ -15,4 +13,4 @@ PuppetLint::RakeTask.new :lint do |config| ...@@ -15,4 +13,4 @@ PuppetLint::RakeTask.new :lint do |config|
config.ignore_paths = PuppetLint.configuration.ignore_paths config.ignore_paths = PuppetLint.configuration.ignore_paths
end end
task :all => [ :validate, :lint, :spec ] task :all => [:validate, :lint, :spec, :rubocop]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment