carwow_rubocop 6.11.0 → 6.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 978ba9d52dc3a0f7c586dab02666847b3e7ac2bcc62990909b4ecab964e794d8
4
- data.tar.gz: 35c9f5b58b396765fef73fa76e622ce28029843a96fc25f6f434897a9333cdcd
3
+ metadata.gz: 81c9278bdc99387df9c9a136d4a6048cf21435c6a760351b7c1be3a82a0df801
4
+ data.tar.gz: df963ba3013bb0fb3196a57580f06af6136eb7f89eea4f5966982da2a39ea2da
5
5
  SHA512:
6
- metadata.gz: 51ca0f3638fd002ef701414af166ff97f63ab65f28031e385130e3813721b534ef88e75ecb3b36988d303c040a0df710552d2e210b4b242387df97a10dae2f43
7
- data.tar.gz: d4a8e1e9941469ac1a1a3f88a803ddcf38c2f8992f1aefd14a0ffdb97ceda74af045de2717c49e196c072fbedc162779014457ac14ecd0eb8374c04f575d924e
6
+ metadata.gz: 8546625ac8e9267800cd53cda4614787ebd99abc8aa446ba5e86cdde53b2dfb780523386172e1b16eb534289ed5f9d7d7287d9af6817878d0c2cecd867057275
7
+ data.tar.gz: bdb3822f28558aa5a062282b09f6ceadb327dfae8bce7fe3363d4124ff3f34f5977ff1f48657798b7732650edd77245236b5144e41f96f723f1a5f72d3e7d0bd
data/.circleci/config.yml CHANGED
@@ -2,7 +2,7 @@ version: 2.1
2
2
 
3
3
  orbs:
4
4
  buildevents: honeycombio/buildevents@0.5
5
- carwow: carwow/carwow-orb@0.6.0
5
+ carwow: carwow/carwow-orb@0.8
6
6
 
7
7
  executors:
8
8
  ruby:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- carwow_rubocop (6.11.0)
4
+ carwow_rubocop (6.12.0)
5
5
  rubocop (>= 1.75)
6
6
  rubocop-factory_bot
7
7
  rubocop-performance
@@ -17,7 +17,7 @@ GEM
17
17
  language_server-protocol (3.17.0.6)
18
18
  lint_roller (1.1.0)
19
19
  method_source (1.1.0)
20
- parallel (2.1.0)
20
+ parallel (1.28.0)
21
21
  parser (3.3.12.0)
22
22
  ast (~> 2.4.1)
23
23
  racc
@@ -57,3 +57,6 @@ Carwow/ProductAreaRequired:
57
57
  - "app/jobs/**/*.rb"
58
58
  Exclude:
59
59
  - "**/concerns/**/*.rb"
60
+
61
+ Carwow/NoAbort:
62
+ Enabled: true
@@ -1,5 +1,5 @@
1
1
  module RuboCop
2
2
  module Carwow
3
- VERSION = '6.11.0'.freeze
3
+ VERSION = '6.12.0'.freeze
4
4
  end
5
5
  end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rubocop'
4
+
5
+ module RuboCop
6
+ module Cop
7
+ module Carwow
8
+ # Don't call `abort`. It raises `SystemExit`, which RSpec does not rescue, so when it
9
+ # escapes an example the whole process exits. Under a parallel runner the worker dies
10
+ # and its remaining spec files silently never run, while the suite reports 0 failures.
11
+ #
12
+ # @example
13
+ # # bad
14
+ # abort 'Nothing to do' if dealers.empty?
15
+ #
16
+ # # good - in a rake task
17
+ # next puts('Nothing to do') if dealers.empty?
18
+ #
19
+ # # good
20
+ # raise ArgumentError, 'Nothing to do' if dealers.empty?
21
+ #
22
+ class NoAbort < ::RuboCop::Cop::Base
23
+ MSG = "Don't use `abort`. It raises `SystemExit`, which RSpec does not rescue, so a spec that " \
24
+ 'reaches it kills the whole worker and its remaining spec files never run. Return early ' \
25
+ '(`next puts(...)` in a rake task) or raise an error instead.'
26
+
27
+ RESTRICT_ON_SEND = %i[abort].freeze
28
+
29
+ def_node_matcher :kernel_abort?, <<~PATTERN
30
+ (send {nil? (const {nil? cbase} :Kernel)} :abort ...)
31
+ PATTERN
32
+
33
+ def on_send(node)
34
+ add_offense(node) if kernel_abort?(node)
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carwow_rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.11.0
4
+ version: 6.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - carwow Developers
@@ -162,6 +162,7 @@ files:
162
162
  - lib/rubocop/cop/carwow/jobs.rb
163
163
  - lib/rubocop/cop/carwow/jobs_must_define_queue.rb
164
164
  - lib/rubocop/cop/carwow/jobs_queue_name_style.rb
165
+ - lib/rubocop/cop/carwow/no_abort.rb
165
166
  - lib/rubocop/cop/carwow/no_change_matcher_with_browser_action.rb
166
167
  - lib/rubocop/cop/carwow/no_stubbing_business_event.rb
167
168
  - lib/rubocop/cop/carwow/no_stubbing_honeycomb_extra_data.rb