rubocop-intum 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: 14c76330a8aa4739794cb428b900c433c6ab2dbf0e74d275550b3a2955ff7a8e
4
+ data.tar.gz: fe3fb52995a17c6bac9b380499398722353dc2436518de9637668f8a59baf644
5
+ SHA512:
6
+ metadata.gz: 749431eacc13185fe818bab38f3ad8cd47845f46b54ce0d4e89dbf9cc2fe65afcb3058c4bf00df7cea2c7cbd229be9e38230c01b368392f8b47cc19ab296659a
7
+ data.tar.gz: 2fe8a02cf79cd71e8900149c851139a667196ff15e6fca78924282cfa0584e0538e2a4ae2a82d6cefbcfa4a82a6e3ed3aa55bb531fd03fde4b31223fc553b5a4
data/.rubocop.yml ADDED
@@ -0,0 +1,16 @@
1
+ inherit_from:
2
+ - rubocop.yml
3
+
4
+ AllCops:
5
+ TargetRubyVersion: 2.6
6
+
7
+ Style/StringLiterals:
8
+ Enabled: true
9
+ EnforcedStyle: double_quotes
10
+
11
+ Style/StringLiteralsInInterpolation:
12
+ Enabled: true
13
+ EnforcedStyle: double_quotes
14
+
15
+ Layout/LineLength:
16
+ Max: 120
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in rubocop-intum.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "test-unit", "~> 3.0"
11
+
12
+ gem "rubocop", ">= 1.32.0", require: false
13
+ gem "rubocop-minitest", ">= 0.21.0", require: false
14
+ gem "rubocop-performance", ">= 1.14.3", require: false
15
+ gem "rubocop-rails", ">= 2.15.2", require: false
16
+ gem "rubocop-shopify", require: false
17
+
data/Gemfile.lock ADDED
@@ -0,0 +1,73 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rubocop-intum (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ activesupport (7.0.3.1)
10
+ concurrent-ruby (~> 1.0, >= 1.0.2)
11
+ i18n (>= 1.6, < 2)
12
+ minitest (>= 5.1)
13
+ tzinfo (~> 2.0)
14
+ ast (2.4.2)
15
+ concurrent-ruby (1.1.10)
16
+ i18n (1.12.0)
17
+ concurrent-ruby (~> 1.0)
18
+ json (2.6.2)
19
+ minitest (5.16.2)
20
+ parallel (1.22.1)
21
+ parser (3.1.2.0)
22
+ ast (~> 2.4.1)
23
+ power_assert (2.0.1)
24
+ rack (2.2.4)
25
+ rainbow (3.1.1)
26
+ rake (13.0.6)
27
+ regexp_parser (2.5.0)
28
+ rexml (3.2.5)
29
+ rubocop (1.32.0)
30
+ json (~> 2.3)
31
+ parallel (~> 1.10)
32
+ parser (>= 3.1.0.0)
33
+ rainbow (>= 2.2.2, < 4.0)
34
+ regexp_parser (>= 1.8, < 3.0)
35
+ rexml (>= 3.2.5, < 4.0)
36
+ rubocop-ast (>= 1.19.1, < 2.0)
37
+ ruby-progressbar (~> 1.7)
38
+ unicode-display_width (>= 1.4.0, < 3.0)
39
+ rubocop-ast (1.19.1)
40
+ parser (>= 3.1.1.0)
41
+ rubocop-minitest (0.21.0)
42
+ rubocop (>= 0.90, < 2.0)
43
+ rubocop-performance (1.14.3)
44
+ rubocop (>= 1.7.0, < 2.0)
45
+ rubocop-ast (>= 0.4.0)
46
+ rubocop-rails (2.15.2)
47
+ activesupport (>= 4.2.0)
48
+ rack (>= 1.1)
49
+ rubocop (>= 1.7.0, < 2.0)
50
+ rubocop-shopify (2.8.0)
51
+ rubocop (~> 1.31)
52
+ ruby-progressbar (1.11.0)
53
+ test-unit (3.5.3)
54
+ power_assert
55
+ tzinfo (2.0.5)
56
+ concurrent-ruby (~> 1.0)
57
+ unicode-display_width (2.2.0)
58
+
59
+ PLATFORMS
60
+ arm64-darwin-21
61
+
62
+ DEPENDENCIES
63
+ rake (~> 13.0)
64
+ rubocop (>= 1.32.0)
65
+ rubocop-intum!
66
+ rubocop-minitest (>= 0.21.0)
67
+ rubocop-performance (>= 1.14.3)
68
+ rubocop-rails (>= 2.15.2)
69
+ rubocop-shopify
70
+ test-unit (~> 3.0)
71
+
72
+ BUNDLED WITH
73
+ 2.2.33
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 intum
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # Rubocop::Intum
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rubocop/intum`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'rubocop-intum'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install rubocop-intum
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test-unit` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rubocop-intum.
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/*_test.rb"]
10
+ end
11
+
12
+ require "rubocop/rake_task"
13
+
14
+ RuboCop::RakeTask.new
15
+
16
+ task default: %i[test rubocop]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "rubocop/intum"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rubocop
4
+ module Intum
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "intum/version"
4
+
5
+ module Rubocop
6
+ module Intum
7
+ class Error < StandardError; end
8
+ # Your code goes here...
9
+ end
10
+ end
data/rubocop.yml ADDED
@@ -0,0 +1,881 @@
1
+ # tu wpisujemy tylko różnice w odniesieniu od domyślnych reguł z pliku:
2
+ # https://github.com/rubocop-hq/rubocop/blob/master/config/default.yml
3
+ # https://github.com/Shopify/ruby-style-guide/blob/v2.8.0/rubocop.yml
4
+
5
+ inherit_gem:
6
+ rubocop-shopify: rubocop.yml
7
+
8
+ require:
9
+ - rubocop-minitest
10
+ - rubocop-rails
11
+ - rubocop-performance
12
+
13
+ Layout/ArgumentAlignment:
14
+ Description: >-
15
+ Align the arguments of a method call if they span more
16
+ than one line.
17
+ StyleGuide: '#no-double-indent'
18
+ Enabled: true
19
+ VersionAdded: '0.68'
20
+ VersionChanged: '0.77'
21
+ # Alignment of arguments in multi-line method calls.
22
+ #
23
+ # The `with_first_argument` style aligns the following lines along the same
24
+ # column as the first parameter.
25
+ #
26
+ # method_call(a,
27
+ # b)
28
+ #
29
+ # The `with_fixed_indentation` style aligns the following lines with one
30
+ # level of indentation relative to the start of the line with the method call.
31
+ #
32
+ # method_call(a,
33
+ # b)
34
+ EnforcedStyle: with_fixed_indentation
35
+ SupportedStyles:
36
+ - with_first_argument
37
+ - with_fixed_indentation
38
+ # By default, the indentation width from Layout/IndentationWidth is used
39
+ # But it can be overridden by setting this parameter
40
+ IndentationWidth: ~
41
+
42
+
43
+ Layout/FirstHashElementIndentation:
44
+ Description: 'Checks the indentation of the first key in a hash literal.'
45
+ Enabled: true
46
+ VersionAdded: '0.68'
47
+ VersionChanged: '0.77'
48
+ # The value `special_inside_parentheses` means that hash literals with braces
49
+ # that have their opening brace on the same line as a surrounding opening
50
+ # round parenthesis, shall have their first key indented relative to the
51
+ # first position inside the parenthesis.
52
+ #
53
+ # The value `consistent` means that the indentation of the first key shall
54
+ # always be relative to the first position of the line where the opening
55
+ # brace is.
56
+ #
57
+ # The value `align_braces` means that the indentation of the first key shall
58
+ # always be relative to the position of the opening brace.
59
+ EnforcedStyle: consistent
60
+ SupportedStyles:
61
+ - special_inside_parentheses
62
+ - consistent
63
+ - align_braces
64
+ # By default, the indentation width from `Layout/IndentationWidth` is used
65
+ # But it can be overridden by setting this parameter
66
+ IndentationWidth: ~
67
+
68
+ Layout/LineLength:
69
+ Description: 'Checks that line length does not exceed the configured limit.'
70
+ StyleGuide: '#max-line-length'
71
+ Enabled: true
72
+ VersionAdded: '0.25'
73
+ VersionChanged: '0.84'
74
+ AutoCorrect: false
75
+ Max: 130
76
+ # To make it possible to copy or click on URIs in the code, we allow lines
77
+ # containing a URI to be longer than Max.
78
+ AllowHeredoc: true
79
+ AllowURI: true
80
+ URISchemes:
81
+ - http
82
+ - https
83
+ # The IgnoreCopDirectives option causes the LineLength rule to ignore cop
84
+ # directives like '# rubocop: enable ...' when calculating a line's length.
85
+ IgnoreCopDirectives: true
86
+ # The IgnoredPatterns option is a list of !ruby/regexp and/or string
87
+ # elements. Strings will be converted to Regexp objects. A line that matches
88
+ # any regular expression listed in this option will be ignored by LineLength.
89
+ AllowedPatterns: ['(^\s*\#.*)|(.*\s\#.*)']
90
+
91
+ Layout/SpaceBeforeBlockBraces:
92
+ Description: >-
93
+ Checks that the left block brace has or doesn't have space
94
+ before it.
95
+ Enabled: false
96
+ VersionAdded: '0.49'
97
+ EnforcedStyle: space
98
+ SupportedStyles:
99
+ - space
100
+ - no_space
101
+ EnforcedStyleForEmptyBraces: space
102
+ SupportedStylesForEmptyBraces:
103
+ - space
104
+ - no_space
105
+ VersionChanged: '0.52.1'
106
+
107
+ Layout/SpaceInsideHashLiteralBraces:
108
+ Description: "Use spaces inside hash literal braces - or don't."
109
+ StyleGuide: '#spaces-operators'
110
+ Enabled: true
111
+ VersionAdded: '0.49'
112
+ EnforcedStyle: space
113
+ SupportedStyles:
114
+ - space
115
+ - no_space
116
+ # 'compact' normally requires a space inside hash braces, with the exception
117
+ # that successive left braces or right braces are collapsed together
118
+ - compact
119
+ EnforcedStyleForEmptyBraces: no_space
120
+ SupportedStylesForEmptyBraces:
121
+ - space
122
+ - no_space
123
+
124
+
125
+ Layout/TrailingWhitespace:
126
+ Description: 'Avoid trailing whitespace.'
127
+ StyleGuide: '#no-trailing-whitespace'
128
+ Enabled: true
129
+ VersionAdded: '0.49'
130
+ VersionChanged: '0.83'
131
+ AllowInHeredoc: true # TO CHECK
132
+
133
+ Metrics/AbcSize:
134
+ Description: >-
135
+ A calculated magnitude based on number of assignments,
136
+ branches, and conditions.
137
+ Reference:
138
+ - http://c2.com/cgi/wiki?AbcMetric
139
+ - https://en.wikipedia.org/wiki/ABC_Software_Metric
140
+ Enabled: true
141
+ VersionAdded: '0.27'
142
+ VersionChanged: '0.81'
143
+ # The ABC size is a calculated magnitude, so this number can be an Integer or
144
+ # a Float.
145
+ IgnoredMethods: []
146
+ Max: 50
147
+
148
+ Metrics/BlockLength:
149
+ Description: 'Avoid long blocks with many lines.'
150
+ Enabled: true
151
+ VersionAdded: '0.44'
152
+ VersionChanged: '0.87'
153
+ CountComments: false # count full line comments?
154
+ Max: 100
155
+ CountAsOne: []
156
+ IgnoredMethods:
157
+ # By default, exclude the `#refine` method, as it tends to have larger
158
+ # associated blocks.
159
+ - refine
160
+ Exclude:
161
+ - '**/*.gemspec'
162
+
163
+
164
+ Metrics/ClassLength:
165
+ Description: 'Avoid classes longer than 100 lines of code.'
166
+ Enabled: true
167
+ VersionAdded: '0.25'
168
+ VersionChanged: '0.87'
169
+ CountComments: false # count full line comments?
170
+ Max: 300
171
+ CountAsOne: []
172
+
173
+ Metrics/CyclomaticComplexity:
174
+ Description: >-
175
+ A complexity metric that is strongly correlated to the number
176
+ of test cases needed to validate a method.
177
+ Enabled: true
178
+ VersionAdded: '0.25'
179
+ VersionChanged: '0.81'
180
+ IgnoredMethods: []
181
+ Max: 15
182
+
183
+ Metrics/MethodLength:
184
+ Description: 'Avoid methods longer than 10 lines of code.'
185
+ StyleGuide: '#short-methods'
186
+ Enabled: true
187
+ VersionAdded: '0.25'
188
+ VersionChanged: '0.87'
189
+ CountComments: false # count full line comments?
190
+ Max: 100
191
+ CountAsOne: []
192
+ IgnoredMethods: []
193
+
194
+ Metrics/ModuleLength:
195
+ Description: 'Avoid modules longer than 100 lines of code.'
196
+ Enabled: true
197
+ VersionAdded: '0.31'
198
+ VersionChanged: '0.87'
199
+ CountComments: false # count full line comments?
200
+ Max: 400
201
+ CountAsOne: []
202
+
203
+
204
+ Metrics/ParameterLists:
205
+ Description: 'Avoid parameter lists longer than three or four parameters.'
206
+ StyleGuide: '#too-many-params'
207
+ Enabled: true
208
+ VersionAdded: '0.25'
209
+ Max: 7
210
+ CountKeywordArgs: true
211
+
212
+
213
+ Metrics/PerceivedComplexity:
214
+ Description: >-
215
+ A complexity metric geared towards measuring complexity for a
216
+ human reader.
217
+ Enabled: true
218
+ VersionAdded: '0.25'
219
+ VersionChanged: '0.81'
220
+ IgnoredMethods: []
221
+ Max: 20
222
+
223
+
224
+ Naming/AccessorMethodName:
225
+ Description: Check the naming of accessor methods for get_/set_.
226
+ StyleGuide: '#accessor_mutator_method_names'
227
+ Enabled: false
228
+ VersionAdded: '0.50'
229
+
230
+
231
+ Naming/PredicateName:
232
+ Description: 'Check the names of predicate methods.'
233
+ StyleGuide: '#bool-methods-qmark'
234
+ Enabled: false
235
+ VersionAdded: '0.50'
236
+ VersionChanged: '0.77'
237
+ # Predicate name prefixes.
238
+ NamePrefix:
239
+ - is_
240
+ - has_
241
+ - have_
242
+ # Predicate name prefixes that should be removed.
243
+ ForbiddenPrefixes:
244
+ - is_
245
+ - has_
246
+ - have_
247
+ # Predicate names which, despite having a forbidden prefix, or no `?`,
248
+ # should still be accepted
249
+ AllowedMethods:
250
+ - is_a?
251
+ # Method definition macros for dynamically generated methods.
252
+ MethodDefinitionMacros:
253
+ - define_method
254
+ - define_singleton_method
255
+ # Exclude Rspec specs because there is a strong convention to write spec
256
+ # helpers in the form of `have_something` or `be_something`.
257
+ Exclude:
258
+ - 'spec/**/*'
259
+
260
+
261
+ Style/AndOr:
262
+ Description: 'Use &&/|| instead of and/or.'
263
+ StyleGuide: '#no-and-or-or'
264
+ Enabled: true
265
+ VersionAdded: '0.9'
266
+ VersionChanged: '0.25'
267
+ # Whether `and` and `or` are banned only in conditionals (conditionals)
268
+ # or completely (always).
269
+ EnforcedStyle: always
270
+ SupportedStyles:
271
+ - always
272
+ - conditionals
273
+
274
+
275
+ Style/AsciiComments:
276
+ Description: 'Use only ascii symbols in comments.'
277
+ StyleGuide: '#english-comments'
278
+ Enabled: false
279
+ VersionAdded: '0.9'
280
+ VersionChanged: '0.52'
281
+ AllowedChars: []
282
+
283
+
284
+ Style/BlockDelimiters:
285
+ Description: >-
286
+ Avoid using {...} for multi-line blocks (multiline chaining is
287
+ always ugly).
288
+ Prefer {...} over do...end for single-line blocks.
289
+ StyleGuide: '#single-line-blocks'
290
+ Enabled: true
291
+ VersionAdded: '0.30'
292
+ VersionChanged: '0.35'
293
+ EnforcedStyle: line_count_based
294
+ SupportedStyles:
295
+ # The `line_count_based` style enforces braces around single line blocks and
296
+ # do..end around multi-line blocks.
297
+ - line_count_based
298
+ # The `semantic` style enforces braces around functional blocks, where the
299
+ # primary purpose of the block is to return a value and do..end for
300
+ # multi-line procedural blocks, where the primary purpose of the block is
301
+ # its side-effects. Single-line procedural blocks may only use do-end,
302
+ # unless AllowBracesOnProceduralOneLiners has a truthy value (see below).
303
+ #
304
+ # This looks at the usage of a block's method to determine its type (e.g. is
305
+ # the result of a `map` assigned to a variable or passed to another
306
+ # method) but exceptions are permitted in the `ProceduralMethods`,
307
+ # `FunctionalMethods` and `IgnoredMethods` sections below.
308
+ - semantic
309
+ # The `braces_for_chaining` style enforces braces around single line blocks
310
+ # and do..end around multi-line blocks, except for multi-line blocks whose
311
+ # return value is being chained with another method (in which case braces
312
+ # are enforced).
313
+ - braces_for_chaining
314
+ # The `always_braces` style always enforces braces.
315
+ - always_braces
316
+ ProceduralMethods:
317
+ # Methods that are known to be procedural in nature but look functional from
318
+ # their usage, e.g.
319
+ #
320
+ # time = Benchmark.realtime do
321
+ # foo.bar
322
+ # end
323
+ #
324
+ # Here, the return value of the block is discarded but the return value of
325
+ # `Benchmark.realtime` is used.
326
+ - benchmark
327
+ - bm
328
+ - bmbm
329
+ - create
330
+ - each_with_object
331
+ - measure
332
+ - new
333
+ - realtime
334
+ - tap
335
+ - with_object
336
+ FunctionalMethods:
337
+ # Methods that are known to be functional in nature but look procedural from
338
+ # their usage, e.g.
339
+ #
340
+ # let(:foo) { Foo.new }
341
+ #
342
+ # Here, the return value of `Foo.new` is used to define a `foo` helper but
343
+ # doesn't appear to be used from the return value of `let`.
344
+ - let
345
+ - let!
346
+ - subject
347
+ - watch
348
+ IgnoredMethods:
349
+ # Methods that can be either procedural or functional and cannot be
350
+ # categorised from their usage alone, e.g.
351
+ #
352
+ # foo = lambda do |x|
353
+ # puts "Hello, #{x}"
354
+ # end
355
+ #
356
+ # foo = lambda do |x|
357
+ # x * 100
358
+ # end
359
+ #
360
+ # Here, it is impossible to tell from the return value of `lambda` whether
361
+ # the inner block's return value is significant.
362
+ - lambda
363
+ - proc
364
+ - it
365
+ - json
366
+ - js
367
+ # The AllowBracesOnProceduralOneLiners option is ignored unless the
368
+ # EnforcedStyle is set to `semantic`. If so:
369
+ #
370
+ # If AllowBracesOnProceduralOneLiners is unspecified, or set to any
371
+ # falsey value, then semantic purity is maintained, so one-line
372
+ # procedural blocks must use do-end, not braces.
373
+ #
374
+ # # bad
375
+ # collection.each { |element| puts element }
376
+ #
377
+ # # good
378
+ # collection.each do |element| puts element end
379
+ #
380
+ # If AllowBracesOnProceduralOneLiners is set to any truthy value,
381
+ # then one-line procedural blocks may use either style.
382
+ #
383
+ # # good
384
+ # collection.each { |element| puts element }
385
+ #
386
+ # # also good
387
+ # collection.each do |element| puts element end
388
+ AllowBracesOnProceduralOneLiners: false
389
+ # The BracesRequiredMethods overrides all other configurations except
390
+ # IgnoredMethods. It can be used to enforce that all blocks for specific
391
+ # methods use braces. For example, you can use this to enforce Sorbet
392
+ # signatures use braces even when the rest of your codebase enforces
393
+ # the `line_count_based` style.
394
+ BracesRequiredMethods: []
395
+
396
+
397
+ Style/ClassAndModuleChildren:
398
+ Description: 'Checks style of children classes and modules.'
399
+ StyleGuide: '#namespace-definition'
400
+ # Moving from compact to nested children requires knowledge of whether the
401
+ # outer parent is a module or a class. Moving from nested to compact requires
402
+ # verification that the outer parent is defined elsewhere. Rubocop does not
403
+ # have the knowledge to perform either operation safely and thus requires
404
+ # manual oversight.
405
+ SafeAutoCorrect: false
406
+ Enabled: false
407
+ VersionAdded: '0.19'
408
+ #
409
+ # Basically there are two different styles:
410
+ #
411
+ # `nested` - have each child on a separate line
412
+ # class Foo
413
+ # class Bar
414
+ # end
415
+ # end
416
+ #
417
+ # `compact` - combine definitions as much as possible
418
+ # class Foo::Bar
419
+ # end
420
+ #
421
+ # The compact style is only forced, for classes or modules with one child.
422
+ EnforcedStyle: nested
423
+ SupportedStyles:
424
+ - nested
425
+ - compact
426
+
427
+ Style/CommentedKeyword:
428
+ Description: 'Do not place comments on the same line as certain keywords.'
429
+ Enabled: false
430
+ VersionAdded: '0.51'
431
+
432
+ Style/ConditionalAssignment:
433
+ Description: >-
434
+ Use the return value of `if` and `case` statements for
435
+ assignment to a variable and variable comparison instead
436
+ of assigning that variable inside of each branch.
437
+ Enabled: false
438
+ VersionAdded: '0.36'
439
+ VersionChanged: '0.47'
440
+ EnforcedStyle: assign_to_condition
441
+ SupportedStyles:
442
+ - assign_to_condition
443
+ - assign_inside_condition
444
+ # When configured to `assign_to_condition`, `SingleLineConditionsOnly`
445
+ # will only register an offense when all branches of a condition are
446
+ # a single line.
447
+ # When configured to `assign_inside_condition`, `SingleLineConditionsOnly`
448
+ # will only register an offense for assignment to a condition that has
449
+ # at least one multiline branch.
450
+ SingleLineConditionsOnly: true
451
+ IncludeTernaryExpressions: true
452
+
453
+ Style/Documentation:
454
+ Description: 'Document classes and non-namespace modules.'
455
+ Enabled: false
456
+ VersionAdded: '0.9'
457
+ Exclude:
458
+ - 'spec/**/*'
459
+ - 'test/**/*'
460
+
461
+
462
+ Style/EmptyMethod:
463
+ Description: 'Checks the formatting of empty method definitions.'
464
+ StyleGuide: '#no-single-line-methods'
465
+ Enabled: true
466
+ VersionAdded: '0.46'
467
+ EnforcedStyle: expanded
468
+ SupportedStyles:
469
+ - compact
470
+ - expanded
471
+
472
+
473
+ Style/FormatString:
474
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
475
+ StyleGuide: '#sprintf'
476
+ Enabled: true
477
+ VersionAdded: '0.19'
478
+ VersionChanged: '0.49'
479
+ EnforcedStyle: percent
480
+ SupportedStyles:
481
+ - format
482
+ - sprintf
483
+ - percent
484
+
485
+
486
+ Style/FormatStringToken:
487
+ Description: 'Use a consistent style for format string tokens.'
488
+ Enabled: true
489
+ EnforcedStyle: template
490
+ SupportedStyles:
491
+ # Prefer tokens which contain a sprintf like type annotation like
492
+ # `%<name>s`, `%<age>d`, `%<score>f`
493
+ - annotated
494
+ # Prefer simple looking "template" style tokens like `%{name}`, `%{age}`
495
+ - template
496
+ - unannotated
497
+ # `MaxUnannotatedPlaceholdersAllowed` defines the number of `unannotated`
498
+ # style token in a format string to be allowed when enforced style is not
499
+ # `unannotated`.
500
+ MaxUnannotatedPlaceholdersAllowed: 1
501
+ VersionAdded: '0.49'
502
+ VersionChanged: '1.0'
503
+
504
+
505
+ Style/FrozenStringLiteralComment:
506
+ Description: >-
507
+ Add the frozen_string_literal comment to the top of files
508
+ to help transition to frozen string literals by default.
509
+ Enabled: false
510
+ VersionAdded: '0.36'
511
+ VersionChanged: '0.79'
512
+ EnforcedStyle: always
513
+ SupportedStyles:
514
+ # `always` will always add the frozen string literal comment to a file
515
+ # regardless of the Ruby version or if `freeze` or `<<` are called on a
516
+ # string literal. It is possible that this will create errors.
517
+ - always
518
+ # `always_true` will add the frozen string literal comment to a file,
519
+ # similarly to the `always` style, but will also change any disabled
520
+ # comments (e.g. `# frozen_string_literal: false`) to be enabled.
521
+ - always_true
522
+ # `never` will enforce that the frozen string literal comment does not
523
+ # exist in a file.
524
+ - never
525
+ SafeAutoCorrect: false
526
+
527
+
528
+ Style/IfUnlessModifier:
529
+ Description: >-
530
+ Favor modifier if/unless usage when you have a
531
+ single-line body.
532
+ StyleGuide: '#if-as-a-modifier'
533
+ Enabled: false
534
+ VersionAdded: '0.9'
535
+ VersionChanged: '0.30'
536
+
537
+ Style/MultilineMethodSignature:
538
+ Description: 'Avoid multi-line method signatures.'
539
+ Enabled: true
540
+ VersionAdded: '0.59'
541
+
542
+ Style/MutableConstant:
543
+ Description: 'Do not assign mutable objects to constants.'
544
+ Enabled: false
545
+ VersionAdded: '0.34'
546
+ VersionChanged: '0.65'
547
+ EnforcedStyle: literals
548
+ SupportedStyles:
549
+ # literals: freeze literals assigned to constants
550
+ # strict: freeze all constants
551
+ # Strict mode is considered an experimental feature. It has not been updated
552
+ # with an exhaustive list of all methods that will produce frozen objects so
553
+ # there is a decent chance of getting some false positives. Luckily, there is
554
+ # no harm in freezing an already frozen object.
555
+ - literals
556
+ - strict
557
+
558
+
559
+ Style/NegatedIf:
560
+ Description: >-
561
+ Favor unless over if for negative conditions
562
+ (or control flow or).
563
+ StyleGuide: '#unless-for-negatives'
564
+ Enabled: false
565
+ VersionAdded: '0.20'
566
+ VersionChanged: '0.48'
567
+ EnforcedStyle: both
568
+ SupportedStyles:
569
+ # both: prefix and postfix negated `if` should both use `unless`
570
+ # prefix: only use `unless` for negated `if` statements positioned before the body of the statement
571
+ # postfix: only use `unless` for negated `if` statements positioned after the body of the statement
572
+ - both
573
+ - prefix
574
+ - postfix
575
+
576
+ Style/NilComparison:
577
+ Description: 'Prefer x.nil? to x == nil.'
578
+ StyleGuide: '#predicate-methods'
579
+ Enabled: false
580
+ VersionAdded: '0.12'
581
+ VersionChanged: '0.59'
582
+ EnforcedStyle: predicate
583
+ SupportedStyles:
584
+ - predicate
585
+ - comparison
586
+
587
+ Style/NumericLiterals:
588
+ Description: >-
589
+ Add underscores to large numeric literals to improve their
590
+ readability.
591
+ StyleGuide: '#underscores-in-numerics'
592
+ Enabled: false
593
+ VersionAdded: '0.9'
594
+ VersionChanged: '0.48'
595
+ MinDigits: 5
596
+ Strict: false
597
+
598
+
599
+ Style/NumericPredicate:
600
+ Description: >-
601
+ Checks for the use of predicate- or comparison methods for
602
+ numeric comparisons.
603
+ StyleGuide: '#predicate-methods'
604
+ Safe: false
605
+ # This will change to a new method call which isn't guaranteed to be on the
606
+ # object. Switching these methods has to be done with knowledge of the types
607
+ # of the variables which rubocop doesn't have.
608
+ SafeAutoCorrect: false
609
+ Enabled: true
610
+ VersionAdded: '0.42'
611
+ VersionChanged: '0.59'
612
+ EnforcedStyle: comparison
613
+ SupportedStyles:
614
+ - predicate
615
+ - comparison
616
+ IgnoredMethods: []
617
+ # Exclude RSpec specs because assertions like `expect(1).to be > 0` cause
618
+ # false positives.
619
+ Exclude:
620
+ - 'spec/**/*'
621
+
622
+ Style/PercentLiteralDelimiters:
623
+ Description: 'Use `%`-literal delimiters consistently.'
624
+ StyleGuide: '#percent-literal-braces'
625
+ Enabled: true
626
+ VersionAdded: '0.19'
627
+ # Specify the default preferred delimiter for all types with the 'default' key
628
+ # Override individual delimiters (even with default specified) by specifying
629
+ # an individual key
630
+ PreferredDelimiters:
631
+ default: '{}'
632
+ '%i': '[]'
633
+ '%I': '[]'
634
+ '%r': '{}'
635
+ '%w': '[]'
636
+ '%W': '[]'
637
+ VersionChanged: '0.48.1'
638
+
639
+ Style/RedundantSelf:
640
+ Description: "Don't use self where it's not needed."
641
+ StyleGuide: '#no-self-unless-required'
642
+ Enabled: false
643
+ VersionAdded: '0.10'
644
+ VersionChanged: '0.13'
645
+
646
+
647
+ Style/StringLiterals:
648
+ EnforcedStyle: double_quotes
649
+
650
+ # Style/StringLiterals:
651
+ # Description: 'Checks if uses of quotes match the configured preference.'
652
+ # StyleGuide: '#consistent-string-literals'
653
+ # Enabled: true
654
+ # VersionAdded: '0.9'
655
+ # VersionChanged: '0.36'
656
+ # EnforcedStyle: single_quotes
657
+ # SupportedStyles:
658
+ # - single_quotes
659
+ # - double_quotes
660
+ # # If `true`, strings which span multiple lines using `\` for continuation must
661
+ # # use the same type of quotes on each line.
662
+ # ConsistentQuotesInMultiline: false
663
+
664
+
665
+ Style/SymbolArray:
666
+ Description: 'Use %i or %I for arrays of symbols.'
667
+ StyleGuide: '#percent-i'
668
+ Enabled: false
669
+ VersionAdded: '0.9'
670
+ VersionChanged: '0.49'
671
+ EnforcedStyle: percent
672
+ MinSize: 2
673
+ SupportedStyles:
674
+ - percent
675
+ - brackets
676
+
677
+ Style/SymbolProc:
678
+ Description: 'Use symbols as procs instead of blocks when possible.'
679
+ Enabled: false
680
+ Safe: false
681
+ VersionAdded: '0.26'
682
+ VersionChanged: '0.64'
683
+ # A list of method names to be ignored by the check.
684
+ # The names should be fairly unique, otherwise you'll end up ignoring lots of code.
685
+ IgnoredMethods:
686
+ - respond_to
687
+ - define_method
688
+
689
+ Style/TrailingCommaInArrayLiteral:
690
+ Description: 'Checks for trailing comma in array literals.'
691
+ StyleGuide: '#no-trailing-array-commas'
692
+ Enabled: true
693
+ VersionAdded: '0.53'
694
+ # If `comma`, the cop requires a comma after the last item in an array,
695
+ # but only when each item is on its own line.
696
+ # If `consistent_comma`, the cop requires a comma after the last item of all
697
+ # non-empty, multiline array literals.
698
+ EnforcedStyleForMultiline: consistent_comma
699
+ SupportedStylesForMultiline:
700
+ - comma
701
+ - consistent_comma
702
+ - no_comma
703
+
704
+ Style/TrailingCommaInHashLiteral:
705
+ Description: 'Checks for trailing comma in hash literals.'
706
+ Enabled: true
707
+ # If `comma`, the cop requires a comma after the last item in a hash,
708
+ # but only when each item is on its own line.
709
+ # If `consistent_comma`, the cop requires a comma after the last item of all
710
+ # non-empty, multiline hash literals.
711
+ EnforcedStyleForMultiline: consistent_comma
712
+ SupportedStylesForMultiline:
713
+ - comma
714
+ - consistent_comma
715
+ - no_comma
716
+ VersionAdded: '0.53'
717
+
718
+ Style/WordArray:
719
+ Description: 'Use %w or %W for arrays of words.'
720
+ StyleGuide: '#percent-w'
721
+ Enabled: true
722
+ VersionAdded: '0.9'
723
+ VersionChanged: '0.36'
724
+ EnforcedStyle: brackets
725
+ SupportedStyles:
726
+ # percent style: %w(word1 word2)
727
+ - percent
728
+ # bracket style: ['word1', 'word2']
729
+ - brackets
730
+ # The `MinSize` option causes the `WordArray` rule to be ignored for arrays
731
+ # smaller than a certain size. The rule is only applied to arrays
732
+ # whose element count is greater than or equal to `MinSize`.
733
+ MinSize: 0
734
+ # The regular expression `WordRegex` decides what is considered a word.
735
+ WordRegex: !ruby/regexp '/\A(?:\p{Word}|\p{Word}-\p{Word}|\n|\t)+\z/'
736
+
737
+ Style/GuardClause:
738
+ Description: 'Check for conditionals that can be replaced with guard clauses.'
739
+ StyleGuide: '#no-nested-conditionals'
740
+ Enabled: true
741
+ VersionAdded: '0.20'
742
+ VersionChanged: '0.22'
743
+ # `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
744
+ # needs to have to trigger this cop
745
+ MinBodyLength: 4
746
+
747
+ Lint/DuplicateBranch:
748
+ Description: Checks that there are no repeated bodies within `if/unless`, `case-when` and `rescue` constructs.
749
+ Enabled: false
750
+ VersionAdded: '1.3'
751
+
752
+ Style/PerlBackrefs:
753
+ Description: 'Avoid Perl-style regex back references.'
754
+ StyleGuide: '#no-perl-regexp-last-matchers'
755
+ Enabled: false
756
+ VersionAdded: '0.13'
757
+
758
+ Style/ZeroLengthPredicate:
759
+ Description: 'Use #empty? when testing for objects of length 0.'
760
+ Enabled: false
761
+ Safe: false
762
+ VersionAdded: '0.37'
763
+ VersionChanged: '0.39'
764
+
765
+ Style/AccessModifierDeclarations:
766
+ Description: 'Checks style of how access modifiers are used.'
767
+ Enabled: false
768
+ VersionAdded: '0.57'
769
+ VersionChanged: '0.81'
770
+ EnforcedStyle: inline
771
+ SupportedStyles:
772
+ - inline
773
+ - group
774
+ AllowModifiersOnSymbols: true
775
+ Style/MapToHash:
776
+ Enabled: false
777
+
778
+ # Style/RegexpLiteral:
779
+ # Description: 'Use / or %r around regular expressions.'
780
+ # StyleGuide: '#percent-r'
781
+ # Enabled: true
782
+ # VersionAdded: '0.9'
783
+ # VersionChanged: '0.30'
784
+ # EnforcedStyle: slashes
785
+ # # slashes: Always use slashes.
786
+ # # percent_r: Always use `%r`.
787
+ # # mixed: Use slashes on single-line regexes, and `%r` on multi-line regexes.
788
+ # SupportedStyles:
789
+ # - slashes
790
+ # - percent_r
791
+ # - mixed
792
+ # # If `false`, the cop will always recommend using `%r` if one or more slashes
793
+ # # are found in the regexp string.
794
+ # AllowInnerSlashes: false
795
+
796
+
797
+ ###### RAILS ######
798
+ ###### RAILS ######
799
+ ###### RAILS ######
800
+ ###### RAILS ######
801
+
802
+ Rails:
803
+ Enabled: true
804
+
805
+ Rails/UnknownEnv:
806
+ Environments:
807
+ - production
808
+ - development
809
+ - test
810
+
811
+ Rails/FilePath:
812
+ Enabled: false
813
+
814
+ Rails/Delegate:
815
+ Enabled: false
816
+
817
+ Rails/NegateInclude:
818
+ Enabled: false
819
+
820
+ Rails/SkipsModelValidations:
821
+ Enabled: false
822
+
823
+ # Rails/DynamicFindBy:
824
+ # Enabled: true
825
+ # SafeAutoCorrect: false
826
+
827
+ ## MINITEST
828
+
829
+ Minitest/TestMethodName:
830
+ Enabled: false
831
+
832
+ Minitest/AssertWithExpectedArgument:
833
+ Enabled: false
834
+
835
+ Minitest/MultipleAssertions:
836
+ Enabled: false
837
+
838
+ ## PERFORMANCE
839
+
840
+ Performance/CollectionLiteralInLoop:
841
+ Enabled: false
842
+
843
+ Naming/InclusiveLanguage:
844
+ Enabled: false
845
+
846
+ Rails/ReversibleMigration:
847
+ Enabled: false
848
+
849
+ # ruby 3.1 (na razie wyłączamy)
850
+
851
+ Style/HashSyntax:
852
+ EnforcedShorthandSyntax: 'either'
853
+
854
+ Naming/BlockForwarding:
855
+ Enabled: false
856
+
857
+ Minitest/AssertPredicate:
858
+ Enabled: false
859
+
860
+ # TODO: do włączenia
861
+ Rails/I18nLocaleTexts:
862
+ Enabled: false
863
+
864
+ Style/FetchEnvVar:
865
+ Enabled: false
866
+
867
+ Layout/ParameterAlignment:
868
+ EnforcedStyle: with_fixed_indentation
869
+
870
+
871
+ Style/MethodCallWithArgsParentheses:
872
+ Enabled: false
873
+ # IgnoredMethods:
874
+ # - require
875
+ # - require_relative
876
+ # - require_dependency
877
+ # - yield
878
+ # - raise
879
+ # - puts
880
+ # Exclude:
881
+ # - "/**/Gemfile"
@@ -0,0 +1,6 @@
1
+ module Rubocop
2
+ module Intum
3
+ VERSION: String
4
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,54 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubocop-intum
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Marcin
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-08-03 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Write a longer description or delete this line.
14
+ email:
15
+ - marcin@radgost.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".rubocop.yml"
21
+ - Gemfile
22
+ - Gemfile.lock
23
+ - LICENSE
24
+ - README.md
25
+ - Rakefile
26
+ - bin/console
27
+ - bin/setup
28
+ - lib/rubocop/intum.rb
29
+ - lib/rubocop/intum/version.rb
30
+ - rubocop.yml
31
+ - sig/rubocop/intum.rbs
32
+ homepage: https://github.com/intum/rubocop-intum
33
+ licenses: []
34
+ metadata: {}
35
+ post_install_message:
36
+ rdoc_options: []
37
+ require_paths:
38
+ - lib
39
+ required_ruby_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 2.6.0
44
+ required_rubygems_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ requirements: []
50
+ rubygems_version: 3.2.22
51
+ signing_key:
52
+ specification_version: 4
53
+ summary: Write a short summary, because RubyGems requires one.
54
+ test_files: []