<commit_before># lint_pass1.rb - class LintPass1 - looks at buffer and reports adjacent indent
# offsets > 0, :indent level

require_relative 'indentations'
require_relative 'distance'

class LintPass1 < BaseBufferCommand
  def call *args, env:, frames:
    buf_apply(args[0], env:env, frames:frames) do |buffer|
      lines = buffer.lines
      distance(indentations lines).map(&:abs).reject(&:zero?).reject {|e| e == frames[:indent].to_i }
    end
  end
end<commit_msg>\'got lint_pass1 to work in impaired mode. ... Must convert to JSON output\'<commit_after># lint_pass1.rb - class LintPass1 - looks at buffer and reports adjacent indent
# offsets > 0, :indent level

require_relative 'indentations'
require_relative 'distance'

class LintPass1 < BaseBufferCommand
  def call *args, env:, frames:
    buf_apply(args[0], env:env, frames:frames) do |buffer|
      lines = buffer.lines
      a = 0
      maker = ->(e) { [a+=1, e] }
      env[:out].puts distance(indentations lines).map(&:abs).map(&maker).reject {|e| e[1].zero? }.reject {|e| e[1] == frames[:indent].to_i }.map {|e| "line #{e[0]},#{e[0] + 1}: offset: #{e[1]}" }.join("\n")
      ''
    end
  end
end
{'fraction_non_alphanumeric': 0.15622317596566523, 'fraction_numerical': 0.01630901287553648, 'mean_word_length': 4.0042918454935625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1834860', 'n_tokens_mistral': 406, 'n_tokens_neox': 398, 'n_words': 112}