-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
114 lines (87 loc) · 2.48 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
# Rubocop configuration, see https://docs.rubocop.org/rubocop/configuration.html
require:
- rubocop-rspec
- rubocop-rails
- rubocop-performance
# opt-in to new rules (cops)
AllCops:
TargetRubyVersion: 2.7
NewCops: enable
#
# Specific excludes & includes
#
# Using instance variables might make tests fail based on their order.
RSpec/InstanceVariable:
AssignmentOnly: true
Enabled: true
# 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/**/*"
# 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 long examples
RSpec/ExampleLength:
Enabled: false
# Okay to have more than one expectation in a single block
RSpec/MultipleExpectations:
Enabled: false
# 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
# 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
Metrics/MethodLength:
Max: 20
Metrics/AbcSize:
Max: 17
# Okay to use has_and_belongs_to_many for many-to-many relationships
Rails/HasAndBelongsToMany:
Enabled: false
RSpec/FactoryBot/SyntaxMethods:
Enabled: false