Skip to content

Commit

Permalink
Merge pull request #19 from mlafeldt/rubocop
Browse files Browse the repository at this point in the history
Add RuboCop style and lint checks
  • Loading branch information
mlafeldt committed Feb 2, 2014
2 parents fa69564 + cb56f75 commit 525023d
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 15 deletions.
22 changes: 22 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
AllCops:
Includes:
- Berksfile
- Gemfile
- Rakefile
- Vagrantfile
Excludes:
- test/**
- vendor/**

AlignParameters:
Enabled: false
Encoding:
Enabled: false
HashSyntax:
Enabled: false
LineLength:
Enabled: false
MethodLength:
Max: 30
StringLiterals:
Enabled: false
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ source "https://rubygems.org"
gem "berkshelf", "~> 2.0"
gem "foodcritic", "~> 3.0"
gem "rake"
gem "rubocop"

group :integration do
gem "test-kitchen", "~> 1.0"
Expand Down
30 changes: 22 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ GEM
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
addressable (2.3.5)
akami (1.2.0)
akami (1.2.1)
gyoku (>= 0.4.0)
nokogiri (>= 1.4.0)
berkshelf (2.0.12)
nokogiri
ast (1.1.0)
berkshelf (2.0.13)
activesupport (~> 3.2.0)
addressable (~> 2.3.4)
buff-shell_out (~> 0.1)
chozo (>= 0.6.1)
faraday (~> 0.8.0)
faraday (~> 0.8.5)
hashie (>= 2.0.2)
minitar (~> 0.5.4)
Expand Down Expand Up @@ -66,28 +68,33 @@ GEM
kitchen-vagrant (0.14.0)
test-kitchen (~> 1.0)
little-plugger (1.1.3)
logging (1.8.1)
logging (1.8.2)
little-plugger (>= 1.1.3)
multi_json (>= 1.3.6)
multi_json (>= 1.8.4)
minitar (0.5.4)
mixlib-authentication (1.3.0)
mixlib-log
mixlib-log (1.6.0)
mixlib-shellout (1.3.0)
multi_json (1.8.4)
multipart-post (1.2.0)
net-http-persistent (2.9)
net-http-persistent (2.9.1)
net-scp (1.1.2)
net-ssh (>= 2.6.5)
net-ssh (2.7.0)
net-ssh (2.8.0)
nio4r (1.0.0)
nokogiri (1.5.11)
nori (1.1.5)
parser (2.1.4)
ast (~> 1.1)
slop (~> 3.4, >= 3.4.5)
polyglot (0.3.3)
powerpack (0.0.9)
rack (1.5.2)
rainbow (2.0.0)
rake (10.1.1)
rbzip2 (0.2.0)
retryable (1.3.4)
retryable (1.3.5)
ridley (1.5.3)
addressable
buff-config (~> 0.2)
Expand All @@ -108,6 +115,11 @@ GEM
solve (>= 0.4.4)
varia_model (~> 0.1)
winrm (~> 1.1.0)
rubocop (0.18.1)
json (>= 1.7.7, < 2)
parser (~> 2.1.3)
powerpack (~> 0.0.6)
rainbow (>= 1.99.1, < 3.0)
rubyntlm (0.1.1)
safe_yaml (0.9.7)
savon (0.9.5)
Expand All @@ -118,6 +130,7 @@ GEM
nokogiri (>= 1.4.0)
nori (~> 1.0)
wasabi (~> 1.0)
slop (3.4.7)
solve (0.8.2)
test-kitchen (1.1.1)
mixlib-shellout (~> 1.2)
Expand Down Expand Up @@ -155,4 +168,5 @@ DEPENDENCIES
foodcritic (~> 3.0)
kitchen-vagrant
rake
rubocop
test-kitchen (~> 1.0)
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,12 @@ for all created users.

The following Rake tasks are provided for automated testing of the cookbook:

* `rake lint` - Run [Foodcritic] lint checks
* `rake rubocop` - Run [RuboCop] style and lint checks
* `rake foodcritic` - Run [Foodcritic] lint checks
* `rake integration` - Run [Test Kitchen] integration tests (provisions a
Vagrant VM using this cookbook and then tests the infrastructure with
[Serverspec])
* `rake test` - Run both lint checks and integration tests
* `rake test` - Run all tests

## License and Authorship

Expand Down Expand Up @@ -161,6 +162,7 @@ We welcome contributed improvements and bug fixes via the usual workflow:
[Foodcritic]: http://www.foodcritic.io/
[pr-seeds]: https://github.com/elm-city-craftworks/practicing-ruby-web/blob/master/db/seeds.rb
[pr-web]: https://github.com/elm-city-craftworks/practicing-ruby-web
[RuboCop]: https://github.com/bbatsov/rubocop
[Serverspec]: http://serverspec.org/
[Test Kitchen]: http://kitchen.ci/
[vagrant-omnibus]: https://github.com/schisamo/vagrant-omnibus
Expand Down
12 changes: 8 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
require "foodcritic"
require "rubocop/rake_task"

desc "Run RuboCop style and lint checks"
Rubocop::RakeTask.new(:rubocop)

desc "Run Foodcritic lint checks"
FoodCritic::Rake::LintTask.new(:lint) do |t|
FoodCritic::Rake::LintTask.new(:foodcritic) do |t|
t.options = { :fail_tags => ["any"] }
end

desc "Run all tests"
task :test => [:lint]
task :test => [:rubocop, :foodcritic]
task :default => :test

begin
Expand All @@ -28,8 +32,8 @@ namespace :vagrant do

task :berkshelf do
require "berkshelf"
Berkshelf::Berksfile.from_file("Berksfile").
install(:path => "vendor/cookbooks")
Berkshelf::Berksfile.from_file("Berksfile")
.install(:path => "vendor/cookbooks")
end

desc "Create the Vagrant machine"
Expand Down
2 changes: 1 addition & 1 deletion recipes/_postgresql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
:host => db["host"],
:port => node["postgresql"]["config"]["port"],
:username => db["username"],
:password => db["password"],
:password => db["password"]
)
end

0 comments on commit 525023d

Please sign in to comment.