Sha256: a072ea37e01a119ccc224f1a08a8ac4068d6e984ff0cb70cbb38a838ae03ef42

Contents?: true

Size: 576 Bytes

Versions: 7

Compression:

Stored size: 576 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Rake
      module Helper
        module TaskDefinition
          extend NodePattern::Macros
          extend self

          def_node_matcher :task_or_namespace?, <<-PATTERN
            (block
              (send _ {:task :namespace} ...)
              args
              _
            )
          PATTERN

          def in_task_or_namespace?(node)
            node.each_ancestor(:block).any? do |a|
              task_or_namespace?(a)
            end
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/rubocop-rake-0.6.0/lib/rubocop/cop/rake/helper/task_definition.rb
rubocop-rake-0.6.0 lib/rubocop/cop/rake/helper/task_definition.rb
rubocop-rake-0.5.1 lib/rubocop/cop/rake/helper/task_definition.rb
rubocop-rake-0.5.0 lib/rubocop/cop/rake/helper/task_definition.rb
rubocop-rake-0.4.0 lib/rubocop/cop/rake/helper/task_definition.rb
rubocop-rake-0.3.1 lib/rubocop/cop/rake/helper/task_definition.rb
rubocop-rake-0.3.0 lib/rubocop/cop/rake/helper/task_definition.rb