Sha256: 6c66bfdab2bc2090e36e8396a1ea177d549f6dde562e86ee50d8ca8c6988230a
Contents?: true
Size: 1.17 KB
Versions: 1
Compression:
Stored size: 1.17 KB
Contents
require 'face_control/comment' module FaceControl module Checkers class Example # @optional # Define only if you use @options in the following methods attr_writer :options # @return [Array<String>] Shell globs to filter only files relevant to this checker # out of all files with added lines in the pull request def relevant_globs %w(bin/*) end # @param filenames [String] Files with added lines in the pull request # only relevant to this checker (filtered by globs above) # @return [String] Command line to check the files def command(filenames) "ls -l #{filenames}" end # @param command_output [String] Stdout of the command above # @return Array<FaceControl::Comment> Comments to post to the pull request def parse(command_output) command_output.split("\n").map do |line| fields = line.split mode = fields.first file = fields.last if mode != '-rwxr-xr-x' Comment.new(file: file, line: 1, text: 'Invalid file mode') end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
face_control-0.7.0 | lib/face_control/checkers/_example.rb |