-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
.rubocop.yml
69 lines (58 loc) · 2 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
# .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/FirstHashElementIndentation:
EnforcedStyle: consistent
# Disable Metrics/ClassLength
#
# The ISO_639 class also contains the data in a hard-coded array, which makes
# the class exceptionally long. Alternative approaches for cleanly including
# this data can be considered, but in the meantime the max length is raised
# here to accommodate the data.
Metrics/ClassLength:
Max: 600
# Exclude iso-639.rb from Naming/FileName
#
# This filename violates the common convention in Ruby and should be renamed
# in the future. Exclude for now in order to have this cop available for other
# files in the meantime.
Naming/FileName:
Exclude:
- 'lib/iso-639.rb'
# 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
# Disable documentation checks.
Style/Documentation:
Enabled: false
# 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
# Set minimum non-`%w`/`%W` word array size to 5
#
# Since this library works extensively with word arrays that sometimes include
# whitespace and punctuation, stick to a convention of using explicit arrays
# of words, and only trigger this cop when such arrays go over the 5-word
# length of the arrays in the data.
Style/WordArray:
MinSize: 5