Skip to content

Commit

Permalink
Merge pull request #13 from TelekomLabs/lint
Browse files Browse the repository at this point in the history
add lint rake task with robocop and fix issues
  • Loading branch information
Patrick Meier committed Jun 17, 2014
2 parents 71cb619 + ae8d37b commit 3d6eee9
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ source 'https://rubygems.org'

gem 'rake'
gem 'serverspec'
gem 'rubocop', '~> 0.18.1'
12 changes: 12 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions default/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# encoding: utf-8

if ENV['STANDALONE_SPEC']

require 'serverspec'
Expand Down
2 changes: 2 additions & 0 deletions default/serverspec/sysctl_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# encoding: utf-8

require 'spec_helper'

RSpec.configure do |c|
Expand Down
2 changes: 2 additions & 0 deletions modules_disabled/serverspec/modules_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# encoding: utf-8

require 'spec_helper'

describe 'preloaded modules' do
Expand Down
2 changes: 2 additions & 0 deletions modules_disabled/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# encoding: utf-8

require 'serverspec'
require 'pathname'

Expand Down
2 changes: 2 additions & 0 deletions modules_disabled/serverspec/sysctl_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# encoding: utf-8

require 'spec_helper'

describe 'System sysctl' do
Expand Down

0 comments on commit 3d6eee9

Please sign in to comment.