-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rubocop.yml
56 lines (56 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
### Disable line length constraint
Metrics/LineLength:
Max: 120
# Because we're not in the 80s anymore.
# Based on data from http://sideeffect.kr/popularconvention#ruby
#
### Comma after each line in a list
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
# It is very common to add key/value pairs to hashes in Chef attributes. Making
# sure each line has a comma diminishes the chance of someone making an error
# when adding a new pair. It also makes the code look more consistent. There is
# also a good explanation on why this is enabled by default in Puppet
# (see: http://www.puppetcookbook.com/posts/trailing-commas.html).
#
# Instead of writing:
# default['cookbook']['attribute'] = {
# a: 'a',
# b: 'b'
# }
# you should write:
# default['cookbook']['attribute'] = {
# a: 'a',
# b: 'b',
# }
#
### Align hashes as a table
Style/AlignHash:
EnforcedColonStyle: table
EnforcedHashRocketStyle: key
# When dealing with long key names, it is easier to read hashes in colon
# notation aligned as tables. However, the same does not seem to hold true
# for hashes in rocket notation due to strange alignment rules.
#
# Instead of writing:
# default['cookbook']['attribute'] = {
# a: 'a',
# bb: 'b',
# ccc: 'c',
# }
# you should write:
# default['cookbook']['attribute'] = {
# a: 'a',
# bb: 'b',
# ccc: 'c',
# }
#
Metrics/ModuleLength:
Max: 20
# In general, developers should follow the single responsibility principle, but
# the bbatsov guide's 10-line limit seems rather arbitrary.
# Based on: https://www.mediawiki.org/wiki/Manual:Coding_conventions/Ruby
Naming/FileName:
Enabled: false