Method: Codeqa::Checkers::CheckYard#check

Defined in:
lib/codeqa/checkers/check_yard.rb

#checkObject



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/codeqa/checkers/check_yard.rb', line 25

def check
  if self.class.yard?
    ::YARD.parse_string(sourcefile.content) # let yard parse the file content
    io.rewind # rewind the io
    message = io.read
    warnings = message.match(/\A\[warn\]: /)
    errors.add(nil, message.gsub(/\(stdin\)/, sourcefile.filename)) if warnings
  end
ensure
  io.reopen # clear the message for the next file
end