dkubb / yardstick

A tool for verifying YARD documentation coverage
http://wiki.github.com/dkubb/yardstick
MIT License
173 stars 22 forks source link

Mistakes id for a method instead of an attribute #3

Closed sarahhodne closed 12 years ago

sarahhodne commented 12 years ago

I have the following class:

module ContextIO
  class Account < Resource
    # @api public
    # @return [String] The unique ID of the account.
    attr_reader :id

    # @api public
    # @return [String] The username of the account.
    attr_reader :username

    # [snip]
  end
end

Yardstick correctly identifies the username attribute and all other attributes in the class as attributes, and doesn't complain about not having a method summary and examples. However, it seems to think the id attribute is a method and spits out this:

lib/context-io/account.rb:15: ContextIO::Account#id: The method summary should be specified
lib/context-io/account.rb:15: ContextIO::Account#id: The public/semipublic method should have an example specified

Coverage: 99.2%  Success: 248  Failed: 2  Total: 250

I guess this might be because Object#id exists?

% yardstick --version
yardstick 0.1.0
% ruby --version
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
% yard --version
yard 0.7.4
sarahhodne commented 12 years ago

This happens on methods ending with id as well (for instance account_id).

sarahhodne commented 12 years ago

Actually, this is a bug with YARD. Closing this and reopening there.