Sha256: 1ccb5616005668c2c48dec8188a2331477d82c57fec246db516e6231cb1206b8
Contents?: true
Size: 764 Bytes
Versions: 27
Compression:
Stored size: 764 Bytes
Contents
module Overcommit::Hook::PreCommit # Runs `jscs` (JavaScript Code Style Checker) against any modified JavaScript # files. # # @see http://jscs.info/ class Jscs < Base def run result = execute(command, args: applicable_files) return :pass if result.success? # Exit status 2 = Code style errors; everything else we don't know how to # parse. https://github.com/jscs-dev/node-jscs/wiki/Exit-codes unless result.status == 2 return :fail, result.stdout + result.stderr.chomp end # example message: # path/to/file.js: line 7, col 0, ruleName: Error message extract_messages( result.stdout.split("\n"), /^(?<file>(?:\w:)?[^:]+):[^\d]+(?<line>\d+)/, ) end end end
Version data entries
27 entries across 25 versions & 2 rubygems