-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rubocop.yml
110 lines (96 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
AllCops:
TargetRubyVersion: 2.3
Exclude:
# Exclude 100% auto-generated files, which we can't easily control:
- 'db/schema.rb'
- 'bin/*'
# Exclude directories that will not include Ruby code we care about:
- 'coverage/**/*'
- 'ember-apps/**/*'
- 'log/**/*'
- 'node_modules/**/*'
- 'public/**/*'
- 'tmp/**/*'
- 'vendor/**/*'
Rails:
Enabled: true # Run extra Rails-specific cops
Rails/HttpPositionalArguments:
# This rule was added to support Rails 5 and appears to be finding false
# negatives in Rails 4 - i.e. if you try to add keyword arguments to HTTP
# requests in a request spec it no longer works as the method does not
# support them.
#
# TODO: Remove this override (therefore enabling this rule) once we have
# upgraded to Rails 5:
Enabled: false
Metrics/MethodLength:
Exclude:
# Migrations can be long, but don't really need to be broken down into
# smaller methods:
- 'db/migrate/*.rb'
Max: 15 # Default 10 is too stringent, also Metrics/AbcSize helps keep method
# size in check (see https://github.com/bbatsov/rubocop/pull/1370#issuecomment-63924440)
Metrics/ClassLength:
Exclude:
# Some migrations can be very long, but this is acceptable:
- 'db/migrate/**/*'
Metrics/BlockLength:
Exclude:
# Specs and Rake files are actually excluded in the default rules, but this
# is ignored when run in some contexts (e.g. SublimeLinter), so we re-
# iterate the exclusions here:
- 'Rakefile'
- '**/*.rake'
- 'spec/**/*'
# Some migrations can be very long, but this is acceptable:
- 'db/migrate/**/*'
# Routes and environment configuration files can have many lines in their
# blocks, and this is acceptable:
- 'config/routes.rb'
- 'config/environments/*.rb'
ExcludedMethods:
# Exclude 'class_methods' found in modules using ActiveSupport::Concern:
- 'class_methods'
Metrics/AbcSize:
Exclude:
# Migrations can be long, but don't really need to be broken down into
# smaller methods:
- 'db/migrate/*.rb'
Style/BlockDelimiters:
Exclude:
- 'spec/**/*' # Specs can be tidier with multi-line {} blocks
Layout/BlockEndNewline:
Exclude:
- 'spec/**/*' # Specs can be tidier without newlines on multi-line {} blocks
Layout/MultilineBlockLayout:
Exclude:
- 'spec/**/*' # Specs can be tidier without newlines on multi-line {} blocks
Style/NestedParenthesizedCalls:
Exclude:
- 'spec/**/*' # RSpec matchers can be clearer without nested parenthesis
Style/AndOr:
Exclude:
# RSpec feature specs can be clearer with the use of 'and', e.g:
# `click_on 'Install' and wait_for_javascript_redirect`:
- 'spec/features/**/*'
Style/Documentation:
Exclude:
# Application controller, helper & class don't need top-level documentation:
- 'app/controllers/application_controller.rb'
- 'app/helpers/application_helper.rb'
- 'config/application.rb'
# Migration classes don't need top-level class documentation:
- 'db/migrate/*.rb'
Style/ZeroLengthPredicate:
# This rule complains about using `.length` on ActiveRecord relations, when it
# is a valid optimization at times when you know you will use the records from
# the relation so do not want to do an extract `COUNT` query that `.size`,
# `.count` and `.empty?` will generate:
Enabled: false
Style/NumericPredicate:
# This rule insists on converting `> 0` to `.positive?` but this often doesn't
# read correctly in the context it is being suggested. It is also slower to
# use the predicate method than to do the comparison (see https://github.com/bbatsov/rubocop/issues/3633).
#
# Disabling so that the appropriate usage can be determined by the author:
Enabled: false