-
Notifications
You must be signed in to change notification settings - Fork 1
/
.rubocop.yml
75 lines (61 loc) · 1.76 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
---
# Common configuration.
AllCops:
NewCops: enable
RubyInterpreters:
- ruby
- rake
DisplayStyleGuide: true
ExtraDetails: true
TargetRubyVersion: 3.1
Exclude:
- 'vendor/**/*'
- 'bin/**/*'
SuggestExtensions: true
# and/&& or/|| should not be replaced!
# http://www.virtuouscode.com/2010/08/02/using-and-and-or-in-ruby/
Style/AndOr:
EnforcedStyle: conditionals
# Modern screens can easily display more than 80 characters.
Layout/LineLength:
Max: 250
Metrics/BlockLength:
Exclude:
- '**/*.gemspec'
- 'spec/**/*_spec.rb'
# FrozenStringLiteralComment for Ruby 3 upgrade
Style/FrozenStringLiteralComment:
Enabled: true
# Conditional assignments make the code unreadable sometimes.
Style/ConditionalAssignment:
Enabled: false
# Check with yard instead.
Style/Documentation:
Enabled: false
# Consistent hash indentation
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
# Consistent array indentation
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
# Fail is an alias of raise. Avoid aliases, it's more cognitive load for no gain.
# The argument that fail should be used to abort the program is wrong too,
# there's Kernel#abort for that.
Style/SignalException:
EnforcedStyle: only_raise
# Symbol Arrays cop enabled (drops support for Ruby 1.9)
Style/SymbolArray:
Enabled: true
# Mixing the styles looks just silly
Style/HashSyntax:
EnforcedStyle: ruby19_no_mixed_keys
# has_key? and has_value? are far more readable than key? and value?
Style/PreferredHashMethods:
Enabled: false
# Align hashes like a table
Layout/HashAlignment:
EnforcedColonStyle: table
EnforcedHashRocketStyle: table
# Align arguments with the same indentation level
Layout/ArgumentAlignment:
EnforcedStyle: with_fixed_indentation