Class: Quality::Tools::Mdl

Inherits:
Tool
  • Object
show all
Defined in:
lib/quality/tools/mdl.rb

Overview

Adds ‘bigfiles’ tool support to quality gem

Instance Method Summary collapse

Methods inherited from Tool

#initialize

Constructor Details

This class inherits a constructor from Quality::Tools::Tool

Instance Method Details

#mdl_argsObject



7
8
9
# File 'lib/quality/tools/mdl.rb', line 7

def mdl_args
  markdown_files.join(' ')
end

#quality_mdlObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/quality/tools/mdl.rb', line 11

def quality_mdl
  if mdl_args.empty?
    puts 'No markdown files found--skipping mdl'
    return
  end

  ratchet_quality_cmd('mdl',
                      args: mdl_args,
                      gives_error_code_on_violations: true) do |line|
    if line =~ /\d: MD/
      1
    else
      0
    end
  end
end