Sha256: 1680a46b52f8841aff74d529ada746c0454b0bf6e367f708bd071f669ad778bd

Contents?: true

Size: 700 Bytes

Versions: 5

Compression:

Stored size: 700 Bytes

Contents

# rubocop:disable Naming/FileName
# frozen_string_literal: true

command :'lint-validate' do
  action do |context|
    require 'schmersion/repo'
    require 'schmersion/linter'
    repo = Schmersion::Repo.new(FileUtils.pwd)
    linter = Schmersion::Linter.new(repo)
    errors = linter.validate_file(context.args[0])
    if errors.empty?
      exit 0
    end

    puts
    puts '  Schmersion Commit Linting'.cyan
    puts
    puts "  Uh oh. There's a few things wrong with your commit message...".red
    puts '  Please correct these and re-commit to continue.'.red
    puts
    errors.each do |error|
      puts "  => #{error}"
    end
    puts
    exit 1
  end
end
# rubocop:enable Naming/FileName

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
schmersion-1.1.3 cli/lint-validate.rb
schmersion-1.1.2 cli/lint-validate.rb
schmersion-1.1.0 cli/lint-validate.rb
schmersion-1.0.1 cli/lint-validate.rb
schmersion-1.0.0 cli/lint-validate.rb