-
Notifications
You must be signed in to change notification settings - Fork 124
Expand file tree
/
Copy path.rubocop.yml
More file actions
112 lines (93 loc) · 2.57 KB
/
.rubocop.yml
File metadata and controls
112 lines (93 loc) · 2.57 KB
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
plugins:
- rubocop-minitest
# Allow rbs-inline #: comments without space after #
Layout/LeadingCommentSpace:
AllowRBSInlineAnnotation: true
# @rbs type annotations can be long
Layout/LineLength:
Max: 140
AllCops:
TargetRubyVersion: 3.1
NewCops: enable
Exclude:
- 'vendor/**/*'
- 'coverage/**/*'
- '*.gemspec'
- 'bin/**/*'
- 'install.rb'
- 'benchmark/**/*'
# Existing code lacks documentation, can add incrementally
Style/Documentation:
Enabled: false
# Test files often have long blocks
Metrics/BlockLength:
Exclude:
- 'test/**/*'
- 'lib/classifier/extensions/vector.rb'
- 'lib/classifier/cli.rb'
# Allow longer methods in complex algorithms (SVD, etc.) and CLI
Metrics/MethodLength:
Max: 25
Exclude:
- 'test/**/*'
- 'lib/classifier/extensions/vector.rb'
- 'lib/classifier/lsi/content_node.rb'
- 'lib/classifier/cli.rb'
# Allow higher complexity for mathematical algorithms and CLI
Metrics/AbcSize:
Max: 30
Exclude:
- 'test/**/*'
- 'lib/classifier/extensions/vector.rb'
- 'lib/classifier/lsi.rb'
- 'lib/classifier/lsi/content_node.rb'
- 'lib/classifier/cli.rb'
Metrics/CyclomaticComplexity:
Max: 10
Exclude:
- 'lib/classifier/extensions/vector.rb'
- 'lib/classifier/lsi/content_node.rb'
- 'lib/classifier/cli.rb'
Metrics/PerceivedComplexity:
Max: 10
Exclude:
- 'lib/classifier/extensions/vector.rb'
- 'lib/classifier/lsi/content_node.rb'
- 'lib/classifier/cli.rb'
# Class length limits - algorithms, tests and CLI can be longer
Metrics/ClassLength:
Max: 250
Exclude:
- 'test/**/*'
- 'lib/classifier/lsi.rb'
- 'lib/classifier/cli.rb'
# SV_decomp is a standard algorithm name
Naming/MethodName:
Exclude:
- 'lib/classifier/extensions/vector.rb'
# Short parameter names are acceptable for serialization
Naming/MethodParameterName:
Exclude:
- 'lib/classifier/extensions/vector_serialize.rb'
# Marshal.load is intentional for deserialization
Security/MarshalLoad:
Exclude:
- 'lib/classifier/extensions/vector_serialize.rb'
- 'test/**/*'
# CORPUS_SKIP_WORDS is a public constant used externally
Lint/UselessConstantScoping:
Enabled: false
# Frozen string literal is optional for this gem
Style/FrozenStringLiteralComment:
Enabled: false
# Allow compact class/module child definitions
Style/ClassAndModuleChildren:
Enabled: false
# Allow both styles of string literals
Style/StringLiterals:
EnforcedStyle: single_quotes
Style/StringLiteralsInInterpolation:
EnforcedStyle: single_quotes
# Minitest assertions
Minitest/MultipleAssertions:
Max: 10