rf-stylez 0.2.19 → 0.2.20

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: 758a15b97b533af6a358ceef86fa7c9714ffefdd34fd2cf2b7427bdbf30b51e8
4
- data.tar.gz: cdc44222183121bb058bc0ea180dc1c89e4fa96f00b1a8eb9e7f84d0482182fc
3
+ metadata.gz: f947c02144438a08cc3a6ab32813f99efb017b1cb1269412fb03bf0ea36234b5
4
+ data.tar.gz: 017f553fc634999dd2d6fc69f47c17276079da327994ab9b17dba2f310804e6a
5
5
  SHA512:
6
- metadata.gz: 3357f7328d7d869b07fa8d158663ac9b01dde4956d8e4ef06f7dc6cb40dd1636bda263cf7946c05e186bf9aba561bce2e3895d3be3bf3147f66c18d4decbf05d
7
- data.tar.gz: 96bbd246dff81976f388880a061ab1f68e7256afcaf5db3b77e220d238438340b4e1bff95493af3f5a7277885e193a78ca520f0b3e55eecc51782f96ab952dfd
6
+ metadata.gz: 4eacbfc312c59943bd8a4636192c0fe5b31695bd2365cfed6a8f0fd35b3f08186c3a8c7ee0f6b2e260228ea2feda54b792f59d52310e64623ae5935c954e5ae0
7
+ data.tar.gz: 803c2bcefba0e7db0f579a22146006d95ccaa319c6f8acf920093442c505dcc7bab99620013f79a746c5b3081cb8f9802638ee85f28b2f5b0a10cde1a1df98c0
@@ -0,0 +1 @@
1
+ inherit_from: ./ruby/rubocop.yml
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Rf
3
3
  module Stylez
4
- VERSION = '0.2.19'
4
+ VERSION = '0.2.20'
5
5
  end
6
6
  end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module Lint
6
+ # @example
7
+ # # bad - will define `!`-ended method that won't raise
8
+ # state_machine :state do
9
+ # event :started! do
10
+ # ...
11
+ # end
12
+ # end
13
+ #
14
+ # # good
15
+ # state_machine :state do
16
+ # event :started do
17
+ # ...
18
+ # end
19
+ # end
20
+ class NoBangStateMachineEvents < Cop
21
+ MSG = 'Event names ending with a `!` define `!`-ended methods that do not raise'
22
+
23
+ def_node_matcher :is_state_machine_event?, '(send nil? :event (sym $_))'
24
+ def_node_matcher :is_state_machine?, '(block (send nil? :state_machine ...) ...)'
25
+
26
+ def on_send(node)
27
+ return unless (event_name = is_state_machine_event?(node))
28
+ return unless is_state_machine?(node.parent.parent)
29
+ return unless event_name.match?(/\w+!$/)
30
+
31
+ add_offense(node)
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rf-stylez
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.19
4
+ version: 0.2.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emanuel Evans
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-31 00:00:00.000000000 Z
11
+ date: 2019-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -104,6 +104,7 @@ files:
104
104
  - ".circleci/config.yml"
105
105
  - ".gitignore"
106
106
  - ".rspec"
107
+ - ".rubocop.yml"
107
108
  - ".travis.yml"
108
109
  - Gemfile
109
110
  - LICENSE
@@ -113,6 +114,7 @@ files:
113
114
  - bin/setup
114
115
  - lib/rf/stylez.rb
115
116
  - lib/rf/stylez/version.rb
117
+ - lib/rubocop/cop/lint/no_bang_state_machine_events.rb
116
118
  - lib/rubocop/cop/lint/no_env.rb
117
119
  - lib/rubocop/cop/lint/no_grape_api.rb
118
120
  - lib/rubocop/cop/lint/no_http_party.rb