Class: FaceControl::Checkers::RuboCop
- Inherits:
-
Object
- Object
- FaceControl::Checkers::RuboCop
- Defined in:
- lib/face_control/checkers/rubocop.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
writeonly
Sets the attribute options.
Instance Method Summary collapse
Instance Attribute Details
#options=(value) ⇒ Object (writeonly)
Sets the attribute options
10 11 12 |
# File 'lib/face_control/checkers/rubocop.rb', line 10 def (value) @options = value end |
Instance Method Details
#command(filenames) ⇒ Object
24 25 26 |
# File 'lib/face_control/checkers/rubocop.rb', line 24 def command(filenames) "rubocop --format json #{filenames}" end |
#parse(command_output) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/face_control/checkers/rubocop.rb', line 28 def parse(command_output) JSON.parse(command_output)['files'].map do |file| file['offenses'].reject do |offense| ignored_severities.include?(offense['severity']) end.map do |offense| Comment.new( file: file['path'], line: offense['location']['line'], text: text(offense, file) ) end end end |
#relevant_globs ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/face_control/checkers/rubocop.rb', line 12 def relevant_globs %w( *.gemspec *.rb *.rake Capfile Gemfile Rakefile Vagrantfile ) end |