forked from codeforamerica/ohana-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
107 lines (94 loc) · 2.65 KB
/
.rubocop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
AllCops:
Include:
- 'Gemfile'
- 'Rakefile'
- 'lib/tasks/*'
Exclude:
- 'bin/**/*'
- 'db/schema.rb'
- 'db/seeds.rb'
- 'db/migrate/*'
- 'config/initializers/generators.rb'
Metrics/ClassLength:
Description: Avoid classes longer than 100 lines of code.
Enabled: true
CountComments: false
Max: 100
Metrics/LineLength:
Description: Limit lines to 80 characters.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits
Enabled: false
Max: 100
AllowURI: true
URISchemes:
- http
- https
Metrics/MethodLength:
Description: Avoid methods longer than 10 lines of code.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
Enabled: true
CountComments: false
Max: 15
Metrics/ModuleLength:
Description: Avoid modules longer than 100 lines of code.
Enabled: true
CountComments: false
Max: 100
Exclude:
- spec/support/features/form_helpers.rb
Rails/HasAndBelongsToMany:
Description: Prefer has_many :through to has_and_belongs_to_many.
Enabled: true
Exclude:
- app/models/service.rb
- app/models/category.rb
Rails/ScopeArgs:
Description: Checks the arguments of ActiveRecord scopes.
Enabled: true
Exclude:
- app/models/concerns/search.rb
Include:
- app/models/**/*.rb
Rails/TimeZone:
# The value `strict` means that `Time` should be used with `zone`.
# The value `flexible` allows usage of `in_time_zone` instead of `zone`.
Enabled: true
EnforcedStyle: flexible
SupportedStyles:
- strict
- flexible
Style/AndOr:
Description: Use &&/|| instead of and/or.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-and-or-or
Enabled: true
EnforcedStyle: conditionals
SupportedStyles:
- always
- conditionals
Style/Documentation:
Description: Document classes and non-namespace modules.
Enabled: false
Style/DotPosition:
Description: Checks the position of the dot in multi-line method calls.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
Enabled: true
EnforcedStyle: trailing
SupportedStyles:
- leading
- trailing
Style/ExtraSpacing:
Description: Do not use unnecessary spacing.
Enabled: false
Style/GuardClause:
Description: Check for conditionals that can be replaced with guard clauses
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
Enabled: true
MinBodyLength: 3
Style/StringLiterals:
Description: Checks if uses of quotes match the configured preference.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
Enabled: true
EnforcedStyle: single_quotes
SupportedStyles:
- single_quotes
- double_quotes