mirror of
https://github.com/dev-sec/linux-baseline
synced 2024-11-25 12:30:21 +00:00
b06edb2adc
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
32 lines
724 B
Ruby
32 lines
724 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'cookstyle'
|
|
require 'rake/testtask'
|
|
require 'rubocop/rake_task'
|
|
|
|
# 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
|
|
|
|
# lint the project
|
|
desc 'Run robocop linter'
|
|
task lint: [:rubocop]
|
|
|
|
# run tests
|
|
task default: [:lint, 'test:check']
|
|
|
|
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
|
|
end
|
|
end
|