-
Notifications
You must be signed in to change notification settings - Fork 8
/
sketchup-style.yml
164 lines (126 loc) · 3.73 KB
/
sketchup-style.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
163
164
AllCops:
DisplayCopNames: true
# Indent continuation lines by 4 spaces.
Layout/AssignmentIndentation:
IndentationWidth: 4
# It's ok to have more than one empty line to create a 'paragraph'.
Layout/EmptyLines:
Enabled: false
# Extra space is fine.
Layout/EmptyLinesAroundClassBody:
Enabled: false
# Extra space is fine.
Layout/EmptyLinesAroundModuleBody:
Enabled: false
# Normally one line in between, but two allowed for "paragraphs".
Layout/EmptyLineBetweenDefs:
NumberOfEmptyLines: [1, 2]
# Rely on Git to normalize end of lines.
Layout/EndOfLine:
Enabled: false
# Add lines as needed.
Layout/EmptyLinesAroundBlockBody:
Enabled: false
# Match indent with Layout/ParameterAlignment.
Layout/FirstArgumentIndentation:
IndentationWidth: 4
# Disabled until a more flexible rule is implemented.
# See issue for more details: https://github.com/rubocop-hq/rubocop/issues/6410
# TL;DR: The best readability for alignment might depend.
Layout/HashAlignment:
# Enabled: false
EnforcedHashRocketStyle:
- key
- table
EnforcedColonStyle:
- key
- table
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
IndentationWidth: 4
# Too noisy.
Metrics/AbcSize:
Enabled: false
# Too noisy.
Metrics/CyclomaticComplexity:
Enabled: false
# The default 10 is a bit too constrictive.
Metrics/MethodLength:
Max: 20
# Too noisy.
Metrics/PerceivedComplexity:
Enabled: false
# Prefer non-abbreviated variable name. Usually `error`, but `exception` if
# catching `Exception`.
Naming/RescuedExceptionsVariableName:
Enabled: false
# Allow for common names used in 3D context.
Naming/MethodParameterName:
AllowedNames:
- x
- y
- z
- u
- v
- uv
# 🖤 Unicode!
Style/AsciiComments:
Enabled: false
# Prefer { ... } over do ... end except for control flow and
# method defintions. Unfortunatly, no cop configuration for this.
# https://github.com/chneukirchen/styleguide/blob/e60de37b478d3f892f6985a58d573016f33f0269/RUBY-STYLE#L63-L67
Style/BlockDelimiters:
EnforcedStyle: semantic
Enabled: false
# Generally prefer compact style to reduce indentation. But no hard rule.
Style/ClassAndModuleChildren:
EnforcedStyle: compact
Enabled: false
# This doesn't always read nicely.
Style/ConditionalAssignment:
Enabled: false
# Nah, it's ok.
Style/CommentedKeyword:
Enabled: false
# TODO(thomthom): Consider turning this back on.
Style/Documentation:
Enabled: false
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
# Conflict too often with Metric/LineLength.
# https://github.com/bbatsov/rubocop/issues/1332#issuecomment-277503854
Style/GuardClause:
Enabled: false
# Some times it reads clearer to not trail if/unless at the end.
Style/IfUnlessModifier:
Enabled: false
Style/ModuleFunction:
Enabled: false
# .zero? doesn't read better than == 0.
Style/NumericPredicate:
Enabled: false
# It's not easy always know the defaults. Being explicit is a safe choice.
Style/RedundantArgument:
Enabled: false
# Very subjective style. Lots of existing SketchUp code and example uses them
# so disable by default.
Style/RedundantSelf:
Enabled: false
# Safe navigation was added with Ruby 2.3. SketchUp 2017 with Ruby 2.2 is still
# relevant, so ignore this for now.
Style/SafeNavigation:
Enabled: false
# %w and %i etc isn't really intuitive unless you are really familiar with the
# syntax. %w seems used often enough. But [:symbol, :foo] reads clearer than
# %i(symbol foo).
Style/SymbolArray:
Enabled: False
# Add trailing comma so it's easy to duplicate/add lines.
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: consistent_comma