Welcome to mirror list, hosted at ThFree Co, Russian Federation.

qa_helpers.rb « rubocop - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9d6396e412e6aaa2ec1294b3a8fa0b2e0a772a62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

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