forked from NREL/openstudio-standards
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
164 lines (123 loc) · 4.11 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# Most of the maintainers of this code are professional engineers,
# not professional Rubyists. The style guide for this project
# has been modified accordingly, with explanations given below.
# Where a Cop is not listed, it uses the Rubocop defaults.
AllCops:
Exclude:
- 'data/**/*'
- 'test/**/*'
- 'lib/openstudio-standards/hvac_sizing/**/*'
- 'lib/openstudio-standards/btap/**/*'
- 'lib/openstudio-standards/prototypes/common/do_not_edit_metaclasses.rb'
# ==================== Linters ====================
# Allow variable initialization to indicate
# what variable is going to be set by the next
# block of code.
Lint/UselessAssignment:
Enabled: false
# Allow unused arguments in anticipation that
# those arguments will be used in the future.
# The ruby _arg convention will not be understood
# by many of the non-Rubyists maintaining the code.
Lint/UnusedMethodArgument:
Enabled: false
# Allow unused block arguments.
# The ruby _arg convention will not be understood
# by many of the non-Rubyists maintaining the code.
Lint/UnusedBlockArgument:
Enabled: false
# Allow empty when branches to give
# a space to clearly document the
# reason that nothing is happening.
Lint/EmptyWhen:
Enabled: false
# ==================== Metrics ====================
Metrics/BlockNesting:
Max: 4
Metrics/CyclomaticComplexity:
Max: 48
# Allow long lines to encourage sufficiently
# detailed user-facing log messages.
Metrics/LineLength:
Max: 1000
# Longer parameter list limits for methods that
# add HVAC systems
Metrics/ParameterLists:
Max: 15
# Disable this metric. This is a complex engineering-focused library.
Metrics/ClassLength:
Enabled: false
# Disable this metric. This is a complex engineering-focused library.
Metrics/MethodLength:
Enabled: false
# Disable this metric. This is a complex engineering-focused library.
Metrics/ModuleLength:
Enabled: false
# Disable this metric. This is a complex engineering-focused library.
Metrics/AbcSize:
Enabled: false
# Disable this metric. This is a complex engineering-focused library.
Metrics/BlockLength:
Enabled: false
# Disable this metric. This is a complex engineering-focused library.
Metrics/PerceivedComplexity:
Enabled: false
# Disable this metric. This is a complex engineering-focused library.
Metrics/CyclomaticComplexity:
Enabled: false
# ==================== Styles ====================
# WordArray enforces how array literals of word-like strings should be expressed.
# Enforce ['Word1', 'Word2'] for readability
Style/WordArray:
EnforcedStyle: brackets
# Disabled because in most of this codebase,
# the current approach is more readable.
Style/GuardClause:
Enabled: false
# Allow this type of nesting for logic clarity.
Style/IfInsideElse:
Enabled: false
# This library encourages explicit returns for clarity
Style/RedundantReturn:
Enabled: false
# Allow duplication inside conditional branches to keep
# code that does certain tasks more consolidated.
Style/IdenticalConditionalBranches:
Enabled: false
# Do not force people to use Next.
Style/Next:
Enabled: false
# Do not force people to use one-line if statements.
Style/IfUnlessModifier:
Enabled: false
# Documentation will be covered by YARD.
Style/Documentation:
Enabled: false
# Unclear what this Cop is about; disregard
Style/ClassAndModuleChildren:
Enabled: false
# Allow multiple comparisons via || for clarity
Style/MultipleComparison:
Enabled: false
# Allow for i in 0..3 loops
Style/For:
Enabled: false
# ==================== Naming ====================
# Ignore file name convention; choices based on OpenStudio C++ class names
Naming/FileName:
Enabled: false
# Intentionally allow set_foo because these methods do not
# take have cooresponding getters.
Naming/AccessorMethodName:
Enabled: false
# Allow variables like coeff_1 for legibility
Naming/VariableNumber:
Enabled: false
# ==================== Layout ====================
# Allow indented case statements
Layout/CaseIndentation:
Enabled: false
# ==================== Performance ====================
# Allow hash.each
Performance/HashEachMethods:
Enabled: false