<commit_before>if %w(development test).include? Rails.env
  require "rubocop/rake_task"
  RuboCop::RakeTask.new

  task(:default).clear

  desc "JS Linting"
  task :js_lint do
    sh "cd client && bin/lint"
  end

  task default: [:spec, :rubocop]
end

if %w(development test).include? Rails.env
  # require "rubocop/rake_task"
  # require "slim_lint/rake_task"
  require "scss_lint/rake_task"

  # This fails: https://github.com/bbatsov/rubocop/issues/1840
  # RuboCop::RakeTask.new

  desc "Run Rubocop lint as shell"
  task :rubocop_lint do
    puts "Running Rubocop Linters"
    sh "rubocop ."
  end

  # SlimLint::RakeTask.new

  SCSSLint::RakeTask.new do |t|
    t.files = ["app/assets/stylesheets/", "client/assets/stylesheets/"]
  end

  desc "eslint"
  task :eslint_lint do
    puts "Running eslint"
    sh "cd client && npm run eslint . -- --ext .jsx,.js"
  end

  desc "jscs"
  task :jscs_lint do
    puts "Running jscs"
    sh "cd client && npm run jscs ."
  end

  desc "JS Linting"<commit_msg>Fixed issue in rake file. Dead code.<commit_after>if %w(development test).include? Rails.env
  # require "rubocop/rake_task"
  require "scss_lint/rake_task"

  # This fails: https://github.com/bbatsov/rubocop/issues/1840
  # RuboCop::RakeTask.new

  desc "Run Rubocop lint as shell"
  task :rubocop_lint do
    puts "Running Rubocop Linters"
    sh "rubocop ."
  end

  # If we had slim
  # require "slim_lint/rake_task"
  # SlimLint::RakeTask.new

  SCSSLint::RakeTask.new do |t|
    t.files = ["app/assets/stylesheets/", "client/assets/stylesheets/"]
  end

  desc "eslint"
  task :eslint_lint do
    puts "Running eslint"
    sh "cd client && npm run eslint . -- --ext .jsx,.js"
  end

  desc "jscs"
  task :jscs_lint do
    puts "Running jscs"
    sh "cd client && npm run jscs ."
  end

  desc "JS Linting"
{'fraction_non_alphanumeric': 0.12266226622662266, 'fraction_numerical': 0.0044004400440044, 'mean_word_length': 3.124716553287982, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '7423792', 'n_tokens_mistral': 734, 'n_tokens_neox': 704, 'n_words': 179}