slim_lint_standard 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
 - data/LICENSE.md +21 -0
 - data/bin/slim-lint-standard +7 -0
 - data/config/default.yml +109 -0
 - data/lib/slim_lint/atom.rb +129 -0
 - data/lib/slim_lint/capture_map.rb +19 -0
 - data/lib/slim_lint/cli.rb +167 -0
 - data/lib/slim_lint/configuration.rb +111 -0
 - data/lib/slim_lint/configuration_loader.rb +86 -0
 - data/lib/slim_lint/constants.rb +10 -0
 - data/lib/slim_lint/document.rb +78 -0
 - data/lib/slim_lint/engine.rb +41 -0
 - data/lib/slim_lint/exceptions.rb +20 -0
 - data/lib/slim_lint/file_finder.rb +88 -0
 - data/lib/slim_lint/filter.rb +126 -0
 - data/lib/slim_lint/filters/attribute_processor.rb +46 -0
 - data/lib/slim_lint/filters/auto_indenter.rb +39 -0
 - data/lib/slim_lint/filters/control_processor.rb +46 -0
 - data/lib/slim_lint/filters/do_inserter.rb +39 -0
 - data/lib/slim_lint/filters/end_inserter.rb +74 -0
 - data/lib/slim_lint/filters/interpolation.rb +73 -0
 - data/lib/slim_lint/filters/multi_flattener.rb +32 -0
 - data/lib/slim_lint/filters/splat_processor.rb +20 -0
 - data/lib/slim_lint/filters/static_merger.rb +47 -0
 - data/lib/slim_lint/lint.rb +70 -0
 - data/lib/slim_lint/linter/avoid_multiline_expressions.rb +41 -0
 - data/lib/slim_lint/linter/comment_control_statement.rb +26 -0
 - data/lib/slim_lint/linter/consecutive_control_statements.rb +26 -0
 - data/lib/slim_lint/linter/control_statement_spacing.rb +32 -0
 - data/lib/slim_lint/linter/dynamic_output_spacing.rb +77 -0
 - data/lib/slim_lint/linter/embedded_engines.rb +18 -0
 - data/lib/slim_lint/linter/empty_control_statement.rb +15 -0
 - data/lib/slim_lint/linter/empty_lines.rb +24 -0
 - data/lib/slim_lint/linter/file_length.rb +18 -0
 - data/lib/slim_lint/linter/line_length.rb +18 -0
 - data/lib/slim_lint/linter/redundant_div.rb +21 -0
 - data/lib/slim_lint/linter/rubocop.rb +131 -0
 - data/lib/slim_lint/linter/standard.rb +69 -0
 - data/lib/slim_lint/linter/tab.rb +20 -0
 - data/lib/slim_lint/linter/tag_case.rb +15 -0
 - data/lib/slim_lint/linter/trailing_blank_lines.rb +19 -0
 - data/lib/slim_lint/linter/trailing_whitespace.rb +17 -0
 - data/lib/slim_lint/linter.rb +93 -0
 - data/lib/slim_lint/linter_registry.rb +37 -0
 - data/lib/slim_lint/linter_selector.rb +87 -0
 - data/lib/slim_lint/logger.rb +103 -0
 - data/lib/slim_lint/matcher/anything.rb +11 -0
 - data/lib/slim_lint/matcher/base.rb +21 -0
 - data/lib/slim_lint/matcher/capture.rb +32 -0
 - data/lib/slim_lint/matcher/nothing.rb +13 -0
 - data/lib/slim_lint/options.rb +110 -0
 - data/lib/slim_lint/parser.rb +584 -0
 - data/lib/slim_lint/rake_task.rb +125 -0
 - data/lib/slim_lint/report.rb +25 -0
 - data/lib/slim_lint/reporter/checkstyle_reporter.rb +42 -0
 - data/lib/slim_lint/reporter/default_reporter.rb +40 -0
 - data/lib/slim_lint/reporter/emacs_reporter.rb +40 -0
 - data/lib/slim_lint/reporter/json_reporter.rb +50 -0
 - data/lib/slim_lint/reporter.rb +44 -0
 - data/lib/slim_lint/ruby_extract_engine.rb +30 -0
 - data/lib/slim_lint/ruby_extractor.rb +175 -0
 - data/lib/slim_lint/ruby_parser.rb +32 -0
 - data/lib/slim_lint/runner.rb +82 -0
 - data/lib/slim_lint/sexp.rb +134 -0
 - data/lib/slim_lint/sexp_visitor.rb +150 -0
 - data/lib/slim_lint/source_location.rb +45 -0
 - data/lib/slim_lint/utils.rb +84 -0
 - data/lib/slim_lint/version.rb +6 -0
 - data/lib/slim_lint.rb +55 -0
 - metadata +218 -0
 
| 
         @@ -0,0 +1,150 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module SlimLint
         
     | 
| 
      
 4 
     | 
    
         
            +
              # Provides an interface which when included allows a class to visit nodes in
         
     | 
| 
      
 5 
     | 
    
         
            +
              # the Sexp of a Slim document.
         
     | 
| 
      
 6 
     | 
    
         
            +
              module SexpVisitor
         
     | 
| 
      
 7 
     | 
    
         
            +
                # Traverse the Sexp looking for matches with registered patterns, firing
         
     | 
| 
      
 8 
     | 
    
         
            +
                # callbacks for all matches.
         
     | 
| 
      
 9 
     | 
    
         
            +
                #
         
     | 
| 
      
 10 
     | 
    
         
            +
                # @param sexp [SlimLint::Sexp]
         
     | 
| 
      
 11 
     | 
    
         
            +
                def trigger_pattern_callbacks(sexp)
         
     | 
| 
      
 12 
     | 
    
         
            +
                  return if on_start(sexp) == :stop
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                  traverse sexp
         
     | 
