-
Notifications
You must be signed in to change notification settings - Fork 52
/
.rubocop.yml
96 lines (75 loc) · 2.1 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Rubocop configuration
AllCops:
Exclude:
# Auto-generated files
- lib/cisco_node_utils/client/grpc/ems.rb
- lib/cisco_node_utils/client/grpc/ems_services.rb
# Files we don't own
- vendor/**/*
# Code complexity metrics are tracked separately for lib/ vs. tests/
# See lib/.rubocop.yml and tests/.rubocop.yml
Metrics/AbcSize:
Enabled: true
Metrics/CyclomaticComplexity:
Enabled: true
Metrics/MethodLength:
Enabled: true
Exclude:
- docs/*.rb
Metrics/ParameterLists:
Enabled: true
Metrics/PerceivedComplexity:
Enabled: true
# Template files have long lines before tag replacement
Metrics/LineLength:
Exclude:
- docs/*.rb
#
# Team preferences different from Rubocop defaults:
#
# We don't find either of these to be useful:
Metrics/ClassLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
# We like table alignment for readability
Style/AlignHash:
EnforcedHashRocketStyle: table
EnforcedColonStyle: table
Style/ClassAndModuleChildren:
Enabled: false
# Template files have wildcard strings in class names
Style/ClassAndModuleCamelCase:
Exclude:
- docs/*.rb
# Permit is_a? and kind_of? interchangeably
Style/ClassCheck:
Enabled: false
# Template files have atypical file names on purpose
Style/FileName:
Exclude:
- docs/*.rb
# As a team we like 'sprintf' rather than 'format'
Style/FormatString:
EnforcedStyle: sprintf
# Mixed keys are ugly. Use one or the other as needed
Style/HashSyntax:
EnforcedStyle: ruby19_no_mixed_keys
# Template files have wildcard strings in method names
Style/MethodName:
Exclude:
- docs/*.rb
# "def foo(bar=baz)" not "def foo(bar = baz)"
Style/SpaceAroundEqualsInParameterDefault:
EnforcedStyle: no_space
# Make it neater to extend multi-line arrays and hashes
Style/TrailingComma:
EnforcedStyleForMultiline: comma
Style/TrivialAccessors:
AllowPredicates: true
# Because an SnmpServer cannot be destroyed, we end most of the SnmpServer
# test cases by explicitly returning the configuration to default.
# Rubocop thinks this is a no-op but it isn't.
Lint/UselessSetterCall:
Exclude:
- 'tests/test_snmpserver.rb'