forked from rom-rb/rom-rails
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
153 lines (115 loc) · 2.89 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# FIXME: Lower by refactoring biggest offenders
Metrics/AbcSize:
Max: 26
# FIXME: Lower by refactoring biggest offenders
Metrics/CyclomaticComplexity:
Max: 8
# FIXME: No clue how to fix that one line…
Metrics/LineLength:
Max: 100
Exclude:
- lib/rom/rails/configuration.rb
# FIXME: Lower by refactoring biggest offenders
Metrics/MethodLength:
Max: 22
# FIXME: Lower by refactoring biggest offenders
Metrics/PerceivedComplexity:
Max: 10
# Don’t check temp and Rails-generated files
AllCops:
TargetRubyVersion: 2.3.1
Exclude:
- spec/dummy/Rakefile
- spec/dummy/config/**/*
- spec/dummy/db/schema.rb
- spec/dummy/db/seeds.rb
- tmp/**/*
- vendor/**/*
Layout/AlignArguments:
EnforcedStyle: with_fixed_indentation
# The enforced style doesn’t match Vim’s defaults
Layout/AlignParameters:
Enabled: false
# UTF-8 is perfectly fine in comments
Style/AsciiComments:
Enabled: false
Style/BlockDelimiters:
EnforcedStyle: semantic
FunctionalMethods:
- let
- let!
- subject
- watch
- before
Style/BracesAroundHashParameters:
Enabled: true
EnforcedStyle: context_dependent
# Allow compact style for specs
Style/ClassAndModuleChildren:
Exclude:
- spec/**/*_spec.rb
# Documentation checked by Inch CI
Style/Documentation:
Enabled: false
# This is a shim file for those who require 'rom-rails'
Naming/FileName:
Exclude:
- lib/rom-rails.rb
# Early returns have their vices
Style/GuardClause:
Enabled: false
# Need to be skipped for >-> usage
Style/Lambda:
Enabled: false
# Multiline block chains are ok
Style/MultilineBlockChain:
Enabled: false
# Multiline operation chains are indented
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
# Model::Validator uses Model::ValidationError for this
Style/RaiseArgs:
Exclude:
- lib/rom/model.rb
# Don’t introduce semantic fail/raise distinction
Style/SignalException:
EnforcedStyle: only_raise
# Need to be skipped for >-> usage
Layout/SpaceAroundOperators:
Enabled: false
# Accept both single and double quotes
Style/StringLiterals:
Enabled: false
# Allow def self.foo; @foo; end
Style/TrivialAccessors:
Enabled: false
# Allow logical `or`/`and` in conditionals
Style/AndOr:
EnforcedStyle: conditionals
# Fails to register points where we otherwise _use_ the block
Performance/RedundantBlockCall:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Style/PercentLiteralDelimiters:
Enabled: false
Lint/AmbiguousBlockAssociation:
Enabled: false
Metrics/BlockLength:
Enabled: false
Layout/SpaceInsideHashLiteralBraces:
Enabled: false
Style/BlockDelimiters:
Enabled: false
Layout/SpaceInsideArrayLiteralBrackets:
Enabled: false
Style/IfUnlessModifier:
Enabled: false
Layout/AccessModifierIndentation:
Enabled: false
Style/SymbolArray:
Enabled: false
Style/SafeNavigation:
Enabled: false
Lint/HandleExceptions:
Enabled: false