| 
      
 15 
     | 
    
         
            +
                end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                # Traverse the given Sexp, firing callbacks if they are defined.
         
     | 
| 
      
 18 
     | 
    
         
            +
                #
         
     | 
| 
      
 19 
     | 
    
         
            +
                # @param sexp [SlimLint::Sexp]
         
     | 
| 
      
 20 
     | 
    
         
            +
                def traverse(sexp)
         
     | 
| 
      
 21 
     | 
    
         
            +
                  patterns.each do |pattern|
         
     | 
| 
      
 22 
     | 
    
         
            +
                    next unless sexp.match?(pattern.sexp)
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                    result = method(pattern.callback_method_name).call(sexp)
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                    # Returning :stop indicates we should stop searching this Sexp
         
     | 
| 
      
 27 
     | 
    
         
            +
                    # (i.e. stop descending this branch of depth-first search).
         
     | 
| 
      
 28 
     | 
    
         
            +
                    # The `return` here is very intentional.
         
     | 
| 
      
 29 
     | 
    
         
            +
                    return if result == :stop # rubocop:disable Lint/NonLocalExitFromIterator
         
     | 
| 
      
 30 
     | 
    
         
            +
                  end
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                  # Continue traversing children by default (match blocks can return `:stop`
         
     | 
| 
      
 33 
     | 
    
         
            +
                  # to not continue).
         
     | 
| 
      
 34 
     | 
    
         
            +
                  traverse_children(sexp)
         
     | 
| 
      
 35 
     | 
    
         
            +
                end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
                # Traverse the children of this {Sexp}.
         
     | 
| 
      
 38 
     | 
    
         
            +
                #
         
     | 
| 
      
 39 
     | 
    
         
            +
                # @param sexp [SlimLint::Sexp]
         
     | 
| 
      
 40 
     | 
    
         
            +
                def traverse_children(sexp)
         
     | 
| 
      
 41 
     | 
    
         
            +
                  sexp.each do |nested_sexp|
         
     | 
| 
      
 42 
     | 
    
         
            +
                    traverse nested_sexp if nested_sexp.is_a?(Sexp)
         
     | 
| 
      
 43 
     | 
    
         
            +
                  end
         
     | 
| 
      
 44 
     | 
    
         
            +
                end
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
                # Returns the map of capture names to captured values.
         
     | 
| 
      
 47 
     | 
    
         
            +
                #
         
     | 
| 
      
 48 
     | 
    
         
            +
                # @return [Hash, CaptureMap]
         
     | 
| 
      
 49 
     | 
    
         
            +
                def captures
         
     | 
| 
      
 50 
     | 
    
         
            +
                  self.class.captures || {}
         
     | 
| 
      
 51 
     | 
    
         
            +
                end
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
                # Returns the list of registered Sexp patterns.
         
     | 
| 
      
 54 
     | 
    
         
            +
                #
         
     | 
| 
      
 55 
     | 
    
         
            +
                # @return [Array<SlimLint::SexpVisitor::SexpPattern>]
         
     | 
| 
      
 56 
     | 
    
         
            +
                def patterns
         
     | 
| 
      
 57 
     | 
    
         
            +
                  self.class.patterns || []
         
     | 
| 
      
 58 
     | 
    
         
            +
                end
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
                # Executed before searching for any pattern matches.
         
     | 
| 
      
 61 
     | 
    
         
            +
                #
         
     | 
| 
      
 62 
     | 
    
         
            +
                # @param sexp [SlimLint::Sexp] see {SexpVisitor::DSL.on_start}
         
     | 
| 
      
 63 
     | 
    
         
            +
                # @return [Symbol] see {SexpVisitor::DSL.on_start}
         
     | 
| 
      
 64 
     | 
    
         
            +
                def on_start(*)
         
     | 
| 
      
 65 
     | 
    
         
            +
                  # Overidden by DSL.on_start
         
     | 
| 
      
 66 
     | 
    
         
            +
                end
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
                # Mapping of Sexp pattern to callback method name.
         
     | 
| 
      
 69 
     | 
    
         
            +
                #
         
     | 
| 
      
 70 
     | 
    
         
            +
                # @attr_reader sexp [Array] S-expression pattern that when matched triggers the
         
     | 
| 
      
 71 
     | 
    
         
            +
                #     callback
         
     | 
| 
      
 72 
     | 
    
         
            +
                # @attr_reader callback_method_name [Symbol] name of the method to call when pattern is matched
         
     | 
| 
      
 73 
     | 
    
         
            +
                SexpPattern = Struct.new(:sexp, :callback_method_name) do
         
     | 
| 
      
 74 
     | 
    
         
            +
                  def match?(expr)
         
     | 
| 
      
 75 
     | 
    
         
            +
                    expr.match?(sexp)
         
     | 
| 
      
 76 
     | 
    
         
            +
                  end
         
     | 
| 
      
 77 
     | 
    
         
            +
                end
         
     | 
| 
      
 78 
     | 
    
         
            +
                private_constant :SexpPattern
         
     | 
| 
      
 79 
     | 
    
         
            +
             
     | 
| 
      
 80 
     | 
    
         
            +
                # Exposes a convenient Domain-specific Language (DSL) that makes declaring
         
     | 
| 
      
 81 
     | 
    
         
            +
                # Sexp match patterns very easy.
         
     | 
| 
      
 82 
     | 
    
         
            +
                #
         
     | 
| 
      
 83 
     | 
    
         
            +
                # Include them with `extend SlimLint::SexpVisitor::DSL`
         
     | 
| 
      
 84 
     | 
    
         
            +
                module DSL
         
     | 
| 
      
 85 
     | 
    
         
            +
                  # Registered patterns that this visitor will look for when traversing the
         
     | 
