-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.rubocop.yml
79 lines (67 loc) · 1.71 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
# .rubocop.yml
#
# Configuration for rubocop, a static code analyzer for Ruby.
#
# https://github.com/bbatsov/rubocop#configuration
AllCops:
TargetRubyVersion: 2.3
inherit_from: .rubocop_todo.yml
Layout/HashAlignment:
EnforcedColonStyle: table
# Layout/IndentationConsistency
#
# Use Rails-style access modifier indentation.
#
# Example:
# ```
# class Foo
# def bar
# puts 'bar'
# end
#
# private
#
# def baz
# puts 'baz'
# end
# end
# ```
Layout/IndentationConsistency:
EnforcedStyle: indented_internal_methods
# Prefer `alias_method`
#
# This is debated and a nuanced issue. More infomation:
# - http://stackoverflow.com/q/4763121
# - http://blog.bigbinary.com/2012/01/08/alias-vs-alias-method.html
# - https://ernie.io/2014/10/23/in-defense-of-alias/
# - https://github.com/bbatsov/ruby-style-guide#alias-method-lexically
# - https://github.com/bbatsov/ruby-style-guide#alias-method
#
# http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/Alias
Style/Alias:
EnforcedStyle: prefer_alias_method
# TODO: Remove when Rubocop hits version 1.0.
Style/HashEachMethods:
Enabled: true
# TODO: Remove when Rubocop hits version 1.0.
Style/HashTransformKeys:
Enabled: true
# TODO: Remove when Rubocop hits version 1.0.
Style/HashTransformValues:
Enabled: true
# Use '||' for `%Q` delimiters.
Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%': '||'
'%Q': '||'
# Allow `%Q` when `%q` would do for better consistency.
Style/PercentQLiterals:
Exclude:
- 'test/test_rbst.rb'
# Permit redundant `%Q` literals in rest_rbst.rb for better consistency.
Style/RedundantPercentQ:
Exclude:
- 'test/test_rbst.rb'
# Prefer brackets for symbol arrays.
Style/SymbolArray:
EnforcedStyle: brackets