-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.rubocop.yml
115 lines (93 loc) · 3.69 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
inherit_from: .rubocop_todo.yml
# Please:
#
# - Comment any deviations from the Ruby Style Guide
# - Alphabetize cops
# - Only include permanent config; temporary goes in .rubocop_todo.yml
AllCops:
Exclude:
# This is where Github Actions installs our bundle. If we don't exclude it,
# rubocop will try to lint all of our dependencies XD
- 'vendor/**/*'
NewCops: enable
SuggestExtensions: false
# Set to lowest supported version
TargetRubyVersion: 2.3
Layout/DotPosition:
EnforcedStyle: trailing
# The Ruby Style Guide recommends to "Limit lines to 80 characters."
# (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
# Please aim for 80, but up to 100 is OK.
Layout/LineLength:
Max: 100
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
# Use exactly one space on each side of an operator. Do not align operators
# because it makes the code harder to edit, and makes lines unnecessarily long.
Layout/SpaceAroundOperators:
AllowForAlignment: false
# Not a useful metric compared to, e.g. `AbcSize`.
Metrics/BlockLength:
Enabled: false
# Not a useful metric compared to, e.g. `AbcSize`.
Metrics/ClassLength:
Enabled: false
# The number of lines in a method is not a useful metric compared to `AbcSize`.
# It's common to have very long methods (> 50 lines) which are quite simple. For
# example, a method that returns a long string with only a few interpolations.
Metrics/MethodLength:
Enabled: false
# Not a useful metric compared to, e.g. `AbcSize`.
Metrics/ModuleLength:
Enabled: false
# Heredocs are usually assigned to a variable or constant, which already has a
# name, so naming the heredoc doesn't add much value. Feel free to name
# heredocs that are used as anonymous values (not a variable, constant, or
# named parameter).
#
# All heredocs containing SQL should be named SQL, to support editor syntax
# highlighting.
Naming/HeredocDelimiterNaming:
Enabled: false
# Too subtle to lint.
# Two-letter param names are OK. Consider `send_email(to:, cc:)`.
# Even one-letter names are OK. Consider `draw_point(x, y)`.
Naming/MethodParameterName:
Enabled: false
# Please use semantic style, e.g. `do` when there's a side-effect, else `{}`.
# The semantic style is too nuanced to lint, so the cop is disabled.
Style/BlockDelimiters:
Enabled: false
# Use double negation wherever it would otherwise be impractical to convert
# a value to an actual boolean.
Style/DoubleNegation:
Enabled: false
# Avoid annotated tokens except in desperately complicated format strings.
# In 99% of format strings they actually make it less readable.
Style/FormatStringToken:
Enabled: false
# The decision of when to use a guard clause to improve readability is subtle,
# and it's not clear that it can be linted. Certainly, the default
# `MinBodyLength` of 1 can actually hurt readability.
Style/GuardClause:
Enabled: false
# Only use postfix (modifier) conditionals for utterly simple statements.
# As a rule of thumb, the entire statement should not exceed 60 chars.
# Rubocop used to support this level of configuration, but no longer does.
Style/IfUnlessModifier:
Enabled: false
# Usage of OpenStruct is discouraged since it's breaking some performance
# optimizations in the Ruby VM. But when using it in tests, these can be
# ignored.
Style/OpenStructUse:
Exclude:
- spec/**/*
# The Ruby Style Guide does not prescribe a particular quote character, only
# that a project should pick one and be consistent. The decision has no
# performance implications. Double quotes are slightly easier to read.
Style/StringLiterals:
EnforcedStyle: double_quotes