| 
      
 86 
     | 
    
         
            +
                  # {SlimLint::Sexp}.
         
     | 
| 
      
 87 
     | 
    
         
            +
                  attr_reader :patterns
         
     | 
| 
      
 88 
     | 
    
         
            +
             
     | 
| 
      
 89 
     | 
    
         
            +
                  # @return [Hash] map of capture names to captured values
         
     | 
| 
      
 90 
     | 
    
         
            +
                  attr_reader :captures
         
     | 
| 
      
 91 
     | 
    
         
            +
             
     | 
| 
      
 92 
     | 
    
         
            +
                  # DSL helper that defines a sexp pattern and block that will be executed if
         
     | 
| 
      
 93 
     | 
    
         
            +
                  # the given pattern is found.
         
     | 
| 
      
 94 
     | 
    
         
            +
                  #
         
     | 
| 
      
 95 
     | 
    
         
            +
                  # @param sexp_pattern [Sexp]
         
     | 
| 
      
 96 
     | 
    
         
            +
                  # @yield block to execute when the specified pattern is matched
         
     | 
| 
      
 97 
     | 
    
         
            +
                  # @yieldparam sexp [SlimLint::Sexp] Sexp that matched the pattern
         
     | 
| 
      
 98 
     | 
    
         
            +
                  # @yieldreturn [SlimLint::Sexp,Symbol,void]
         
     | 
| 
      
 99 
     | 
    
         
            +
                  #   If a Sexp is returned, indicates that traversal should jump directly
         
     | 
| 
      
 100 
     | 
    
         
            +
                  #   to that Sexp.
         
     | 
| 
      
 101 
     | 
    
         
            +
                  #   If `:stop` is returned, halts further traversal down this branch
         
     | 
| 
      
 102 
     | 
    
         
            +
                  #   (i.e. stops recursing, but traversal at higher levels will continue).
         
     | 
| 
      
 103 
     | 
    
         
            +
                  #   Otherwise traversal will continue as normal.
         
     | 
| 
      
 104 
     | 
    
         
            +
                  def on(sexp_pattern, &block)
         
     | 
| 
      
 105 
     | 
    
         
            +
                    # TODO: Index Sexps on creation so we can quickly jump to potential
         
     | 
| 
      
 106 
     | 
    
         
            +
                    # matches instead of checking array.
         
     | 
| 
      
 107 
     | 
    
         
            +
                    @patterns ||= []
         
     | 
| 
      
 108 
     | 
    
         
            +
                    @pattern_number ||= 1
         
     | 
| 
      
 109 
     | 
    
         
            +
             
     | 
| 
      
 110 
     | 
    
         
            +
                    # Use a monotonically increasing number to identify the method so that in
         
     | 
| 
      
 111 
     | 
    
         
            +
                    # debugging we can simply look at the nth defintion in the class.
         
     | 
| 
      
 112 
     | 
    
         
            +
                    unique_method_name = :"on_pattern_#{@pattern_number}"
         
     | 
| 
      
 113 
     | 
    
         
            +
                    define_method(unique_method_name, block)
         
     | 
| 
      
 114 
     | 
    
         
            +
             
     | 
| 
      
 115 
     | 
    
         
            +
                    @pattern_number += 1
         
     | 
| 
      
 116 
     | 
    
         
            +
                    @patterns << SexpPattern.new(sexp_pattern, unique_method_name)
         
     | 
| 
      
 117 
     | 
    
         
            +
                  end
         
     | 
| 
      
 118 
     | 
    
         
            +
             
     | 
| 
      
 119 
     | 
    
         
            +
                  # Define a block of code to run before checking for any pattern matches.
         
     | 
| 
      
 120 
     | 
    
         
            +
                  #
         
     | 
| 
      
 121 
     | 
    
         
            +
                  # @yield block to execute
         
     | 
| 
      
 122 
     | 
    
         
            +
                  # @yieldparam sexp [SlimLint::Sexp] the root Sexp
         
     | 
| 
      
 123 
     | 
    
         
            +
                  # @yieldreturn [Symbol] if `:stop`, indicates that no further processing
         
     | 
| 
      
 124 
     | 
    
         
            +
                  #   should occur
         
     | 
| 
      
 125 
     | 
    
         
            +
                  def on_start(&block)
         
     | 
| 
      
 126 
     | 
    
         
            +
                    define_method(:on_start, block)
         
     | 
| 
      
 127 
     | 
    
         
            +
                  end
         
     | 
| 
      
 128 
     | 
    
         
            +
             
     | 
| 
      
 129 
     | 
    
         
            +
                  # Represents a pattern that matches anything.
         
     | 
| 
      
 130 
     | 
    
         
            +
                  #
         
     | 
| 
      
 131 
     | 
    
         
            +
                  # @return [SlimLint::Matcher::Anything]
         
     | 
| 
      
 132 
     | 
    
         
            +
                  def anything
         
     | 
| 
      
 133 
     | 
    
         
            +
                    SlimLint::Matcher::Anything.new
         
     | 
| 
      
 134 
     | 
    
         
            +
                  end
         
     | 
| 
      
 135 
     | 
    
         
            +
             
     | 
| 
      
 136 
     | 
    
         
            +
                  # Represents a pattern that matches the specified matcher, storing the
         
     | 
| 
      
 137 
     | 
    
         
            +
                  # matched value in the captures list under the given name.
         
     | 
| 
      
 138 
     | 
    
         
            +
                  #
         
     | 
| 
      
 139 
     | 
    
         
            +
                  # @param capture_name [Symbol]
         
     | 
| 
      
 140 
     | 
    
         
            +
                  # @param matcher [Array, SlimLint::Matcher::Base]
         
     | 
| 
      
 141 
     | 
    
         
            +
                  # @return [SlimLint::Matcher::Capture]
         
     | 
