-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.rubocop.yml
105 lines (83 loc) · 2.79 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
# Loosely based on the following rubocop configurations:
# https://gist.github.com/jhass/a5ae80d87f18e53e7b56
# https://gist.github.com/thomthom/5a08b248ef786cf60ee9e6c3398e21f1
require: rubocop-sketchup
AllCops:
DisplayCopNames: true
Exclude:
- 'tests/**/*'
- 'tools/**/*'
# This cop catches methods that assigns many variables, even if the complexity
# is low and readability is high.
Metrics/AbcSize:
Enabled: false
# Hacks and workarounds for API oddities may lead to some extra complexity.
Metrics/CyclomaticComplexity:
Max: 8
# Short lines are in general good for readability but splitting up one
# expression into multiple lines can be less readable. Aim for 80 chars but
# allow 120.
Metrics/LineLength:
Max: 120
Metrics/ModuleLength:
Enabled: false
# Aim for as short methods as possible.
Metrics/MethodLength:
Max: 25
Metrics/PerceivedComplexity:
Max: 9
Layout/IndentArray:
EnforcedStyle: consistent
Layout/IndentHash:
EnforcedStyle: consistent
# Use wrapping empty lines in modules containing methods (the first and last
# method should have the same spacing to the module as there are between
# methods).
#
# Don't however use wrapping empty lines for a module that merely wraps another
# module.
Layout/EmptyLinesAroundModuleBody:
Enabled: false
Layout/EmptyLinesAroundClassBody:
Enabled: false
# A module that merely wraps one single direct child module should not be
# indented. Every other code block must be indented.
Layout/IndentationWidth:
IgnoredPatterns:
- '^\s*module'
# Catches Observer and Tool interface methods from SketchUp Ruby API.
Naming/MethodName:
Enabled: false
# Class vars are used over class instance vars when they are supposed to be
# shared by all instances.
Style/ClassVars:
Enabled: false
Style/Documentation:
Enabled: false
# Double negation is a handy Ruby idiom to assure a value is a boolean, as there
# is no to_bool/to_boolean/to_b method. What the cop suggest, !var.nil?, doesn't
# even cater for boolean false as input.
Style/DoubleNegation:
Enabled: false
# Single quotes being faster is hardly measurable and only affects parse time.
# Enforcing double quotes reduces the times where you need to change them
# when introducing an interpolation. Use single quotes only if their semantics
# are needed.
Style/StringLiterals:
EnforcedStyle: double_quotes
# Conflict too often with Metric/LineLength.
# https://github.com/bbatsov/rubocop/issues/1332#issuecomment-277503854
Style/GuardClause:
Enabled: false
# In rare occasions several expressions on the same line can increase code
# readability, e.g. if a HtmlDialog callbacks can be made single line.
Style/Semicolon:
Enabled: false
SketchupDeprecations:
Enabled: true
SketchupPerformance:
Enabled: true
SketchupRequirements:
Enabled: true
SketchupSuggestions:
Enabled: true