summaryrefslogtreecommitdiff
path: root/rubocop/qa_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'rubocop/qa_helpers.rb')
-rw-r--r--rubocop/qa_helpers.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/rubocop/qa_helpers.rb b/rubocop/qa_helpers.rb
new file mode 100644
index 00000000000..f4adf7f4e9f
--- /dev/null
+++ b/rubocop/qa_helpers.rb
@@ -0,0 +1,11 @@
+module RuboCop
+ # Module containing helper methods for writing QA cops.
+ module QAHelpers
+ # Returns true if the given node originated from the qa/ directory.
+ def in_qa_file?(node)
+ path = node.location.expression.source_buffer.name
+
+ path.start_with?(File.join(Dir.pwd, 'qa'))
+ end
+ end
+end