Sha256: 1e41bfd49ee63543989c8def5bf04631776c9db51f7e60ac6f98ce346ec1df70

Contents?: true

Size: 751 Bytes

Versions: 13

Compression:

Stored size: 751 Bytes

Contents

# frozen_string_literal: true

begin
  require "erb_lint"
rescue LoadError
  return
end

def erb_lint_config
  local = Rails.application.root.join(".erb-lint.yml")
  if local.exist?
    local.to_path
  else
    Pathname.new(__dir__).join("../../.erb-lint.yml").to_path
  end
end

namespace :erb_lint do
  desc "Require erb_lint"
  task :require do
    require "erb_lint/cli"
  rescue LoadError
    nil
  end

  desc "Run erb_lint linter"
  task lint: :require do
    ERBLint::CLI.new.run(["--config", erb_lint_config, "--lint-all"])
  end

  desc "Run erb_lint autocorrect"
  task autocorrect: :require do
    ERBLint::CLI.new.run(["--config", erb_lint_config, "--lint-all", "-a"])
  end
end

desc "Run erb_lint linter"
task erb_lint: "erb_lint:lint"

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
rubocop-katalyst-2.1.0 lib/tasks/erb_lint.rake
rubocop-katalyst-2.0.5 lib/tasks/erb_lint.rake
rubocop-katalyst-2.0.4 lib/tasks/erb_lint.rake
rubocop-katalyst-2.0.3 lib/tasks/erb_lint.rake
rubocop-katalyst-2.0.2 lib/tasks/erb_lint.rake
rubocop-katalyst-2.0.1 lib/tasks/erb_lint.rake
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/rubocop-katalyst-2.0.0/lib/tasks/erb_lint.rake
rubocop-katalyst-2.0.0 lib/tasks/erb_lint.rake
rubocop-katalyst-1.1.4 lib/tasks/erb_lint.rake
rubocop-katalyst-1.1.3 lib/tasks/erb_lint.rake
rubocop-katalyst-1.1.2 lib/tasks/erb_lint.rake
rubocop-katalyst-1.1.1 lib/tasks/erb_lint.rake
rubocop-katalyst-1.1.0 lib/tasks/erb_lint.rake