Skip to content

Commit

Permalink
add rubocop as dev dependency and run in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
colby-swandale committed Apr 1, 2018
1 parent 9a8c6cb commit bf5e2ea
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .rubocop.yml
@@ -0,0 +1,4 @@
AllCops:
DisabledByDefault: true
Exclude:
- 'bundler/**/*'
2 changes: 1 addition & 1 deletion CONTRIBUTING.rdoc
Expand Up @@ -11,7 +11,7 @@ contributors to follow to reduce the time it takes to get changes merged in.
2. Ensure that your code blends well with ours:
* No trailing whitespace
* Match indentation (two spaces)
* Match coding style (+if+, +elsif+, +when+ need trailing +then+)
* Match coding style (run <tt>rake rubocop</tt>)

3. If any new files are added or existing files removed in a commit or PR, please update the +Manifest.txt+ accordingly.
This can be done by running <tt>rake update_manifest</tt>
Expand Down
9 changes: 9 additions & 0 deletions Rakefile
Expand Up @@ -102,6 +102,15 @@ rescue LoadError
end
end

begin
gem "rubocop", "~> 0.54.0"
require "rubocop/rake_task"

RuboCop::RakeTask.new
rescue LoadError
task(:rubocop) { abort "Install the rubocop gem (~> 0.54.0) to run a static analysis" }
end

# --------------------------------------------------------------------
# Creating a release

Expand Down
1 change: 1 addition & 0 deletions rubygems-update.gemspec
Expand Up @@ -39,4 +39,5 @@ Gem::Specification.new do |s|
s.add_development_dependency(%q<rake>.freeze, ["~> 12.0"])
s.add_development_dependency(%q<minitest>.freeze, ["~> 5.0"])
s.add_development_dependency(%q<simplecov>.freeze, ["~> 0"])
s.add_development_dependency(%q<rubocop>.freeze, ["~> 0.54.0"])
end
4 changes: 4 additions & 0 deletions util/ci
Expand Up @@ -56,12 +56,16 @@ when %w(before_script)
if RUBY_VERSION >= "2.5.0" && RUBY_VERSION < "2.6.0"
run('gem', %w(install bundler -v 1.16.1))
end

run('gem', %w(install rubocop -v 0.54.0))

run('gem', %w(list --details))
run('gem', %w(env))
else
with_retries { run('rake', %w(spec:travis:deps)) }
end
when %w(script)
run('rake rubocop')
if TOOL.rubygems?
run('rake test')
else
Expand Down

0 comments on commit bf5e2ea

Please sign in to comment.