Skip to content

Generate machine-readable report of undocumented entities with their file + line #1570

Answered by lsegal
ianfixes asked this question in Q&A
Discussion options

You must be logged in to vote

YARD typically doesn't have porcelain style output because if you need specific structure to be parsed by "machine", it's easy enough to use its programmatic API to access via standard irb / Ruby scripting directly:

require 'yard'

YARD::CLI::Yardoc.run('-n', '-q')
undoc = YARD::Registry.all.select {|o| o.docstring.blank? }
undoc.each do |obj|
  puts "#{obj.file}:#{obj.line}: #{obj.type} #{obj.path}"

  # but really your tool can just use obj right here.
end

CodeObjects are documented via https://rubydoc.info/gems/yard/YARD/CodeObjects/Base

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lsegal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #1382 on September 03, 2024 08:31.