-
Notifications
You must be signed in to change notification settings - Fork 1
/
.rubocop.yml
122 lines (94 loc) · 2.59 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
# Rubocop configuration, see https://docs.rubocop.org/rubocop/configuration.html
require:
- rubocop-rspec
- rubocop-rails
- rubocop-performance
# opt-in to new rules (cops)
AllCops:
NewCops: enable
#
# Specific excludes & includes
#
# Ignore LineLength for config files (e.g. with long secret strings)
Layout/LineLength:
Exclude:
- 'config/**/*'
# Ignore 'Use $stdout instead of STDOUT' in configs
Style/GlobalStdStream:
Exclude:
- 'config/**/*'
# Ignore "Block has too many lines" for specs, `RSpec.describe` blocks can be long
Metrics/BlockLength:
Exclude:
- 'spec/**/*.rb'
- 'config/**/*'
# Okay because autogenerated migrations will fail
Metrics/AbcSize:
Exclude:
- 'db/migrate/*.rb'
Metrics/MethodLength:
Exclude:
- 'db/migrate/*.rb'
# Configs can complex options, may need custom layout
Layout/ArgumentAlignment:
Exclude:
- 'config/**/*'
Layout/HashAlignment:
Exclude:
- 'config/**/*'
# Only check "Missing top-level class documentation comment" for models
Style/Documentation:
Include:
- 'app/models/*.rb'
# The autogenerated file has a large comment block. So be it.
Style/BlockComments:
Exclude:
- 'spec/spec_helper.rb'
# Okay for special controllers interacting with devise
Style/ClassAndModuleChildren:
Exclude:
- app/controllers/users/*.rb
#
# Ignoring entire rules
#
# Okay to have empty lines around code blocks
Layout/EmptyLinesAroundBlockBody:
Enabled: false
# Ignore "Missing frozen string literal comment"
Style/FrozenStringLiteralComment:
Enabled: false
# Ignore "Gems should be sorted in an alphabetical order within their section of the Gemfile"
Bundler/OrderedGems:
Enabled: false
# Okay to have strings with "" instead of '', even when not doing interpolation
Style/StringLiterals:
Enabled: false
# Okay to have space in array definitions: [ 'a','b','c' ]
Layout/SpaceInsideArrayLiteralBrackets:
Enabled: false
Layout/SpaceInsidePercentLiteralDelimiters:
Enabled: false
# Okay to use normal array syntax [:a, :b, :c] for symbols instead of %i or %I
Style/SymbolArray:
Enabled: false
# Okay to use Rails.root.join('tmp', 'caching-dev.txt')
Rails/FilePath:
Enabled: false
RSpec/InstanceVariable:
Enabled: false
RSpec/ExampleLength:
Enabled: false
RSpec/MultipleExpectations:
Enabled: false
# Okay if actually correct relationship
Rails/HasAndBelongsToMany:
Enabled: false
Style/RedundantFetchBlock:
Enabled: false
# Ignore "Put empty method definitions on a single line"
Style/EmptyMethod:
Enabled: false
RSpec/Rails/InferredSpecType:
Enabled: false
RSpec/FactoryBot/SyntaxMethods:
Enabled: false