Sha256: 7be9e65303e1c9e3c77209fc783bb8e35f345f49af6b9b139f46645ce580f16f

Contents?: true

Size: 517 Bytes

Versions: 2

Compression:

Stored size: 517 Bytes

Contents

module Overcommit::Hook::PreCommit
  # Runs `vint` against any modified Vim script files.
  #
  # @see https://github.com/Kuniwak/vint
  class Vint < Base
    def run
      result = execute(command + applicable_files)
      return :pass if result.success?

      return [:fail, result.stderr] unless result.stderr.empty?

      # example message:
      #   path/to/file.vim:1:1: Error message
      extract_messages(
        result.stdout.split("\n"),
        /^(?<file>[^:]+):(?<line>\d+)/
      )
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
overcommit-0.27.0 lib/overcommit/hook/pre_commit/vint.rb
overcommit-0.26.0 lib/overcommit/hook/pre_commit/vint.rb