yard-contracts icon indicating copy to clipboard operation
yard-contracts copied to clipboard

Different coverage results via yard command line and rake task

Open vdbijl opened this issue 8 years ago • 2 comments

Context

I am trying to generate yard documentation with contract information. When I use the command line it reports that my doc coverage is 100%. When I use the yard rake task it reports that some lines with contracts have not been documented.

How to reproduce

On the command line I do: bundle exec yardoc lib/**/*.rb spec/**/*.rb --plugin contracts --private --no-cache --no-stats --markup=markdown

In the rakefile I use: YARD::Rake::YardocTask.new do |t| t.files = ['lib/**/*.rb', 'spec/**/*.rb'] t.options = ['--no-stats', '--markup=markdown', '--no-cache', '--plugin','contracts'] end

I am probably doing something wrong here. Anybody any idea what?

vdbijl avatar Jan 07 '17 12:01 vdbijl

Hmm, I don't think I've done that before so I can't say off the top of my head.

  • Have you tried putting t.options before t.files?
  • I wonder if '--plugin', 'contracts' is right, try '--plugin contracts'or '--plugin=contracts'.

Please do report back if you get the Rake task to report correctly and I'll add whatever you did to the Readme :)

sfcgeorge avatar Jan 09 '17 09:01 sfcgeorge

I will try to debug it to figure out what goes wrong. Might just as well be a yard problem. Or something I did wrong... nah ;)

One step further. I found that the problem is only there for class methods. Sorry red herring, I do have a class method under contract in another project and there it works...

vdbijl avatar Jan 13 '17 09:01 vdbijl