| 
      
 142 
     | 
    
         
            +
                  def capture(capture_name, matcher)
         
     | 
| 
      
 143 
     | 
    
         
            +
                    @captures ||= SlimLint::CaptureMap.new
         
     | 
| 
      
 144 
     | 
    
         
            +
             
     | 
| 
      
 145 
     | 
    
         
            +
                    matcher = SexpPattern.new(matcher, nil) unless matcher.respond_to?(:match?)
         
     | 
| 
      
 146 
     | 
    
         
            +
                    @captures[capture_name] = SlimLint::Matcher::Capture.from_matcher(matcher)
         
     | 
| 
      
 147 
     | 
    
         
            +
                  end
         
     | 
| 
      
 148 
     | 
    
         
            +
                end
         
     | 
| 
      
 149 
     | 
    
         
            +
              end
         
     | 
| 
      
 150 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,45 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module SlimLint
         
     | 
| 
      
 2 
     | 
    
         
            +
              class SourceLocation
         
     | 
| 
      
 3 
     | 
    
         
            +
                attr_accessor :start_line, :start_column, :last_line, :last_column, :line, :column, :length
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
                def self.merge(start, finish, length:)
         
     | 
| 
      
 6 
     | 
    
         
            +
                  new(
         
     | 
| 
      
 7 
     | 
    
         
            +
                    start_line: start.start_line,
         
     | 
| 
      
 8 
     | 
    
         
            +
                    start_column: start.start_column,
         
     | 
| 
      
 9 
     | 
    
         
            +
                    last_line: finish.start_line,
         
     | 
| 
      
 10 
     | 
    
         
            +
                    last_column: finish.start_column,
         
     | 
| 
      
 11 
     | 
    
         
            +
                    length: length
         
     | 
| 
      
 12 
     | 
    
         
            +
                  )
         
     | 
| 
      
 13 
     | 
    
         
            +
                end
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                def initialize(start_line: nil, start_column: nil, last_line: nil, last_column: nil, length: nil)
         
     | 
| 
      
 16 
     | 
    
         
            +
                  @start_line = @line = start_line
         
     | 
| 
      
 17 
     | 
    
         
            +
                  @start_column = @column = start_column
         
     | 
| 
      
 18 
     | 
    
         
            +
                  @last_line = last_line || @start_line
         
     | 
| 
      
 19 
     | 
    
         
            +
                  @last_column = last_column || @start_column
         
     | 
| 
      
 20 
     | 
    
         
            +
                  @length = length || (start_line == last_line ? last_column - start_column : nil)
         
     | 
| 
      
 21 
     | 
    
         
            +
                end
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                def as_json
         
     | 
| 
      
 24 
     | 
    
         
            +
                  {
         
     | 
| 
      
 25 
     | 
    
         
            +
                    line: line,
         
     | 
| 
      
 26 
     | 
    
         
            +
                    column: column,
         
     | 
| 
      
 27 
     | 
    
         
            +
                    length: length,
         
     | 
| 
      
 28 
     | 
    
         
            +
                    start_line: start_line,
         
     | 
| 
      
 29 
     | 
    
         
            +
                    start_column: start_column,
         
     | 
| 
      
 30 
     | 
    
         
            +
                    last_line: last_line,
         
     | 
| 
      
 31 
     | 
    
         
            +
                    last_column: last_column
         
     | 
| 
      
 32 
     | 
    
         
            +
                  }.compact
         
     | 
| 
      
 33 
     | 
    
         
            +
                end
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                def adjust(line: 0, column: 0)
         
     | 
| 
      
 36 
     | 
    
         
            +
                  self.class.new(
         
     | 
| 
      
 37 
     | 
    
         
            +
                    length: @length,
         
     | 
| 
      
 38 
     | 
    
         
            +
                    start_line: @start_line + line,
         
     | 
| 
      
 39 
     | 
    
         
            +
                    start_column: @start_column + column,
         
     | 
| 
      
 40 
     | 
    
         
            +
                    last_line: @last_line + line,
         
     | 
| 
      
 41 
     | 
    
         
            +
                    last_column: @last_column + column
         
     | 
| 
      
 42 
     | 
    
         
            +
                  )
         
     | 
| 
      
 43 
     | 
    
         
            +
                end
         
     | 
| 
      
 44 
     | 
    
         
            +
              end
         
     | 
| 
      
 45 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,84 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module SlimLint
         
     | 
| 
      
 4 
     | 
    
         
            +
              # Miscellaneus collection of helper functions.
         
     | 
| 
      
 5 
     | 
    
         
            +
              module Utils
         
     | 
| 
      
 6 
     | 
    
         
            +
                module_function
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
                # Returns whether a glob pattern (or any of a list of patterns) matches the
         
     | 
| 
      
 9 
     | 
    
         
            +
                # specified file.
         
     | 
| 
      
 10 
     | 
    
         
            +
                #
         
     | 
| 
      
 11 
     | 
    
         
            +
                # This is defined here so our file globbing options are consistent
         
     | 
| 
      
 12 
     | 
    
         
            +
                # everywhere we perform globbing.
         
     | 
| 
      
 13 
     | 
    
         
            +
                #
         
     | 
| 
      
 14 
     | 
    
         
            +
                # @param glob [String, Array]
         
     | 
| 
      
 15 
     | 
    
         
            +
                # @param file [String]
         
     | 
| 
      
 16 
     | 
    
         
            +
                # @return [Boolean]
         
     | 
| 
      
 17 
     | 
    
         
            +
                def any_glob_matches?(globs_or_glob, file)
         
     | 
| 
      
 18 
     | 
    
         
            +
                  path = File.expand_path(file)
         
     | 
| 
      
 19 
     | 
    
         
            +
                  flags = File::FNM_PATHNAME | File::FNM_DOTMATCH
         
     | 
