-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.rubocop.yml
139 lines (108 loc) · 3.42 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
require: rubocop-rspec
AllCops:
TargetRubyVersion: 2.3
DisplayCopNames: true
# Do not sort gems in Gemfile, since we are grouping them by functionality.
Bundler/OrderedGems:
Enabled: false
# Add a comment before each gem in Gemfile.
Bundler/GemComment:
Enabled: true
# Trailing commas are required on multiline method arguments.
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
# Trailing commas are required in multiline arrays.
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
# Trailing commas are required in multiline hashes.
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
# Allow indenting multiline chained operations.
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
# Allow empty lines around blocks in specs.
Layout/EmptyLinesAroundBlockBody:
Exclude:
- spec/**/*
# Allow not adding parentheses around blocks in DSLs.
# E.g.:
# expect { … }.to change { … }
Lint/AmbiguousBlockAssociation:
Exclude:
- spec/**/*
# Limit method length (default is 10).
Metrics/MethodLength:
Max: 15
# Limit class length (default is 100).
Metrics/ClassLength:
Max: 200
# Do not require `# frozen_string_literal: true` at the top of every file.
FrozenStringLiteralComment:
Enabled: false
# Allow ASCII comments (e.g "…").
Style/AsciiComments:
Enabled: false
# Do not comment the class we create, since the name should be self explanatory.
Documentation:
Enabled: false
# Do not verify the length of the blocks in DSLs.
Metrics/BlockLength:
Exclude:
- spec/**/*
- lib/tasks/**/*
- app/admin/**/*
- config/routes.rb
- safe_pusher.gemspec
ExcludedMethods:
- included
# Allow any number of keyword arguments in methods.
Metrics/ParameterLists:
CountKeywordArgs: false
# Prefer `a_variable_1` to `a_variable1`.
Naming/VariableNumber:
EnforcedStyle: snake_case
# Prefer `== 0`, `< 0`, `> 0` to `zero?`, `negative?` or `positive?`,
# since they don't exist before Ruby 2.3 or Rails 5 and can be ambiguous.
Style/NumericPredicate:
EnforcedStyle: comparison
# This cop by default assumes that `Rails.root.join('foo', 'bar')` works
# better under Windows than `Rails.root.join('foo/bar')`.
Rails/FilePath:
EnforcedStyle: slashes
# Do not checks for the use of output safety calls like `html_safe` and `raw`,
# we know what we are doing.
Rails/OutputSafety:
Enabled: false
# Allow `update_attribute`, we know when to use it.
Rails/SkipsModelValidations:
Enabled: false
# Allow creating tables without timestamps, whe know what we are doing.
Rails/CreateTableWithTimestamps:
Enabled: false
# Allow using `allow_any_instance_of` for stubbing.
RSpec/AnyInstance:
Enabled: false
# Allow `let!` to setup test data in specs.
RSpec/LetSetup:
Enabled: false
# Allow a nesting of up to 5 of describe/context blocks (default is 3).
RSpec/NestedGroups:
Max: 10
# Allow any number of expectations in an example, for performance.
RSpec/MultipleExpectations:
Enabled: false
# Allow using normal test doubles, since they are useful for mocking.
RSpec/VerifiedDoubles:
Enabled: false
# Limit example length (default is 5)
RSpec/ExampleLength:
Max: 10
# Prefer `change { User.count }` to `change(User, :count)`.
RSpec/ExpectChange:
EnforcedStyle: block
# Allow template token "%{foo}" since they are used in translation keys.
Style/FormatStringToken:
EnforcedStyle: template
# Prefer `->` to `lambda`.
Style/Lambda:
EnforcedStyle: literal