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:
- 'Gemfile'
- 'Rakefile'
- 'twitter.gemspec'
Excludes:
- 'db/schema.rb'
# Avoid long parameter lists
ParameterLists:
Max: 4
CountKeywordArgs: true
ClassLength:
Max: 100
LineLength:
Enabled: false
MethodLength:
CountComments: false
Max: 14
Max: 15
# Avoid more than `Max` levels of nesting.
BlockNesting:
@ -25,15 +32,11 @@ CollectionMethods:
find: 'detect'
find_all: 'select'
# Limit line length
LineLength:
Enabled: false
# Disable documentation checking until a class needs to be documented once
Documentation:
Enabled: false
# Enforce Ruby 1.8-compatible hash syntax
# Enforce Ruby 1.9-compatible hash syntax
HashSyntax:
EnforcedStyle: ruby19
@ -67,3 +70,32 @@ CaseIndentation:
Lambda:
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
gem 'coveralls', require: false
gem 'rubocop'
gem 'simplecov', require: false
gem 'sqlite3'
gem 'webmock'

View File

@ -27,6 +27,7 @@ GEM
tzinfo (~> 0.3.37)
addressable (2.3.6)
arel (4.0.2)
ast (1.1.0)
atomic (1.1.16)
bcrypt (3.1.7)
builder (3.1.4)
@ -86,8 +87,12 @@ GEM
nokogiri (1.6.1)
mini_portile (~> 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)
polyglot (0.3.4)
powerpack (0.0.9)
pry (0.9.12.6)
coderay (~> 1.0)
method_source (~> 0.8)
@ -132,10 +137,18 @@ GEM
activesupport (= 4.0.4)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.0.0)
rake (10.2.2)
remotipart (1.2.1)
rest-client (1.6.7)
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)
sass (3.3.4)
sass-rails (4.0.1)
@ -198,6 +211,7 @@ DEPENDENCIES
rails (~> 4.0.4)
rails_12factor
rails_admin
rubocop
sass-rails
simplecov
sqlite3