-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rubocop.yml
98 lines (80 loc) · 2.17 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
plugins:
- rubocop-rspec
- rubocop-rails
Rails:
Enabled: true
Style/Documentation:
Enabled: true
AllCops:
NewCops: enable
SuggestExtensions: false
DisplayCopNames: true
TargetRubyVersion: 2.7
TargetRailsVersion: 6.1
Exclude:
- bin/**/*
- vendor/**/*
- build/**/*
- gemfiles/**/*
- spec/fixtures/files/**/*
Metrics/BlockLength:
Exclude:
- Rakefile
- '*.gemspec'
- spec/**/*.rb
- '**/*.rake'
- doc/**/*.rb
# NOTE: Remove this when Ruby 2.7 is the minimum version.
# Our examples use +pp+ a lot.
Lint/Debugger:
Exclude:
- spec/**/*.rb
# We do not require to run in a timezone configured environment.
Rails/Date:
Enabled: false
# MFA is not yet enabled for our gems yet.
Gemspec/RequireMFA:
Enabled: false
# We stay with the original Ruby Style Guide recommendation.
Layout/LineLength:
Max: 80
# Document all the things.
Style/DocumentationMethod:
Enabled: true
RequireForNonPublicMethods: true
# It's a deliberate idiom in RSpec.
# See: https://github.com/bbatsov/rubocop/issues/4222
Lint/AmbiguousBlockAssociation:
Exclude:
- "spec/**/*"
# Because +expect_any_instance_of().to have_received()+ is not
# supported with the +with(hash_including)+ matchers
RSpec/MessageSpies:
EnforcedStyle: receive
# Because nesting makes sense here to group the feature tests
# more effective. This increases maintainability.
RSpec/NestedGroups:
Max: 4
# Disable regular Rails spec paths.
Rails/FilePath:
Enabled: false
# Because +enqueued_jobs+ is a method not a memoized variable,
# so when first evaluated it won't change.
RSpec/ExpectChange:
Enabled: false
# Because we heavily rely on memoized helper
# procs/lambdas and other stuff.
RSpec/MultipleMemoizedHelpers:
Enabled: false
# This looks like a false/positive. We test explicitly
# with the +expect+ mock call.
RSpec/StubbedMock:
Enabled: false
# NOTE: Remove this when Ruby 2.7 is the minimum version.
# See: https://github.com/rubocop/rubocop/pull/11177
Style/ObjectThen:
Enabled: false
# NOTE: Remove this when Ruby 2.7 is the minimum version.
# Because otherwise +.pretty_inspect+ is not defined. (+require 'pp'+)
Lint/RedundantRequireStatement:
Enabled: false