debian-mirror-gitlab/rubocop/qa_helpers.rb
2019-07-31 17:26:46 +00:00

11 lines
329 B
Ruby

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(RuboCop::PathUtil.pwd, 'qa'))
end
end
end