Skip to content

Commit

Permalink
Add Rubocop
Browse files Browse the repository at this point in the history
* Add rubocop as test/dev dependency
* Add rubocop rake task
* Add current Fastly rubocop style configuration
  • Loading branch information
ezkl committed Jun 14, 2014
1 parent 07be9cb commit d0528d7
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .rubocop.yml
@@ -0,0 +1,35 @@
# inherit_from:
# - rubocop-todo.yml

LineLength:
Enabled: false

HashSyntax:
Enabled: false

BracesAroundHashParameters:
Enabled: false

BlockNesting:
Enabled: false

AssignmentInCondition:
Enabled: false

CollectionMethods:
Enabled: false

CyclomaticComplexity:
Enabled: false

MethodLength:
Enabled: false

PerlBackrefs:
Enabled: false

RescueModifier:
Enabled: false

HandleExceptions:
Enabled: false
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -7,4 +7,5 @@ group :development, :test do
gem 'rdoc', '~> 4.1.1'
gem 'minitest', '~> 5.3.4'
gem 'pry'
gem 'rubocop'
end
15 changes: 13 additions & 2 deletions Rakefile
@@ -1,6 +1,4 @@
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'rdoc/task'

desc 'Run library from within a Pry console'
task :console do
Expand All @@ -17,6 +15,17 @@ namespace :clean do
end
end

require 'rubocop/rake_task'

desc 'Run rubocop'
RuboCop::RakeTask.new(:rubocop) do |task|
task.patterns = ['lib/**/*.rb', 'test/**/*.rb']
task.formatters = ['fuubar']
task.fail_on_error = true
end

require 'rdoc/task'

RDoc::Task.new do |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.main = 'README.md'
Expand All @@ -30,6 +39,8 @@ namespace :test do
end
end

require 'rake/testtask'

Rake::TestTask.new do |t|
t.libs << 'test'
t.test_files = FileList['test/*test.rb']
Expand Down

0 comments on commit d0528d7

Please sign in to comment.