-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rubocop.yml
134 lines (104 loc) · 2.75 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
# RuboCop Configuration
require:
- rubocop-rspec
- rubocop-rspec_rails
inherit_gem:
# Omakase Ruby styling for Rails
rubocop-rails-omakase: rubocop.yml
# RuboCop and Syntax Tree serve different purposes, but there is overlap with some of RuboCop's functionality.
# Syntax Tree provides a RuboCop configuration file to disable rules that are redundant with Syntax Tree.
syntax_tree: config/rubocop.yml
AllCops:
NewCops: enable
Exclude:
- ".cache/**/*"
- ".git/**/*"
- ".github/**/*"
- ".husky/**/*"
- ".ruby-lsp/**/*"
- ".vscode/**/*"
- ".yarn/**/*"
- "app/views/**/*"
- "db/schema.rb"
- "docs/**/*"
- "log/**/*"
- "node_modules/**/*"
- "storage/**/*"
- "tmp/**/*"
- "vendor/**/*"
# Layout Cops
Layout/LineLength:
Description: "Limit lines to 115 characters."
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#80-character-limits"
Max: 115
Layout/SpaceInsideArrayLiteralBrackets:
EnforcedStyle: no_space
# Metrics Cops
Metrics/ClassLength:
Description: "Avoid classes longer than 300 lines of code."
Max: 300
Enabled: true
Metrics/ModuleLength:
Description: "Avoid modules longer than 300 lines of code."
Max: 300
Enabled: true
Metrics/ParameterLists:
Description: "Pass no more than four parameters into a method."
Max: 4
Enabled: true
Metrics/MethodLength:
Description: "Avoid methods longer than 30 lines of code."
StyleGuide: "<https://github.com/bbatsov/ruby-style-guide#short-methods>"
Max: 30
Enabled: true
Metrics/BlockLength:
CountComments: false
CountAsOne: ["array", "hash", "heredoc"]
Max: 25
AllowedMethods:
- context
- describe
- it
- shared_examples
- shared_examples_for
- namespace
- draw
- configure
- group
# Style Cops
Style/Documentation:
Description: "Document classes and non-namespace modules."
Enabled: false
Style/StringLiterals:
Description: "Checks if uses of quotes match the configured preference."
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#consistent-string-literals"
EnforcedStyle: double_quotes
Enabled: true
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
Enabled: true
Style/HashSyntax:
EnforcedStyle: ruby19_no_mixed_keys
Style/PreferredHashMethods:
EnforcedStyle: verbose
Style/SignalException:
EnforcedStyle: only_raise
Style/InlineComment:
Description: "Avoid inline comments."
Enabled: false
Style/FrozenStringLiteralComment:
EnforcedStyle: always_true
# Rails Cops
Rails/Delegate:
Description: "Prefer delegate method for delegations."
Enabled: false
Rails/ActionOrder:
Enabled: false
# Bundler Cops
Bundler/OrderedGems:
Enabled: false
# RSpec Cops
RSpec/ExampleLength:
Max: 15
RSpec/MultipleExpectations:
Max: 3