debian-mirror-gitlab/rubocop/qa_helpers.rb

14 lines
346 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
2018-12-13 13:39:08 +05:30
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
2021-01-29 00:20:46 +05:30
path.start_with?(File.join(Dir.pwd, 'qa'))
2018-12-13 13:39:08 +05:30
end
end
end