| 
      
 20 
     | 
    
         
            +
                  Array(globs_or_glob).any? do |glob|
         
     | 
| 
      
 21 
     | 
    
         
            +
                    File.fnmatch?(File.expand_path(glob), path, flags)
         
     | 
| 
      
 22 
     | 
    
         
            +
                  end
         
     | 
| 
      
 23 
     | 
    
         
            +
                end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
                # Find all consecutive items satisfying the given block of a minimum size,
         
     | 
| 
      
 26 
     | 
    
         
            +
                # yielding each group of consecutive items to the provided block.
         
     | 
| 
      
 27 
     | 
    
         
            +
                #
         
     | 
| 
      
 28 
     | 
    
         
            +
                # @param items [Array]
         
     | 
| 
      
 29 
     | 
    
         
            +
                # @param satisfies [Proc] function that takes an item and returns true/false
         
     | 
| 
      
 30 
     | 
    
         
            +
                # @param min_consecutive [Fixnum] minimum number of consecutive items before
         
     | 
| 
      
 31 
     | 
    
         
            +
                #   yielding the group
         
     | 
| 
      
 32 
     | 
    
         
            +
                # @yield Passes list of consecutive items all matching the criteria defined
         
     | 
| 
      
 33 
     | 
    
         
            +
                #   by the `satisfies` {Proc} to the provided block
         
     | 
| 
      
 34 
     | 
    
         
            +
                # @yieldparam group [Array] List of consecutive items
         
     | 
| 
      
 35 
     | 
    
         
            +
                # @yieldreturn [Boolean] block should return whether item matches criteria
         
     | 
| 
      
 36 
     | 
    
         
            +
                #   for inclusion
         
     | 
| 
      
 37 
     | 
    
         
            +
                def for_consecutive_items(items, satisfies, min_consecutive = 2)
         
     | 
| 
      
 38 
     | 
    
         
            +
                  current_index = -1
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                  while (current_index += 1) < items.count
         
     | 
| 
      
 41 
     | 
    
         
            +
                    next unless satisfies[items[current_index]]
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
                    count = count_consecutive(items, current_index, &satisfies)
         
     | 
| 
      
 44 
     | 
    
         
            +
                    next unless count >= min_consecutive
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
                    # Yield the chunk of consecutive items
         
     | 
| 
      
 47 
     | 
    
         
            +
                    yield items[current_index...(current_index + count)]
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
                    current_index += count # Skip this patch of consecutive items to find more
         
     | 
| 
      
 50 
     | 
    
         
            +
                  end
         
     | 
| 
      
 51 
     | 
    
         
            +
                end
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
                # Count the number of consecutive items satisfying the given {Proc}.
         
     | 
| 
      
 54 
     | 
    
         
            +
                #
         
     | 
| 
      
 55 
     | 
    
         
            +
                # @param items [Array]
         
     | 
| 
      
 56 
     | 
    
         
            +
                # @param offset [Fixnum] index to start searching from
         
     | 
| 
      
 57 
     | 
    
         
            +
                # @yield [item] Passes item to the provided block.
         
     | 
| 
      
 58 
     | 
    
         
            +
                # @yieldparam item [Object] Item to evaluate as matching criteria for
         
     | 
| 
      
 59 
     | 
    
         
            +
                #   inclusion
         
     | 
| 
      
 60 
     | 
    
         
            +
                # @yieldreturn [Boolean] whether to include the item
         
     | 
| 
      
 61 
     | 
    
         
            +
                # @return [Integer]
         
     | 
| 
      
 62 
     | 
    
         
            +
                def count_consecutive(items, offset = 0)
         
     | 
| 
      
 63 
     | 
    
         
            +
                  count = 1
         
     | 
| 
      
 64 
     | 
    
         
            +
                  count += 1 while (offset + count < items.count) && yield(items[offset + count])
         
     | 
| 
      
 65 
     | 
    
         
            +
                  count
         
     | 
| 
      
 66 
     | 
    
         
            +
                end
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
                # Calls a block of code with a modified set of environment variables,
         
     | 
| 
      
 69 
     | 
    
         
            +
                # restoring them once the code has executed.
         
     | 
| 
      
 70 
     | 
    
         
            +
                #
         
     | 
| 
      
 71 
     | 
    
         
            +
                # @param env [Hash] environment variables to set
         
     | 
| 
      
 72 
     | 
    
         
            +
                def with_environment(env)
         
     | 
| 
      
 73 
     | 
    
         
            +
                  old_env = {}
         
     | 
| 
      
 74 
     | 
    
         
            +
                  env.each do |var, value|
         
     | 
| 
      
 75 
     | 
    
         
            +
                    old_env[var] = ENV[var.to_s]
         
     | 
| 
      
 76 
     | 
    
         
            +
                    ENV[var.to_s] = value
         
     | 
| 
      
 77 
     | 
    
         
            +
                  end
         
     | 
| 
      
 78 
     | 
    
         
            +
             
     | 
| 
      
 79 
     | 
    
         
            +
                  yield
         
     | 
| 
      
 80 
     | 
    
         
            +
                ensure
         
     | 
| 
      
 81 
     | 
    
         
            +
                  old_env.each { |var, value| ENV[var.to_s] = value }
         
     | 
| 
      
 82 
     | 
    
         
            +
                end
         
     | 
| 
      
 83 
     | 
    
         
            +
              end
         
     | 
| 
      
 84 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/slim_lint.rb
    ADDED
    
    | 
         @@ -0,0 +1,55 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            # Load all slim-lint-standard modules necessary to parse and lint a file.
         
     | 
| 
      
 4 
     | 
    
         
            +
            # Ordering here can be important depending on class references in each module.
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            # Need to load slim before we can reference some classes or define filters
         
     | 
