module SCSSLint
  class Linter < Sass::Tree::Visitors::Base
    include LinterRegistry
    include Utils

    attr_reader :engine, :lints

    def initialize
      @lints = []
    end

    def run(engine)
      @engine = engine
      visit(engine.tree)
    end

    def description
      nil
    end

  protected

    # Helper for creating lint from a parse tree node
    def add_lint(node)
      @lints << Lint.new(engine.filename, node.line, description)
    end

    # Monkey-patched implementation that adds support for traversing
    # Sass::Script::Nodes (original implementation only supports
    # Sass::Tree::Nodes).
    def node_name(node)
      if node.is_a?(Sass::Script::Node)
        "script_#{node.class.name.gsub(/.*::(.*?)$/, '\\1').downcase}"
      else
        super
      end
    end
  end
end

module SCSSLint
  class Linter < Sass::Tree::Visitors::Base
    include Utils

    attr_reader :engine, :lints

    def initialize
      @lints = []
    end

    def run(engine)
      @engine = engine
      visit(engine.tree)
    end

    def description
      nil
    end

  protected

    # Helper for creating lint from a parse tree node
    def add_lint(node)
      @lints << Lint.new(engine.filename, node.line, description)
    end

    # Monkey-patched implementation that adds support for traversing
    # Sass::Script::Nodes (original implementation only supports
    # Sass::Tree::Nodes).
    def node_name(node)
      if node.is_a?(Sass::Script::Node)
        "script_#{node.class.name.gsub(/.*::(.*?)$/, '\\1').downcase}"
      else
        super
      end
    end
  end
end

Remove Linter superclass from LinterRegistry
Remove Linter superclass from LinterRegistry

The superclass `Linter` was incorrectly being returned in the list of
registered linters. Remove the inclusion of the `LinterRegistry` module
to remove it.

This didn't previously have any negative effect because the `Linter`
class `run` method is effectively a no-op.

Change-Id: I1199f0b35ff16f693d3d17e99288cd93add4200b
Reviewed-on: https://gerrit.causes.com/27622
Tested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@causes.com>
Reviewed-by: Kim Douglas Clarence Mason <b21f0a9a26d2288a382e1db897c9c0db98688f4c@causes.com>
