1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Add RuboCop lint to default rake task

This commit is contained in:
Matt Brictson 2016-01-23 13:07:52 -08:00
parent e407c00688
commit 6084ffbb65
4 changed files with 16 additions and 2 deletions

View file

@ -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:

View file

@ -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)
@ -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

View file

@ -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

View file

@ -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