forked from binarylogic/authlogic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
127 lines (104 loc) · 3.71 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
inherit_from: .rubocop_todo.yml
AllCops:
# You can run the authlogic test suite with any supported version of MRI, but the
# linter will only care about this `TargetRubyVersion`. This should be set to the
# lowest version of MRI that authlogic supports.
TargetRubyVersion: 2.2
# Please use normal indentation when aligning parameters.
#
# Good:
#
# method_call(
# a,
# b
# )
#
# method_call(a,
# b
# )
#
# Bad:
#
# method_call(a,
# b)
#
# The latter is harder to maintain and uses too much horizontal space.
Layout/AlignParameters:
EnforcedStyle: with_fixed_indentation
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
Metrics/AbcSize:
Exclude:
# crypto_providers/wordpress is deprecated so we will not attempt to
# improve its quality.
- lib/authlogic/crypto_providers/wordpress.rb
# In an ideal world tests would be held to the same ABC metric as production
# code. In practice, time spent doing so is not nearly as valuable as
# spending the same time improving production code.
- test/**/*
# Questionable value compared to metrics like AbcSize or CyclomaticComplexity.
Metrics/BlockLength:
Enabled: false
# Questionable value compared to metrics like AbcSize or CyclomaticComplexity.
Metrics/ClassLength:
Enabled: false
Metrics/CyclomaticComplexity:
Exclude:
# crypto_providers/wordpress is deprecated so we will not attempt to
# improve its quality.
- lib/authlogic/crypto_providers/wordpress.rb
# Aim for 80, but 100 is OK.
Metrics/LineLength:
Max: 100
# Questionable value compared to metrics like AbcSize or CyclomaticComplexity.
Metrics/MethodLength:
Enabled: false
# Questionable value compared to metrics like AbcSize or CyclomaticComplexity.
Metrics/ModuleLength:
Enabled: false
# Sometimes prefixing a method name with get_ or set_ is a reasonable choice.
Naming/AccessorMethodName:
Enabled: false
# Having a consistent delimiter, like EOS, improves reading speed. The delimiter
# is syntactic noise, just like a quotation mark, and inconsistent naming would
# hurt reading speed, just as inconsistent quoting would.
Naming/HeredocDelimiterNaming:
Enabled: false
# Avoid single-line method definitions.
Style/EmptyMethod:
EnforcedStyle: expanded
# Avoid annotated tokens except in desperately complicated format strings.
# In 99% of format strings they actually make it less readable.
Style/FormatStringToken:
Enabled: false
# Too subtle to lint. Guard clauses are great, use them if they help.
Style/GuardClause:
Enabled: false
# Too subtle to lint. A multi-line conditional may improve readability, even if
# a postfix conditional would satisfy `Metrics/LineLength`.
Style/IfUnlessModifier:
Enabled: false
# Too subtle to lint. Use semantic style, but prefer `}.x` over `end.x`.
Style/BlockDelimiters:
Enabled: false
# Use the nested style because it is safer. It is easier to make mistakes with
# the compact style.
Style/ClassAndModuleChildren:
EnforcedStyle: nested
# Both `module_function` and `extend_self` are legitimate. Most importantly,
# they are different (http://bit.ly/2hSQAGm)
Style/ModuleFunction:
Enabled: false
# The decision of when to use slashes `/foo/` or percent-r `%r{foo}` is too
# subtle to lint. Use whichever requires fewer backslash escapes.
Style/RegexpLiteral:
AllowInnerSlashes: true
# We use words, like `$LOAD_PATH`, because they are much less confusing that
# arcane symbols like `$:`. Unfortunately, we must then `require "English"` in
# a few places, but it's worth it so that we can read our code.
Style/SpecialGlobalVars:
EnforcedStyle: use_english_names
Style/StringLiterals:
EnforcedStyle: double_quotes