| 
      
 7 
     | 
    
         
            +
            require "slim"
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            require "slim_lint/constants"
         
     | 
| 
      
 10 
     | 
    
         
            +
            require "slim_lint/exceptions"
         
     | 
| 
      
 11 
     | 
    
         
            +
            require "slim_lint/configuration"
         
     | 
| 
      
 12 
     | 
    
         
            +
            require "slim_lint/configuration_loader"
         
     | 
| 
      
 13 
     | 
    
         
            +
            require "slim_lint/utils"
         
     | 
| 
      
 14 
     | 
    
         
            +
            require "slim_lint/atom"
         
     | 
| 
      
 15 
     | 
    
         
            +
            require "slim_lint/sexp"
         
     | 
| 
      
 16 
     | 
    
         
            +
            require "slim_lint/file_finder"
         
     | 
| 
      
 17 
     | 
    
         
            +
            require "slim_lint/linter_registry"
         
     | 
| 
      
 18 
     | 
    
         
            +
            require "slim_lint/logger"
         
     | 
| 
      
 19 
     | 
    
         
            +
            require "slim_lint/version"
         
     | 
| 
      
 20 
     | 
    
         
            +
            require "slim_lint/filter"
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
            # Load all filters (required by SlimLint::Engine)
         
     | 
| 
      
 23 
     | 
    
         
            +
            Dir[File.expand_path("slim_lint/filters/*.rb", File.dirname(__FILE__))].sort.each do |file|
         
     | 
| 
      
 24 
     | 
    
         
            +
              require file
         
     | 
| 
      
 25 
     | 
    
         
            +
            end
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            require "slim_lint/parser"
         
     | 
| 
      
 28 
     | 
    
         
            +
            require "slim_lint/engine"
         
     | 
| 
      
 29 
     | 
    
         
            +
            require "slim_lint/document"
         
     | 
| 
      
 30 
     | 
    
         
            +
            require "slim_lint/capture_map"
         
     | 
| 
      
 31 
     | 
    
         
            +
            require "slim_lint/sexp_visitor"
         
     | 
| 
      
 32 
     | 
    
         
            +
            require "slim_lint/source_location"
         
     | 
| 
      
 33 
     | 
    
         
            +
            require "slim_lint/lint"
         
     | 
| 
      
 34 
     | 
    
         
            +
            require "slim_lint/ruby_parser"
         
     | 
| 
      
 35 
     | 
    
         
            +
            require "slim_lint/linter"
         
     | 
| 
      
 36 
     | 
    
         
            +
            require "slim_lint/reporter"
         
     | 
| 
      
 37 
     | 
    
         
            +
            require "slim_lint/report"
         
     | 
| 
      
 38 
     | 
    
         
            +
            require "slim_lint/linter_selector"
         
     | 
| 
      
 39 
     | 
    
         
            +
            require "slim_lint/runner"
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
            # Load all matchers
         
     | 
| 
      
 42 
     | 
    
         
            +
            require "slim_lint/matcher/base"
         
     | 
| 
      
 43 
     | 
    
         
            +
            Dir[File.expand_path("slim_lint/matcher/*.rb", File.dirname(__FILE__))].sort.each do |file|
         
     | 
| 
      
 44 
     | 
    
         
            +
              require file
         
     | 
| 
      
 45 
     | 
    
         
            +
            end
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
      
 47 
     | 
    
         
            +
            # Load all linters
         
     | 
| 
      
 48 
     | 
    
         
            +
            Dir[File.expand_path("slim_lint/linter/*.rb", File.dirname(__FILE__))].sort.each do |file|
         
     | 
| 
      
 49 
     | 
    
         
            +
              require file
         
     | 
| 
      
 50 
     | 
    
         
            +
            end
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
            # Load all reporters
         
     | 
| 
      
 53 
     | 
    
         
            +
            Dir[File.expand_path("slim_lint/reporter/*.rb", File.dirname(__FILE__))].sort.each do |file|
         
     | 
| 
      
 54 
     | 
    
         
            +
              require file
         
     | 
| 
      
 55 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,218 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: slim_lint_standard
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.0
         
     | 
| 
      
 5 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 6 
     | 
    
         
            +
            authors:
         
     | 
| 
      
 7 
     | 
    
         
            +
            - Pieter van de Bruggen
         
     | 
| 
      
 8 
     | 
    
         
            +
            - Shane da Silva
         
     | 
| 
      
 9 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 10 
     | 
    
         
            +
            bindir: bin
         
     | 
| 
      
 11 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2022-12-15 00:00:00.000000000 Z
         
     | 
| 
      
 13 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 14 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 15 
     | 
    
         
            +
              name: rubocop
         
     | 
| 
      
 16 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 17 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 18 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 19 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 20 
     | 
    
         
            +
                    version: 0.78.0
         
     | 
| 
      
 21 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 22 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 23 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 24 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 25 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 26 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 27 
     | 
    
         
            +
                    version: 0.78.0
         
     | 
| 
      
 28 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 29 
     | 
    
         
            +
              name: slim
         
     | 
| 
      
 30 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 31 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 32 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 33 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 34 
     | 
    
         
            +
                    version: '3.0'
         
     | 
| 
      
 35 
     | 
    
         
            +
                - - "<"
         
     | 
| 
      
 36 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 37 
     | 
    
         
            +
                    version: '5.0'
         
     | 
| 
      
 38 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 39 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 40 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 41 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 42 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 43 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 44 
     | 
    
         
            +
                    version: '3.0'
         
     | 
| 
      
 45 
     | 
    
         
            +
                - - "<"
         
     | 
| 
      
 46 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 47 
     | 
    
         
            +
                    version: '5.0'
         
     | 
| 
      
 48 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 49 
     | 
    
         
            +
              name: pry
         
     | 
