summaryrefslogtreecommitdiff
path: root/rubocop/ext/variable_force.rb
diff options
context:
space:
mode:
Diffstat (limited to 'rubocop/ext/variable_force.rb')
-rw-r--r--rubocop/ext/variable_force.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/rubocop/ext/variable_force.rb b/rubocop/ext/variable_force.rb
new file mode 100644
index 00000000000..def284513ed
--- /dev/null
+++ b/rubocop/ext/variable_force.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module RuboCop
+ module Ext
+ module VariableForce
+ def scanned_node?(node)
+ scanned_nodes.include?(node)
+ end
+
+ def scanned_nodes
+ @scanned_nodes ||= Set.new.compare_by_identity
+ end
+ end
+ end
+end
+
+RuboCop::Cop::VariableForce.prepend RuboCop::Ext::VariableForce