Sha256: a9233058612c9c0da9c3f8604caf1796b5798c9c3b64ba0ae612492109370f6e

Contents?: true

Size: 481 Bytes

Versions: 14

Compression:

Stored size: 481 Bytes

Contents

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 ({) must be preceded by one space'
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
scss-lint-0.20.0 lib/scss_lint/linter/space_before_brace.rb
scss-lint-0.19.0 lib/scss_lint/linter/space_before_brace.rb
scss-lint-0.18.0 lib/scss_lint/linter/space_before_brace.rb
scss-lint-0.17.3 lib/scss_lint/linter/space_before_brace.rb
scss-lint-0.17.2 lib/scss_lint/linter/space_before_brace.rb
scss-lint-0.17.1 lib/scss_lint/linter/space_before_brace.rb
scss-lint-0.17.0 lib/scss_lint/linter/space_before_brace.rb
scss-lint-0.16.1 lib/scss_lint/linter/space_before_brace.rb
scss-lint-0.16.0 lib/scss_lint/linter/space_before_brace.rb
scss-lint-0.15.0 lib/scss_lint/linter/space_before_brace.rb
scss-lint-0.14.0 lib/scss_lint/linter/space_before_brace.rb
scss-lint-0.13.0 lib/scss_lint/linter/space_before_brace.rb
scss-lint-0.12.1 lib/scss_lint/linter/space_before_brace.rb
scss-lint-0.12.0 lib/scss_lint/linter/space_before_brace.rb