-
Notifications
You must be signed in to change notification settings - Fork 4
/
.rubocop.yml
129 lines (97 loc) · 2.66 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
inherit_from: '.rubocop_todo.yml'
# Load extra rails-specific checks
require: rubocop-rails
# Display reason and how to do it better.
# Ignore auto-generated schema file
AllCops:
DisplayStyleGuide: true
Exclude:
- 'db/**/*'
- 'vendor/**/*'
- 'config/initializers/*'
- 'result/**/*'
- 'node_modules/**/*'
TargetRubyVersion: "3.0"
NewCops: enable
# Longer class length
Metrics/AbcSize:
Max: 125
Metrics/BlockLength:
Max: 275
Exclude:
- 'db/schema.rb'
Metrics/ClassLength:
Max: 500
Metrics/MethodLength:
Max: 200
# Allow 'some.variable == 0' and others
Style/NumericPredicate:
Enabled: false
Layout/LineLength:
IgnoredPatterns:
- "https://.*"
Max: 120
# TODO: enable this linter for all files
Exclude:
- "app/models/member.rb"
- "app/mailers/mailings/devise.rb"
- "app/controllers/users/sessions_controller.rb"
- "app/controllers/public/home_controller.rb"
# Require spaces in string interpolation "#{ meme }" instead of "#{meme}"
Layout/SpaceInsideStringInterpolation:
EnforcedStyle: space
Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true
Layout/SpaceAroundMethodCallOperator:
Enabled: true
Style/RegexpLiteral:
EnforcedStyle: slashes
AllowInnerSlashes: true
# Ignore auto-generated whitespace errors
Layout/EmptyLinesAroundBlockBody:
Exclude:
- 'db/schema.rb'
Style/NumericLiterals:
Exclude:
- 'db/schema.rb'
Style/ExponentialNotation:
Enabled: true
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Style/SlicingWithRange:
Enabled: true
Lint/DeprecatedOpenSSLConstant:
Enabled: true
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
# At the time of writing, this only influences :nodoc comments
Layout/LeadingCommentSpace:
Enabled: false
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
Lint/DuplicateBranch:
IgnoreLiteralBranches: true
# This cop adds this comments to the top of all files containing string literals:
# frozen_string_literal: true
# which should help with upgrading to Ruby 3.0, where that is the default
# (see docs: https://www.rubydoc.info/gems/rubocop/0.36.0/RuboCop/Cop/Style/FrozenStringLiteralComment)
# We already have upgrade to Ruby 3.0
Style/FrozenStringLiteralComment:
Enabled: false
Style/BlockDelimiters:
Exclude:
- 'app/jobs/webhook_job.rb'
Rails/LexicallyScopedActionFilter:
Enabled: false
Rails/ApplicationController:
Enabled: false
# Let Rubocop know we have a staging environment
Rails/UnknownEnv:
Environments: development, test, staging, production
Style/MethodCallWithArgsParentheses:
Enabled: true