| 
      
 50 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 51 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 52 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 53 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 54 
     | 
    
         
            +
                    version: '0.13'
         
     | 
| 
      
 55 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 56 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 57 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 58 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 59 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 60 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 61 
     | 
    
         
            +
                    version: '0.13'
         
     | 
| 
      
 62 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 63 
     | 
    
         
            +
              name: rspec
         
     | 
| 
      
 64 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 65 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 66 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 67 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 68 
     | 
    
         
            +
                    version: '3.0'
         
     | 
| 
      
 69 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 70 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 71 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 72 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 73 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 74 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 75 
     | 
    
         
            +
                    version: '3.0'
         
     | 
| 
      
 76 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 77 
     | 
    
         
            +
              name: rspec-its
         
     | 
| 
      
 78 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 79 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 80 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 81 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 82 
     | 
    
         
            +
                    version: '1.0'
         
     | 
| 
      
 83 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 84 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 85 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 86 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 87 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 88 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 89 
     | 
    
         
            +
                    version: '1.0'
         
     | 
| 
      
 90 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 91 
     | 
    
         
            +
              name: standard
         
     | 
| 
      
 92 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 93 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 94 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 95 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 96 
     | 
    
         
            +
                    version: 1.16.1
         
     | 
| 
      
 97 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 98 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 99 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 100 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 101 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 102 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 103 
     | 
    
         
            +
                    version: 1.16.1
         
     | 
| 
      
 104 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 105 
     | 
    
         
            +
              name: simplecov
         
     | 
| 
      
 106 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 107 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 108 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 109 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 110 
     | 
    
         
            +
                    version: 0.21.2
         
     | 
| 
      
 111 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 112 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 113 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 114 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 115 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 116 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 117 
     | 
    
         
            +
                    version: 0.21.2
         
     | 
| 
      
 118 
     | 
    
         
            +
            description: Configurable tool for writing clean and consistent Slim templates
         
     | 
| 
      
 119 
     | 
    
         
            +
            email:
         
     | 
| 
      
 120 
     | 
    
         
            +
            - pvande@gmail.com
         
     | 
| 
      
 121 
     | 
    
         
            +
            - shane@dasilva.io
         
     | 
| 
      
 122 
     | 
    
         
            +
            executables:
         
     | 
| 
      
 123 
     | 
    
         
            +
            - slim-lint-standard
         
     | 
| 
      
 124 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 125 
     | 
    
         
            +
            extra_rdoc_files: []
         
     | 
| 
      
 126 
     | 
    
         
            +
            files:
         
     | 
| 
      
 127 
     | 
    
         
            +
            - LICENSE.md
         
     | 
| 
      
 128 
     | 
    
         
            +
            - bin/slim-lint-standard
         
     | 
| 
      
 129 
     | 
    
         
            +
            - config/default.yml
         
     | 
| 
      
 130 
     | 
    
         
            +
            - lib/slim_lint.rb
         
     | 
| 
      
 131 
     | 
    
         
            +
            - lib/slim_lint/atom.rb
         
     | 
| 
      
 132 
     | 
    
         
            +
            - lib/slim_lint/capture_map.rb
         
     | 
| 
      
 133 
     | 
    
         
            +
            - lib/slim_lint/cli.rb
         
     | 
| 
      
 134 
     | 
    
         
            +
            - lib/slim_lint/configuration.rb
         
     | 
| 
      
 135 
     | 
    
         
            +
            - lib/slim_lint/configuration_loader.rb
         
     | 
| 
      
 136 
     | 
    
         
            +
            - lib/slim_lint/constants.rb
         
     | 
| 
      
 137 
     | 
    
         
            +
            - lib/slim_lint/document.rb
         
     | 
| 
      
 138 
     | 
    
         
            +
            - lib/slim_lint/engine.rb
         
     | 
| 
      
 139 
     | 
    
         
            +
            - lib/slim_lint/exceptions.rb
         
     | 
| 
      
 140 
     | 
    
         
            +
            - lib/slim_lint/file_finder.rb
         
     | 
| 
      
 141 
     | 
    
         
            +
            - lib/slim_lint/filter.rb
         
     | 
| 
      
 142 
     | 
    
         
            +
            - lib/slim_lint/filters/attribute_processor.rb
         
     | 
| 
      
 143 
     | 
    
         
            +
            - lib/slim_lint/filters/auto_indenter.rb
         
     | 
| 
      
 144 
     | 
    
         
            +
            - lib/slim_lint/filters/control_processor.rb
         
     | 
| 
      
 145 
     | 
    
         
            +
            - lib/slim_lint/filters/do_inserter.rb
         
     | 
| 
      
 146 
     | 
    
         
            +
            - lib/slim_lint/filters/end_inserter.rb
         
     | 
| 
      
 147 
     | 
    
         
            +
            - lib/slim_lint/filters/interpolation.rb
         
     | 
| 
      
 148 
     | 
    
         
            +
            - lib/slim_lint/filters/multi_flattener.rb
         
     | 
| 
      
 149 
     | 
    
         
            +
            - lib/slim_lint/filters/splat_processor.rb
         
     | 
| 
      
 150 
     | 
    
         
            +
            - lib/slim_lint/filters/static_merger.rb
         
     | 
| 
      
 151 
     | 
    
         
            +
            - lib/slim_lint/lint.rb
         
     | 
| 
      
 152 
     | 
    
         
            +
            - lib/slim_lint/linter.rb
         
     | 
| 
      
 153 
     | 
    
         
            +
            - lib/slim_lint/linter/avoid_multiline_expressions.rb
         
     | 
| 
      
 154 
     | 
    
         
            +
            - lib/slim_lint/linter/comment_control_statement.rb
         
     | 
