-
Notifications
You must be signed in to change notification settings - Fork 2
/
.rubocop.yml
56 lines (56 loc) · 1.49 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 rubocop for bundled chef-vault
AllCops:
Exclude:
- 'ext/chef-vault/**/*'
- 'libraries/chef-vault_*'
### Disable block size for rspec
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
### 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/TrailingCommaInLiteral:
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: table
# When dealing with long key names, it is easier to read hashes aligned as
# tables. This is true both for colon and rocket style hashes.
#
# Instead of writing:
# default['cookbook']['attribute'] = {
# a: 'a',
# bb: 'b',
# ccc: 'c',
# }
# you should write:
# default['cookbook']['attribute'] = {
# a: 'a',
# bb: 'b',
# ccc: 'c',
# }
#