sharp_style_rubocop 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2dde6c6fb7a92ad036e4ed2e6399e7bc3f9fdfc62e593cace245422da74c6afd
4
+ data.tar.gz: b38fc5c42ee28457adaca73692c4b1f774e87853b99f2f98e778fa45660cf576
5
+ SHA512:
6
+ metadata.gz: f4923b6ff3f024e26b4048d355dec03f0f22e7fad232982591d43080bb132c22aba755cf4940dd868c883d3aa58be3692f18314da87a2b65bb286d3df590eb58
7
+ data.tar.gz: 44ac6573a7480cd6a300721afcb79106c37fb53d280f3297f6ff8c4cfada1b4516fa9b2bc0d9b2feb4bb52aebd5a8112d0b8ee16db37098077482c93d8c85a23
data/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ ## [Unreleased]
2
+
3
+ - Set `AllCops: NewCops: pending` so new cops added in RuboCop minor releases are reported but not enabled for consumers.
4
+ - Set per-department `NewCops` so pending cops are enabled up to the versions reviewed: `Gemspec`, `Lint` and the other RuboCop departments are set to `1.92`, `Performance` to `1.24`, and `RSpec` to `3.10`.
5
+
6
+ ## [0.1.0] - 2026-10-27
7
+
8
+ - Initial release
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 joe-sharp
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # SharpStyleRubocop
2
+
3
+ My RuboCop style, packaged as a gem so every project can share the same rules.
4
+
5
+ It bundles a RuboCop configuration (`config/default.yml`) along with the `rubocop-performance` and `rubocop-rspec` plugins it uses.
6
+
7
+ ## Installation
8
+
9
+ Add the gem to your Gemfile:
10
+
11
+ ```bash
12
+ bundle add sharp_style_rubocop --group development
13
+ ```
14
+
15
+ Or install it directly:
16
+
17
+ ```bash
18
+ gem install sharp_style_rubocop
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ Inherit the shared config from your project's `.rubocop.yml`:
24
+
25
+ ```yaml
26
+ inherit_gem:
27
+ sharp_style_rubocop: config/default.yml
28
+ ```
29
+
30
+ Then run RuboCop as usual:
31
+
32
+ ```bash
33
+ bundle exec rubocop
34
+ ```
35
+
36
+ Any rule you need to change for a single project can be overridden below the `inherit_gem` line in that project's `.rubocop.yml`.
37
+
38
+ ## Development
39
+
40
+ After checking out the repo, run `bin/setup` to install dependencies. Then run `bundle exec rake` to run the specs and RuboCop against this gem's own code.
41
+
42
+ Run `bin/console` for an interactive prompt.
43
+
44
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, bump `lib/sharp_style_rubocop/version.rb`, add an entry to `CHANGELOG.md`, and run `bundle exec rake release`.
45
+
46
+ ## Contributing
47
+
48
+ Bug reports and pull requests are welcome at https://github.com/joe-sharp/sharp_style_rubocop. Contributors are expected to follow the [code of conduct](https://github.com/joe-sharp/sharp_style_rubocop/blob/main/CODE_OF_CONDUCT.md).
49
+
50
+ ## License
51
+
52
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,310 @@
1
+ plugins:
2
+ - rubocop-performance
3
+ - rubocop-rspec
4
+
5
+ AllCops:
6
+ NewCops: pending
7
+ SuggestExtensions: false
8
+ # Preview of Rubocop 2.0 defaults to "warning"
9
+ FailLevel: refactor
10
+ Exclude:
11
+ - 'spec/fixtures/**/*'
12
+ - 'vendor/**/*'
13
+ - 'tmp/**/*'
14
+ - 'node_modules/**/*'
15
+ - '.git/**/*'
16
+
17
+ # Pending cops are enabled per department. A version value enables pending
18
+ # cops added in that version or earlier; cops added after it stay pending.
19
+ Bundler:
20
+ NewCops: '1.92'
21
+ Gemspec:
22
+ NewCops: '1.92'
23
+ Layout:
24
+ NewCops: '1.92'
25
+ Lint:
26
+ NewCops: '1.92'
27
+ Metrics:
28
+ NewCops: '1.92'
29
+ Migration:
30
+ NewCops: '1.92'
31
+ Naming:
32
+ NewCops: '1.92'
33
+ # rubocop-performance plugin
34
+ Performance:
35
+ NewCops: '1.24'
36
+ # rubocop-rspec plugin
37
+ RSpec:
38
+ NewCops: '3.10'
39
+ Security:
40
+ NewCops: '1.92'
41
+ Style:
42
+ NewCops: '1.92'
43
+ # End NewCops overrides
44
+
45
+ # Remove "Rubocop 2.0" overrides after upgrading to Rubocop 2.0
46
+
47
+ # Prefer gems alphebetized in their groups
48
+ Bundler/OrderedGems:
49
+ Enabled: true
50
+
51
+ # Align 'when/else' with 'end', prevents wasting whitespace
52
+ Layout/CaseIndentation:
53
+ EnforcedStyle: end
54
+
55
+ # Prefer empty lines after Guard Clauses
56
+ Layout/EmptyLineAfterGuardClause:
57
+ Enabled: true
58
+
59
+ # Rubocop 2.0
60
+ Layout/EndAlignment:
61
+ EnforcedStyleAlignWith: variable
62
+
63
+ # Force Windows users to use lf
64
+ Layout/EndOfLine:
65
+ EnforcedStyle: lf
66
+
67
+ # Keep consistency, prevents wasting whitespace
68
+ Layout/FirstArrayElementIndentation:
69
+ EnforcedStyle: consistent
70
+
71
+ # Keep consistency, prevents wasting whitespace
72
+ Layout/FirstHashElementIndentation:
73
+ EnforcedStyle: consistent
74
+
75
+ # Key is default for both, but also allow table alignment
76
+ Layout/HashAlignment:
77
+ EnforcedHashRocketStyle:
78
+ - key
79
+ - table
80
+ EnforcedColonStyle:
81
+ - key
82
+ - table
83
+
84
+ # Prevent wasting whitespace
85
+ Layout/MultilineMethodCallIndentation:
86
+ EnforcedStyle: indented
87
+
88
+ # Prevent wasting whitespace
89
+ Layout/MultilineOperationIndentation:
90
+ EnforcedStyle: indented
91
+
92
+ # Rubocop 2.0
93
+ Layout/ParameterAlignment:
94
+ EnforcedStyle: with_fixed_indentation
95
+
96
+ # Overriding median (Max: 28) from rubocop/rubocop#15363
97
+ # Default (Max: 17)
98
+ Metrics/AbcSize:
99
+ Max: 22
100
+
101
+ # Disabling median (Max: 50), because CountAsOne makes
102
+ # the default (Max: 25) reasonable
103
+ Metrics/BlockLength:
104
+ AllowedMethods:
105
+ - describe
106
+ - context
107
+ - shared_examples
108
+ - shared_examples_for
109
+ - shared_context
110
+ - feature
111
+ - configure
112
+ - refine
113
+ CountAsOne:
114
+ - array
115
+ - hash
116
+ - heredoc
117
+ - method_call
118
+
119
+ # Overriding median (Max: 300), because CountAsOne makes
120
+ # a lower number more reasonable. Default (Max: 100)
121
+ Metrics/ClassLength:
122
+ Max: 200
123
+ CountAsOne:
124
+ - array
125
+ - hash
126
+ - heredoc
127
+ - method_call
128
+
129
+ # Thresholds are the median overrides from rubocop/rubocop#15363
130
+ Metrics/CyclomaticComplexity:
131
+ Max: 10
132
+
133
+ # Thresholds are the median overrides from rubocop/rubocop#15363
134
+ Metrics/MethodLength:
135
+ Max: 22
136
+ CountAsOne:
137
+ - array
138
+ - hash
139
+ - heredoc
140
+ - method_call
141
+
142
+ # Overriding median (Max: 240), because CountAsOne makes
143
+ # a lower number more reasonable. Default (Max: 100)
144
+ Metrics/ModuleLength:
145
+ Max: 200
146
+ CountAsOne:
147
+ - array
148
+ - hash
149
+ - heredoc
150
+ - method_call
151
+
152
+ # Thresholds are the median overrides from rubocop/rubocop#15363
153
+ Metrics/ParameterLists:
154
+ Max: 6
155
+ CountKeywordArgs: false
156
+
157
+ # Thresholds are the median overrides from rubocop/rubocop#15363
158
+ Metrics/PerceivedComplexity:
159
+ Max: 12
160
+
161
+ # Be kind
162
+ Naming/InclusiveLanguage:
163
+ Enabled: true
164
+
165
+ # Allow underscore to indicate private variable.
166
+ Naming/MemoizedInstanceVariableName:
167
+ EnforcedStyleForLeadingUnderscores: optional
168
+
169
+ # Rubocop 2.0
170
+ Naming/VariableNumber:
171
+ Enabled: false
172
+
173
+ # CountAsOne makes ExampleLength default (Max: 5) more reasonable.
174
+ # Keep an eye on this one, if it needs to be disabled frequently
175
+ # we may want to raise it a little.
176
+ RSpec/ExampleLength:
177
+ CountAsOne:
178
+ - array
179
+ - hash
180
+ - heredoc
181
+ - method_call
182
+
183
+ # Slight increase from default (Max: 3)
184
+ RSpec/NestedGroups:
185
+ Max: 4
186
+
187
+ # Increase from default (Max: 5), to avoid disabling entirely
188
+ RSpec/MultipleMemoizedHelpers:
189
+ Max: 10
190
+
191
+ # Rubocop 2.0
192
+ Style/Alias:
193
+ EnforcedStyle: prefer_alias_method
194
+
195
+ # Rubocop 2.0
196
+ Style/BlockDelimiters:
197
+ Enabled: false
198
+
199
+ # Rubocop 2.0
200
+ Style/ClassAndModuleChildren:
201
+ Enabled: false
202
+
203
+ # Prefer documentation in my code, we like Boondoc!
204
+ Style/Documentation:
205
+ Enabled: true
206
+
207
+ # Rubocop 2.0
208
+ Style/DoubleNegation:
209
+ Enabled: false
210
+
211
+ # Rubocop 2.0
212
+ Style/EmptyMethod:
213
+ EnforcedStyle: expanded
214
+
215
+ # Rubocop 2.0
216
+ Style/FormatString:
217
+ Enabled: false
218
+
219
+ # Rubocop 2.0
220
+ Style/FormatStringToken:
221
+ Enabled: false
222
+
223
+ # Rubocop 2.0
224
+ # Don't disable this until Ruby 3.4 is minimum supported version
225
+ Style/FrozenStringLiteralComment:
226
+ Enabled: true
227
+ EnforcedStyle: always_true
228
+
229
+ # Prefer early returns
230
+ Style/GuardClause:
231
+ Enabled: true
232
+
233
+ # Rubocop 2.0
234
+ Style/IfUnlessModifier:
235
+ Enabled: false
236
+
237
+ # Rubocop 2.0
238
+ Style/Lambda:
239
+ Enabled: false
240
+
241
+ # Rubocop 2.0
242
+ Style/ModuleFunction:
243
+ Enabled: false
244
+
245
+ # Rubocop 2.0
246
+ Style/NegatedIf:
247
+ Enabled: false
248
+
249
+ # Rubocop 2.0
250
+ Style/Next:
251
+ Enabled: false
252
+
253
+ # Prefer underscores in long numbers
254
+ # Disable inline for generated tables
255
+ Style/NumericLiterals:
256
+ Enabled: true
257
+
258
+ # Rubocop 2.0
259
+ Style/NumericPredicate:
260
+ Enabled: false
261
+
262
+ # Rubocop 2.0
263
+ Style/ParallelAssignment:
264
+ Enabled: false
265
+
266
+ # Rubocop 2.0
267
+ Style/PerlBackrefs:
268
+ Enabled: false
269
+
270
+ # Rubocop 2.0
271
+ Style/RaiseArgs:
272
+ Enabled: false
273
+
274
+ # Rubocop 2.0
275
+ Style/RegexpLiteral:
276
+ Enabled: false
277
+
278
+ # Rubocop 2.0
279
+ Style/RescueStandardError:
280
+ EnforcedStyle: implicit
281
+
282
+ # Rubocop 2.0
283
+ Style/SignalException:
284
+ Enabled: false
285
+
286
+ # Prefer english names when available
287
+ Style/SpecialGlobalVars:
288
+ Enabled: true
289
+ EnforcedStyle: use_builtin_english_names
290
+
291
+ # Rubocop 2.0
292
+ Style/StringLiterals:
293
+ EnforcedStyle: double_quotes
294
+
295
+ # Rubocop 2.0
296
+ Style/StringLiteralsInInterpolation:
297
+ EnforcedStyle: double_quotes
298
+
299
+ # Rubocop 2.0 override, allow consistency with WordArray
300
+ Style/SymbolArray:
301
+ Enabled: false
302
+
303
+ # Rubocop 2.0
304
+ Style/TernaryParentheses:
305
+ EnforcedStyle: require_parentheses_when_complex
306
+
307
+ # Rubocop 2.0 override, saves a lot of characters
308
+ Style/WordArray:
309
+ EnforcedStyle: percent
310
+ MinSize: 3
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SharpStyleRubocop
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "sharp_style_rubocop/version"
4
+
5
+ # Shared RuboCop style. Projects load the rules with:
6
+ #
7
+ # inherit_gem:
8
+ # sharp_style_rubocop: config/default.yml
9
+ module SharpStyleRubocop
10
+ CONFIG_PATH = File.expand_path("../config/default.yml", __dir__)
11
+ end
@@ -0,0 +1,4 @@
1
+ module SharpStyleRubocop
2
+ VERSION: String
3
+ CONFIG_PATH: String
4
+ end
metadata ADDED
@@ -0,0 +1,93 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sharp_style_rubocop
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - joe-sharp
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: rubocop
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '1.92'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '1.92'
26
+ - !ruby/object:Gem::Dependency
27
+ name: rubocop-performance
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '1.20'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.20'
40
+ - !ruby/object:Gem::Dependency
41
+ name: rubocop-rspec
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '3.0'
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '3.0'
54
+ description: RuboCop rules and plugin setup for Joe Sharp's Ruby projects, shared
55
+ as a gem so every project inherits the same style.
56
+ email:
57
+ - joesharp13@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - CHANGELOG.md
63
+ - LICENSE.txt
64
+ - README.md
65
+ - config/default.yml
66
+ - lib/sharp_style_rubocop.rb
67
+ - lib/sharp_style_rubocop/version.rb
68
+ - sig/sharp_style_rubocop.rbs
69
+ homepage: https://github.com/joe-sharp/sharp_style_rubocop
70
+ licenses:
71
+ - MIT
72
+ metadata:
73
+ source_code_uri: https://github.com/joe-sharp/sharp_style_rubocop
74
+ changelog_uri: https://github.com/joe-sharp/sharp_style_rubocop/blob/main/CHANGELOG.md
75
+ rubygems_mfa_required: 'true'
76
+ rdoc_options: []
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: 3.3.0
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ requirements: []
90
+ rubygems_version: 4.0.20
91
+ specification_version: 4
92
+ summary: A shared RuboCop style configuration.
93
+ test_files: []