Sha256: fb74dee7afeaf95c10a1bfa336349e2025efe20a9f6e988ed0f891545c1fb97e

Contents?: true

Size: 489 Bytes

Versions: 1

Compression:

Stored size: 489 Bytes

Contents

class Rubocop < Aid::Script
  def self.description
    "Runs rubocop against the codebase"
  end

  def self.help
    <<~HELP
    Usage:

      #{colorize(:green, "$ aid rubocop")} - runs all the cops
      #{colorize(:green, "$ aid rubocop fix")} - auto-fixes any issues
    HELP
  end

  def run
    step "Running Rubocop" do
      cmd = "bundle exec rubocop"
      cmd << " -a" if auto_fix?

      system! cmd
    end
  end

  private

  def auto_fix?
    argv.first == "fix"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aid-0.1.3 examples/rubocop.rb