Skip to content

Commit

Permalink
Add RuboCop lint to default rake task
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbrictson committed Jan 23, 2016
1 parent e407c00 commit 6084ffb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rvm:
- 2.1
- 2.0
- rbx-2
script: bundle exec rake spec
script: bundle exec rake spec lint
install: bundle install --jobs=1
cache: bundler
branches:
Expand Down
8 changes: 8 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Thanks for helping build Capistrano! Here are the development practices followed

* [Who can help](#who-can-help)
* [Setting up your development environment](#setting-up-your-development-environment)
* [Coding guidelines](#coding-guidelines)
* [Submitting a pull request](#submitting-a-pull-request)
* [Managing GitHub issues](#managing-github-issues)
* [Reviewing and merging pull requests](#reviewing-and-merging-pull-requests)
Expand Down Expand Up @@ -52,6 +53,13 @@ Currently, the Capistrano Travis build does *not* run the Cucumber suite. This m

**If you come across a failing Cucumber feature, this is a bug.** Please report it by opening a GitHub issue. Or even better: do your best to fix the feature and submit a pull request!

## Coding guidelines

This project uses [RuboCop](https://github.com/bbatsov/rubocop) to enforce standard Ruby coding guidelines. Currently we run RuboCop's lint rules only, which check for readability issues like indentation, ambiguity, and useless/unreachable code.

* Test that your contributions pass with `rake lint`
* The linter is also run as part of the full test suite with `rake`
* Note the Travis build will fail and your PR cannot be merged if the linter finds errors

## Submitting a pull request

Expand Down
7 changes: 6 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
require "bundler/gem_tasks"
require "cucumber/rake/task"
require "rspec/core/rake_task"
require "rubocop/rake_task"

task :default => :spec
task :default => [:spec, :lint]
RSpec::Core::RakeTask.new

Cucumber::Rake::Task.new(:features)

desc "Run RuboCop lint checks"
RuboCop::RakeTask.new(:lint) do |task|
task.options = ["--lint"]
end
1 change: 1 addition & 0 deletions capistrano.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ Gem::Specification.new do |gem|

gem.add_development_dependency 'rspec'
gem.add_development_dependency 'mocha'
gem.add_development_dependency 'rubocop'
end

0 comments on commit 6084ffb

Please sign in to comment.