gitlab-org--gitlab-foss/rubocop/qa_helpers.rb

12 lines
315 B
Ruby
Raw Normal View History

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