Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint #36

Merged
merged 2 commits into from Aug 26, 2014
Merged

Lint #36

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion .rubocop.yml
Expand Up @@ -17,8 +17,10 @@ HashSyntax:
LineLength:
Enabled: false
MethodLength:
Max: 30
Max: 40
NumericLiterals:
MinDigits: 10
Style/CyclomaticComplexity:
Max: 10
Metrics/PerceivedComplexity:
Max: 10
2 changes: 2 additions & 0 deletions Gemfile
@@ -1,3 +1,5 @@
# encoding: utf-8

source 'https://rubygems.org'

gem 'berkshelf', '~> 3.0'
Expand Down
46 changes: 24 additions & 22 deletions Guardfile
@@ -1,30 +1,32 @@
# Guardfile
# encoding: utf-8

# Guardfile

guard :rubocop do
watch(%r{.+\.rb$})
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
watch(/.+\.rb$/)
watch(/(?:.+\/)?\.rubocop\.yml$/) { |m| File.dirname(m[0]) }
end
guard :foodcritic, cookbook_paths: '.', cli: "-f any --tags ~FC023" do
watch(%r{attributes/.+\.rb$})
watch(%r{providers/.+\.rb$})
watch(%r{recipes/.+\.rb$})
watch(%r{resources/.+\.rb$})
watch(%r{metadata.rb})

guard :foodcritic, cookbook_paths: '.', cli: '-f any --tags ~FC023' do
watch(/attributes\/.+\.rb$/)
watch(/providers\/.+\.rb$/)
watch(/recipes\/.+\.rb$/)
watch(/resources\/.+\.rb$/)
watch(/metadata.rb/)
end

guard :rspec do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^(recipes)/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(/^spec\/.+_spec\.rb$/)
watch(/^(recipes)\/(.+)\.rb$/) { |m| "spec/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { 'spec' }
end

guard :kitchen, all_on_start: false do
watch(%r{test/.+})
watch(%r{^recipes/(.+)\.rb$})
watch(%r{^attributes/(.+)\.rb$})
watch(%r{^files/(.+)})
watch(%r{^templates/(.+)})
watch(%r{^providers/(.+)\.rb})
watch(%r{^resources/(.+)\.rb})
end
watch(/test\/.+/)
watch(/^recipes\/(.+)\.rb$/)
watch(/^attributes\/(.+)\.rb$/)
watch(/^files\/(.+)/)
watch(/^templates\/(.+)/)
watch(/^providers\/(.+)\.rb/)
watch(/^resources\/(.+)\.rb/)
end
12 changes: 9 additions & 3 deletions README.md
Expand Up @@ -85,11 +85,17 @@ bundle install
bundle exec rake lint

# Fetch tests
thor kitchen:fetch-remote-tests
bundle exec thor kitchen:fetch-remote-tests

# Kitchen test
bundle exec kitchen list
# fast test on one machine
bundle exec kitchen test default-ubuntu-1204

# test on all machines
bundle exec kitchen test

# for development
bundle exec kitchen create default-ubuntu-1204
bundle exec kitchen converge default-ubuntu-1204
```

For more information see [test-kitchen](http://kitchen.ci/docs/getting-started)
Expand Down