-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
112 lines (84 loc) · 1.95 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
108
109
110
111
112
inherit_from: .rubocop_todo.yml
require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec
AllCops:
CacheRootDirectory: .
DisabledByDefault: true
Exclude:
- '**/bin/*'
- '**/db/migrate/*'
- '**/db/schema.rb'
- '**/vendor/**/*' # since we `bundle install --path vendor/bundle` on CI
- '**/node_modules/**/*' # since we `bundle install --path vendor/bundle` on CI
Capybara:
Enabled: true
FactoryBot:
Enabled: true
Layout:
Enabled: true
Layout/EndOfLine:
Enabled: false
Layout/EmptyLinesAroundBlockBody:
Enabled: false
Lint:
Enabled: true
Lint/AmbiguousBlockAssociation:
# Exclude specs because rspec is deliberatly using
# a special kind of block styling
Exclude:
- "**/spec/**/*"
Lint/AssignmentInCondition:
# If you want to assign in the conditional
# then the condition must be surrounded with ()
AllowSafeAssignment: true
Lint/SuppressedException:
Enabled: false
Performance:
Enabled: true
# Note: Disabled because changing String#downcase & #== to #casecmp is breaking unicode-safe string comparison.
Performance/Casecmp:
Enabled: false
Style/AndOr:
# && / || instead of and / or
Enabled: true
Style/ArrayJoin:
# use join instead of *
Enabled: true
Style/DoubleNegation:
# Don't use cryptic !! syntax for checking not nil
Enabled: true
Style/MutableConstant:
# Have to freeze potentially mutable constants
Enabled: true
Style/Not:
# !x instead of (not x)
Enabled: true
Naming/ClassAndModuleCamelCase:
Enabled: true
Naming/ConstantName:
# SCREAMING_SNAKE_CASE
Enabled: true
Naming/FileName:
Enabled: true
Naming/MethodName:
Enabled: true
Naming/VariableName:
Enabled: true
RSpec:
Enabled: true
RSpec/EmptyLineAfterSubject:
Exclude:
- '**/spec/factories/*.rb'
Rails:
Enabled: true
Rails/DynamicFindBy:
Whitelist:
- find_by_sql
- find_by_phone
- find_by_external_id
- find_by_name
Rails/SaveBang:
AllowedReceivers:
- Stripe::Charge