mirror of
https://github.com/dev-sec/linux-baseline
synced 2024-11-26 13:00:21 +00:00
add lint rake task with robocop and fix issues
This commit is contained in:
parent
ce048c7324
commit
ae8d37b81d
7 changed files with 23 additions and 0 deletions
1
Gemfile
1
Gemfile
|
@ -2,3 +2,4 @@ source 'https://rubygems.org'
|
|||
|
||||
gem 'rake'
|
||||
gem 'serverspec'
|
||||
gem 'rubocop', '~> 0.18.1'
|
12
Rakefile
12
Rakefile
|
@ -1,6 +1,18 @@
|
|||
require 'rake'
|
||||
require 'rspec/core/rake_task'
|
||||
require 'rubocop/rake_task'
|
||||
|
||||
# Rubocop
|
||||
desc 'Run Rubocop lint checks'
|
||||
task :rubocop do
|
||||
Rubocop::RakeTask.new
|
||||
end
|
||||
|
||||
# Lint the cookbook
|
||||
desc "Run linters"
|
||||
task :lint => [ :rubocop ]
|
||||
|
||||
# Serverspec tests
|
||||
suites = Dir.glob('*').select{|entry| File.directory?(entry) }
|
||||
|
||||
class ServerspecTask < RSpec::Core::RakeTask
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# encoding: utf-8
|
||||
|
||||
if ENV['STANDALONE_SPEC']
|
||||
|
||||
require 'serverspec'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# encoding: utf-8
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.configure do |c|
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# encoding: utf-8
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'preloaded modules' do
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# encoding: utf-8
|
||||
|
||||
require 'serverspec'
|
||||
require 'pathname'
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# encoding: utf-8
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'System sysctl' do
|
||||
|
|
Loading…
Reference in a new issue