Skip to content

Commit 606a233

Browse files
committed
Add RuboCop
1 parent 9d57b06 commit 606a233

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

.rubocop.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
AllCops:
2+
Includes:
3+
- 'Gemfile'
4+
- 'Thorfile'
5+
6+
# Avoid long parameter lists
7+
ParameterLists:
8+
Max: 3
9+
CountKeywordArgs: true
10+
11+
MethodLength:
12+
CountComments: false
13+
Max: 15
14+
15+
# Avoid more than `Max` levels of nesting.
16+
BlockNesting:
17+
Max: 3
18+
19+
# Align with the style guide.
20+
CollectionMethods:
21+
PreferredMethods:
22+
collect: 'map'
23+
inject: 'reduce'
24+
find: 'detect'
25+
find_all: 'select'
26+
27+
# Do not force public/protected/private keyword to be indented at the same
28+
# level as the def keyword. My personal preference is to outdent these keywords
29+
# because I think when scanning code it makes it easier to identify the
30+
# sections of code and visually separate them. When the keyword is at the same
31+
# level I think it sort of blends in with the def keywords and makes it harder
32+
# to scan the code and see where the sections are.
33+
AccessModifierIndentation:
34+
Enabled: false
35+
36+
# Limit line length
37+
LineLength:
38+
Enabled: false
39+
40+
# Disable documentation checking until a class needs to be documented once
41+
Documentation:
42+
Enabled: false
43+
44+
# Enforce Ruby 1.8-compatible hash syntax
45+
HashSyntax:
46+
EnforcedStyle: hash_rockets
47+
48+
# No spaces inside hash literals
49+
SpaceInsideHashLiteralBraces:
50+
EnforcedStyle: no_space
51+
52+
# Allow dots at the end of lines
53+
DotPosition:
54+
Enabled: false
55+
56+
# Don't require magic comment at the top of every file
57+
Encoding:
58+
Enabled: false
59+
60+
# Enforce outdenting of access modifiers (i.e. public, private, protected)
61+
AccessModifierIndentation:
62+
EnforcedStyle: outdent
63+
64+
EmptyLinesAroundAccessModifier:
65+
Enabled: true

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ group :test do
1717
gem 'fakeweb', '>= 1.3'
1818
gem 'rspec', '>= 2.14'
1919
gem 'rspec-mocks', '>= 2.12.2'
20+
gem 'rubocop', '>= 0.15', :platforms => [:ruby_19, :ruby_20]
2021
gem 'simplecov', :require => false
2122
end
2223

0 commit comments

Comments
 (0)