Add RuboCop

This commit is contained in:
Erik Michaels-Ober 2014-03-28 16:00:40 +01:00
parent 7f8589164f
commit 484633c63d
3 changed files with 54 additions and 7 deletions

View File

@ -2,16 +2,23 @@ AllCops:
Includes: Includes:
- 'Gemfile' - 'Gemfile'
- 'Rakefile' - 'Rakefile'
- 'twitter.gemspec' Excludes:
- 'db/schema.rb'
# Avoid long parameter lists # Avoid long parameter lists
ParameterLists: ParameterLists:
Max: 4 Max: 4
CountKeywordArgs: true CountKeywordArgs: true
ClassLength:
Max: 100
LineLength:
Enabled: false
MethodLength: MethodLength:
CountComments: false CountComments: false
Max: 14 Max: 15
# Avoid more than `Max` levels of nesting. # Avoid more than `Max` levels of nesting.
BlockNesting: BlockNesting:
@ -25,15 +32,11 @@ CollectionMethods:
find: 'detect' find: 'detect'
find_all: 'select' find_all: 'select'
# Limit line length
LineLength:
Enabled: false
# Disable documentation checking until a class needs to be documented once # Disable documentation checking until a class needs to be documented once
Documentation: Documentation:
Enabled: false Enabled: false
# Enforce Ruby 1.8-compatible hash syntax # Enforce Ruby 1.9-compatible hash syntax
HashSyntax: HashSyntax:
EnforcedStyle: ruby19 EnforcedStyle: ruby19
@ -67,3 +70,32 @@ CaseIndentation:
Lambda: Lambda:
Enabled: false Enabled: false
RaiseArgs:
EnforcedStyle: compact
TrailingComma:
Enabled: false
DoubleNegation:
Enabled: false
PercentLiteralDelimiters:
PreferredDelimiters:
'%': ()
'%i': ()
'%q': ()
'%Q': ()
'%r': '{}'
'%s': ()
'%w': '[]'
'%W': '[]'
'%x': ()
WordArray:
Exclude:
- 'app/helpers/application_helper.rb'
NumericLiterals:
Exclude:
- 'db/seeds.rb'

View File

@ -33,6 +33,7 @@ end
group :test do group :test do
gem 'coveralls', require: false gem 'coveralls', require: false
gem 'rubocop'
gem 'simplecov', require: false gem 'simplecov', require: false
gem 'sqlite3' gem 'sqlite3'
gem 'webmock' gem 'webmock'

View File

@ -27,6 +27,7 @@ GEM
tzinfo (~> 0.3.37) tzinfo (~> 0.3.37)
addressable (2.3.6) addressable (2.3.6)
arel (4.0.2) arel (4.0.2)
ast (1.1.0)
atomic (1.1.16) atomic (1.1.16)
bcrypt (3.1.7) bcrypt (3.1.7)
builder (3.1.4) builder (3.1.4)
@ -86,8 +87,12 @@ GEM
nokogiri (1.6.1) nokogiri (1.6.1)
mini_portile (~> 0.5.0) mini_portile (~> 0.5.0)
orm_adapter (0.5.0) orm_adapter (0.5.0)
parser (2.1.7)
ast (~> 1.1)
slop (~> 3.4, >= 3.4.5)
pg (0.17.1) pg (0.17.1)
polyglot (0.3.4) polyglot (0.3.4)
powerpack (0.0.9)
pry (0.9.12.6) pry (0.9.12.6)
coderay (~> 1.0) coderay (~> 1.0)
method_source (~> 0.8) method_source (~> 0.8)
@ -132,10 +137,18 @@ GEM
activesupport (= 4.0.4) activesupport (= 4.0.4)
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0) thor (>= 0.18.1, < 2.0)
rainbow (2.0.0)
rake (10.2.2) rake (10.2.2)
remotipart (1.2.1) remotipart (1.2.1)
rest-client (1.6.7) rest-client (1.6.7)
mime-types (>= 1.16) mime-types (>= 1.16)
rubocop (0.19.1)
json (>= 1.7.7, < 2)
parser (~> 2.1.7)
powerpack (~> 0.0.6)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.4)
ruby-progressbar (1.4.2)
safe_yaml (1.0.1) safe_yaml (1.0.1)
sass (3.3.4) sass (3.3.4)
sass-rails (4.0.1) sass-rails (4.0.1)
@ -198,6 +211,7 @@ DEPENDENCIES
rails (~> 4.0.4) rails (~> 4.0.4)
rails_12factor rails_12factor
rails_admin rails_admin
rubocop
sass-rails sass-rails
simplecov simplecov
sqlite3 sqlite3