forked from Mapotempo/optimizer-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
80 lines (64 loc) · 2.28 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
inherit_from: .rubocop_todo.yml
inherit_gem:
mapotempo_rubocop:
- rubocop-default.yml
AllCops:
TargetRubyVersion: 2.5
Exclude:
- 'tmp/**/*'
- 'vendor/bundle/**/*'
- 'config/initializers/local.rb'
- 'lib/routers/router_wrapper.rb'
- 'wrappers/ortools_result_pb.rb' # auto-genereated file
- 'wrappers/ortools_vrp_pb.rb' # auto-genereated file
Style/FrozenStringLiteralComment:
Exclude:
- 'config.ru'
- 'Gemfile'
- 'Rakefile'
# Disabled since it defers/pushes final verifications after a return which hides the verification logic.
#
# It is disabled by other tech companies with similar reasons:
# https://github.com/airbnb/ruby/blob/12435e8136d2adf710de999bc0f6bef01215df2c/rubocop-airbnb/config/rubocop-style.yml#L363
# https://github.com/Shopify/ruby-style-guide/blob/f604033657c54fa0dc28b5914c1e6c2641e6f361/rubocop.yml#L469
Style/GuardClause:
Enabled: false
Style/NumericPredicate:
Enabled: false
# We prefer standardizing on double-quoted strings for readability.
# However, there are too many offenses so they are disable here.
#
# This is what rails, github, google, etc does to minimize conflicts
# https://github.com/rails/rails/blob/4732514bb0af535bc7209a67f3823b2ebcb52848/.rubocop.yml#L184
# https://github.com/github/rubocop-github/blob/93fd172c92b8abd6518ce9366c150a0e4e43d037/config/_default_shared.yml#L327
# https://github.com/googleapis/ruby-style/blob/0181b5295790a7edec289cc482995d0d395cb884/google-style.yml#L356
Style/StringLiterals:
Enabled: false
EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:
Enabled: false
EnforcedStyle: double_quotes
Style/TernaryParentheses:
EnforcedStyle: require_parentheses_when_complex
# Style/UnlessLogicalOperators: # TODO: activate when rubocop gem is upgraded
# EnforcedStyle: forbid_logical_operators
Layout/CommentIndentation:
Enabled: true
Layout/EmptyLines:
Severity: warning
Layout/ExtraSpacing:
Severity: warning
Layout/IndentationConsistency:
Severity: warning
Layout/IndentationWidth:
Severity: warning
Layout/MultilineAssignmentLayout:
Enabled: true
Layout/LineLength:
# These files have long description sections
Exclude:
- 'api/api_v01.rb'
- 'api/v01/api.rb'
- 'api/v01/entities/vrp_input.rb'
- 'api/v01/entities/vrp_result.rb'
- 'api/v01/vrp.rb'