| 
      
 155 
     | 
    
         
            +
            - lib/slim_lint/linter/consecutive_control_statements.rb
         
     | 
| 
      
 156 
     | 
    
         
            +
            - lib/slim_lint/linter/control_statement_spacing.rb
         
     | 
| 
      
 157 
     | 
    
         
            +
            - lib/slim_lint/linter/dynamic_output_spacing.rb
         
     | 
| 
      
 158 
     | 
    
         
            +
            - lib/slim_lint/linter/embedded_engines.rb
         
     | 
| 
      
 159 
     | 
    
         
            +
            - lib/slim_lint/linter/empty_control_statement.rb
         
     | 
| 
      
 160 
     | 
    
         
            +
            - lib/slim_lint/linter/empty_lines.rb
         
     | 
| 
      
 161 
     | 
    
         
            +
            - lib/slim_lint/linter/file_length.rb
         
     | 
| 
      
 162 
     | 
    
         
            +
            - lib/slim_lint/linter/line_length.rb
         
     | 
| 
      
 163 
     | 
    
         
            +
            - lib/slim_lint/linter/redundant_div.rb
         
     | 
| 
      
 164 
     | 
    
         
            +
            - lib/slim_lint/linter/rubocop.rb
         
     | 
| 
      
 165 
     | 
    
         
            +
            - lib/slim_lint/linter/standard.rb
         
     | 
| 
      
 166 
     | 
    
         
            +
            - lib/slim_lint/linter/tab.rb
         
     | 
| 
      
 167 
     | 
    
         
            +
            - lib/slim_lint/linter/tag_case.rb
         
     | 
| 
      
 168 
     | 
    
         
            +
            - lib/slim_lint/linter/trailing_blank_lines.rb
         
     | 
| 
      
 169 
     | 
    
         
            +
            - lib/slim_lint/linter/trailing_whitespace.rb
         
     | 
| 
      
 170 
     | 
    
         
            +
            - lib/slim_lint/linter_registry.rb
         
     | 
| 
      
 171 
     | 
    
         
            +
            - lib/slim_lint/linter_selector.rb
         
     | 
| 
      
 172 
     | 
    
         
            +
            - lib/slim_lint/logger.rb
         
     | 
| 
      
 173 
     | 
    
         
            +
            - lib/slim_lint/matcher/anything.rb
         
     | 
| 
      
 174 
     | 
    
         
            +
            - lib/slim_lint/matcher/base.rb
         
     | 
| 
      
 175 
     | 
    
         
            +
            - lib/slim_lint/matcher/capture.rb
         
     | 
| 
      
 176 
     | 
    
         
            +
            - lib/slim_lint/matcher/nothing.rb
         
     | 
| 
      
 177 
     | 
    
         
            +
            - lib/slim_lint/options.rb
         
     | 
| 
      
 178 
     | 
    
         
            +
            - lib/slim_lint/parser.rb
         
     | 
| 
      
 179 
     | 
    
         
            +
            - lib/slim_lint/rake_task.rb
         
     | 
| 
      
 180 
     | 
    
         
            +
            - lib/slim_lint/report.rb
         
     | 
| 
      
 181 
     | 
    
         
            +
            - lib/slim_lint/reporter.rb
         
     | 
| 
      
 182 
     | 
    
         
            +
            - lib/slim_lint/reporter/checkstyle_reporter.rb
         
     | 
| 
      
 183 
     | 
    
         
            +
            - lib/slim_lint/reporter/default_reporter.rb
         
     | 
| 
      
 184 
     | 
    
         
            +
            - lib/slim_lint/reporter/emacs_reporter.rb
         
     | 
| 
      
 185 
     | 
    
         
            +
            - lib/slim_lint/reporter/json_reporter.rb
         
     | 
| 
      
 186 
     | 
    
         
            +
            - lib/slim_lint/ruby_extract_engine.rb
         
     | 
| 
      
 187 
     | 
    
         
            +
            - lib/slim_lint/ruby_extractor.rb
         
     | 
| 
      
 188 
     | 
    
         
            +
            - lib/slim_lint/ruby_parser.rb
         
     | 
| 
      
 189 
     | 
    
         
            +
            - lib/slim_lint/runner.rb
         
     | 
| 
      
 190 
     | 
    
         
            +
            - lib/slim_lint/sexp.rb
         
     | 
| 
      
 191 
     | 
    
         
            +
            - lib/slim_lint/sexp_visitor.rb
         
     | 
| 
      
 192 
     | 
    
         
            +
            - lib/slim_lint/source_location.rb
         
     | 
| 
      
 193 
     | 
    
         
            +
            - lib/slim_lint/utils.rb
         
     | 
| 
      
 194 
     | 
    
         
            +
            - lib/slim_lint/version.rb
         
     | 
| 
      
 195 
     | 
    
         
            +
            homepage: https://github.com/pvande/slim-lint-standard
         
     | 
| 
      
 196 
     | 
    
         
            +
            licenses:
         
     | 
| 
      
 197 
     | 
    
         
            +
            - MIT
         
     | 
| 
      
 198 
     | 
    
         
            +
            metadata: {}
         
     | 
| 
      
 199 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 200 
     | 
    
         
            +
            rdoc_options: []
         
     | 
| 
      
 201 
     | 
    
         
            +
            require_paths:
         
     | 
| 
      
 202 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 203 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 204 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 205 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 206 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 207 
     | 
    
         
            +
                  version: 2.6.0
         
     | 
| 
      
 208 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 209 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 210 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 211 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 212 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 213 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 214 
     | 
    
         
            +
            rubygems_version: 3.0.3.1
         
     | 
| 
      
 215 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 216 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
      
 217 
     | 
    
         
            +
            summary: Linter for Slim templates
         
     | 
| 
      
 218 
     | 
    
         
            +
            test_files: []
         
     |