-
Notifications
You must be signed in to change notification settings - Fork 67
/
.rubocop.yml
95 lines (78 loc) · 2.54 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
# This is the configuration used to check the rubocop source code.
require:
- rubocop-performance
- rubocop-rails
# - rubocop-rspec
AllCops:
Exclude:
- bin/**/*
- db/schema.rb
- db/migrate/**/*
- node_modules/**/*
- tmp/**/*
- vendor/**/*
DisplayStyleGuide: true
NewCops: enable
# *********************** Bundler **************************
# https://docs.rubocop.org/rubocop/cops_bundler.html
Bundler/OrderedGems:
Description: >-
Gems within groups in the Gemfile should be alphabetically sorted.
Enabled: true
ConsiderPunctuation: true
# *********************** Layouts **************************
# https://docs.rubocop.org/rubocop/cops_layout.html
Layout/ClassStructure:
Description: "Enforces a configured order of definitions within a class body."
StyleGuide: "#consistent-classes"
Enabled: true
Layout/LineLength:
Description: "Checks that line length does not exceed the configured limit."
AutoCorrect: true # this is false by default
Exclude:
- Gemfile
# *********************** Lint **************************
# https://docs.rubocop.org/rubocop/cops_lint.html
Lint/MissingSuper:
Description: >-
This cop checks for the presence of constructors and lifecycle
callbacks without calls to super.
Exclude:
- app/services/**/*
# *********************** Metrics **************************
# https://docs.rubocop.org/rubocop/1.5/cops_metrics.html
Metrics/BlockLength:
Description: 'Avoid long blocks with many lines.'
Enabled: true
Exclude:
- 'db/seeds.rb'
- 'spec/**/*'
- 'config/**/*'
# *********************** Styles ***************************
# https://docs.rubocop.org/rubocop/cops_style.html
Style/Documentation:
Description: >-
This cop checks for missing top-level documentation of classes and modules.
Enabled: false
Style/FrozenStringLiteralComment:
Description: >-
Add the frozen_string_literal comment to the top of files
to help transition to frozen string literals by default.
Enabled: true
EnforcedStyle: never
Style/HashSyntax:
Description: >-
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
{ :a => 1, :b => 2 }.
StyleGuide: "#hash-literals"
Enabled: true
EnforcedStyle: no_mixed_keys
Style/RedundantInterpolation:
Description: >-
This cop checks for strings that are just an interpolated expression.
Enabled: false
Style/StringLiterals:
Description: "Checks if uses of quotes match the configured preference."
StyleGuide: "#consistent-string-literals"
Enabled: true
ConsistentQuotesInMultiline: true