module SCSSLint
  # Checks for the presence of a single space before an opening brace.
  class Linter::SpaceBeforeBrace < Linter
    include LinterRegistry

    def visit_root(node)
      engine.lines.each_with_index do |line, index|
        line.scan /[^"#](?<![^ ] )\{/ do |match|
          @lints << Lint.new(engine.filename, index + 1, description)
        end
      end
    end

    def description
      'Opening curly braces ({) should be preceded by one space'
    end
  end
end

module SCSSLint
  # Checks for the presence of a single space before an opening brace.
  class Linter::SpaceBeforeBrace < Linter
    include LinterRegistry

    def visit_root(node)
      engine.lines.each_with_index do |line, index|
        line.scan /[^"#](?<![^ ] )\{/ do |match|
          add_lint(index + 1, 'Opening curly braces ({) should be preceded by one space')
        end
      end
    end
  end
end

Remove description method from SpaceBeforeBrace
Remove description method from SpaceBeforeBrace

The `description` method is being deprecated.

While here, also changed from appending to the `@lints` instance
variable directly to using the `add_lint` helper.

Change-Id: If2902858e2cd29c06759294c4d6357690aec6017
Reviewed-on: http://gerrit.causes.com/36725
Tested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@causes.com>
Reviewed-by: Shane da Silva <6f6e68d1df92f30cb4b3ce35260ddf94a402f33d@causes.com>
