forked from Interfolio/ruby-style-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rubocop.yml
140 lines (117 loc) · 4.39 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
135
136
137
138
139
140
AllCops:
Exclude:
- bin/**/*
- config/deploy/*
- db/schema.rb
- node_modules/**/*
- vendor/**/*
- .git/**/*
- Rakefile
- db/migrate/*
- spec/spec_helper.rb
- spec/rails_helper.rb
StyleGuideBaseURL: https://github.com/Interfolio/ruby-style-guide
Rails:
Enabled: true
#################
# Overrides #
#################
# Enforce LF line endings
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_layout.md#layoutendofline
Layout/EndOfLine:
EnforcedStyle: lf
# Allow less whitespace in indentation
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_layout.md#layoutalignparameters
Layout/AlignParameters:
EnforcedStyle: with_fixed_indentation
# Don't require empty lines between module and class lines
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_layout.md#layoutemptylinesaroundclassbody
Layout/EmptyLinesAroundClassBody:
EnforcedStyle: empty_lines_except_namespace
# Don't require empty lines between module and class lines
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_layout.md#layoutemptylinesaroundmodulebody
Layout/EmptyLinesAroundModuleBody:
EnforcedStyle: empty_lines_except_namespace
Exclude:
- "lib/swagger_responses.rb"
# Allow multi-line methods to be indented instead of aligned
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_layout.md#layoutmultilinemethodcallindentation
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
# This cop checks for ambiguous block association with method when param passed without parentheses
# However, the style of ambiguous block is standard in specs
# https://github.com/rubocop-hq/rubocop/issues/4222
Lint/AmbiguousBlockAssociation:
Exclude:
- "spec/**/*"
# Allows lengthy describes in specs
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_metrics.md#metricsblocklength
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
# Noise from longer lines
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_metrics.md#metricslinelength
Metrics/LineLength:
Max: 120
# Allow swagger response documentation blocks to be lengthy
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_metrics.md#metricsmethodlength
Metrics/MethodLength:
Exclude:
- "lib/swagger_responses.rb"
# Exclude deploy configurations from requiring snake_case filenames.
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_naming.md#namingfilename
Naming/FileName:
Exclude:
- 'config/deploy/*.rb'
# Allows the available environments to pass the Rails.env.{environment}? check
# https://docs.rubocop.org/rubocop-rails/cops_rails.html#railsunknownenv
Rails/UnknownEnv:
Environments:
- production
- nonprod
- development
- test
- qa
- alpha
- sandbox
- beta
# Allows { { } } in specs
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_style.md#styleblockdelimiters
Style/BlockDelimiters:
Exclude:
- 'spec/**/*'
# Prefer compact style over exploded.
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_style.md#styleraiseargs
Style/RaiseArgs:
EnforcedStyle: compact
# Prefer double quotes.
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_style.md#stylestringliterals
Style/StringLiterals:
EnforcedStyle: double_quotes
# Prefer brackets to %i
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_style.md#stylesymbolarray
Style/SymbolArray:
EnforcedStyle: brackets
# Prefer brackets to %w
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_style.md#stylewordarray
Style/WordArray:
EnforcedStyle: brackets
#################
# Disabled cops #
#################
# Lean towards readable code over meaningless required code comments
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_style.md#styledocumentation
Style/Documentation:
Enabled: false
# Lean towards readable code over meaningless required code comments
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_style.md#styledocumentationmethod
Style/DocumentationMethod:
Enabled: false
# Quieting noise for now
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_style.md#stylefrozenstringliteralcomment
Style/FrozenStringLiteralComment:
Enabled: false
# Don't require 1000000 to be typed 1_000_000
# https://github.com/rubocop-hq/rubocop/blob/master/manual/cops_style.md#stylenumericliterals
Style/NumericLiterals:
Enabled: false