linux-baseline/Rakefile

33 lines
724 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'cookstyle'
2016-02-16 11:38:48 +00:00
require 'rake/testtask'
require 'rubocop/rake_task'
2014-06-05 08:50:37 +00:00
# Rubocop
desc 'Run Rubocop lint checks'
task :rubocop do
RuboCop::RakeTask.new
end
RuboCop::RakeTask.new(:cookstyle) do |task|
task.options << '--display-cop-names'
end
2016-02-16 11:38:48 +00:00
# lint the project
desc 'Run robocop linter'
task lint: [:rubocop]
2016-02-16 11:38:48 +00:00
# run tests
task default: [:lint, 'test:check']
2014-06-05 08:50:37 +00:00
2016-02-16 11:38:48 +00:00
namespace :test do
# run inspec check to verify that the profile is properly configured
task :check do
require 'inspec'
puts "Checking profile with InSpec Version: #{Inspec::VERSION}"
profile = Inspec::Profile.for_target('.', backend: Inspec::Backend.create(Inspec::Config.mock))
pp profile.check
2014-06-05 08:50:37 +00:00
end
end