rf-stylez 0.2.20 → 0.2.21

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: f947c02144438a08cc3a6ab32813f99efb017b1cb1269412fb03bf0ea36234b5
4
- data.tar.gz: 017f553fc634999dd2d6fc69f47c17276079da327994ab9b17dba2f310804e6a
3
+ metadata.gz: e338d091bd347d613853b44a4b25492669a7cbe5625253ad3ed1e9c341b9f7fe
4
+ data.tar.gz: 614773200d4e883a941ed1416bc6bfe13ba3d1961964da8d998ced9c9fd5da2d
5
5
  SHA512:
6
- metadata.gz: 4eacbfc312c59943bd8a4636192c0fe5b31695bd2365cfed6a8f0fd35b3f08186c3a8c7ee0f6b2e260228ea2feda54b792f59d52310e64623ae5935c954e5ae0
7
- data.tar.gz: 803c2bcefba0e7db0f579a22146006d95ccaa319c6f8acf920093442c505dcc7bab99620013f79a746c5b3081cb8f9802638ee85f28b2f5b0a10cde1a1df98c0
6
+ metadata.gz: ffecececbf89e8e1baaaca9cf3b12366987ca7c25ab07c6b3a029979d9edda614ddf0b1fa1f9e8a56dcd5b1007f7f0744f5b25275f47e1eb0c88386ccdb18a56
7
+ data.tar.gz: 54e46552f0eeb5d9a228cfe60dd353b6eb564d2bb1d660010124f99c5956bb3ea1ddcc9d7b4280af3e08a5ce858741a6ab9ee25c905c782a3e881d14aa6856c3
data/lib/rf/stylez.rb CHANGED
@@ -5,6 +5,7 @@ require 'rubocop/cop/lint/no_http_party'
5
5
  require 'rubocop/cop/lint/obscure'
6
6
  require 'rubocop/cop/lint/no_grape_api'
7
7
  require 'rubocop/cop/lint/use_positive_int32_validator'
8
+ require 'rubocop/cop/lint/no_untyped_raise'
8
9
 
9
10
  module Rf
10
11
  module Stylez
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Rf
3
3
  module Stylez
4
- VERSION = '0.2.20'
4
+ VERSION = '0.2.21'
5
5
  end
6
6
  end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module Lint
6
+ # @example
7
+ # # bad
8
+ # raise 'foo'
9
+ #
10
+ # # good
11
+ # raise ArgumentError, 'foo'
12
+ #
13
+ class NoUntypedRaise < Cop
14
+ MSG = 'Do not raise untyped exceptions, specify the error type so it can be rescued specifically.'
15
+
16
+ def_node_matcher :is_untyped_raise?, '(send nil? {:raise :fail} (str ...) ...)'
17
+
18
+ def on_send(node)
19
+ return unless is_untyped_raise?(node)
20
+ add_offense(node)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rf-stylez
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.20
4
+ version: 0.2.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emanuel Evans
@@ -119,6 +119,7 @@ files:
119
119
  - lib/rubocop/cop/lint/no_grape_api.rb
120
120
  - lib/rubocop/cop/lint/no_http_party.rb
121
121
  - lib/rubocop/cop/lint/no_json.rb
122
+ - lib/rubocop/cop/lint/no_untyped_raise.rb
122
123
  - lib/rubocop/cop/lint/obscure.rb
123
124
  - lib/rubocop/cop/lint/use_positive_int32_validator.rb
124
125
  - rf-stylez.gemspec