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 +4 -4
- data/.circleci/config.yml +1 -1
- data/Gemfile.lock +2 -2
- data/config/rubocop-carwow.yml +3 -0
- data/lib/rubocop/carwow/version.rb +1 -1
- data/lib/rubocop/cop/carwow/no_abort.rb +39 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 81c9278bdc99387df9c9a136d4a6048cf21435c6a760351b7c1be3a82a0df801
|
|
4
|
+
data.tar.gz: df963ba3013bb0fb3196a57580f06af6136eb7f89eea4f5966982da2a39ea2da
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8546625ac8e9267800cd53cda4614787ebd99abc8aa446ba5e86cdde53b2dfb780523386172e1b16eb534289ed5f9d7d7287d9af6817878d0c2cecd867057275
|
|
7
|
+
data.tar.gz: bdb3822f28558aa5a062282b09f6ceadb327dfae8bce7fe3363d4124ff3f34f5977ff1f48657798b7732650edd77245236b5144e41f96f723f1a5f72d3e7d0bd
|
data/.circleci/config.yml
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
carwow_rubocop (6.
|
|
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 (
|
|
20
|
+
parallel (1.28.0)
|
|
21
21
|
parser (3.3.12.0)
|
|
22
22
|
ast (~> 2.4.1)
|
|
23
23
|
racc
|
data/config/rubocop-carwow.yml
CHANGED
|
@@ -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.
|
|
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
|