lsegal / yard

YARD is a Ruby Documentation tool. The Y stands for "Yay!"
http://yardoc.org
MIT License
1.94k stars 397 forks source link

Undocumented "phantom" method #1500

Closed istrasci closed 1 year ago

istrasci commented 1 year ago

yard stats --list-undoc is showing a method is undocumented, but that method doesn't exist.

Steps to reproduce

Not sure how reproducible this is, but here's my setup:

I have a Rails model named DocumentData that has a column/property :data_content. I have 2 scopes defined on specific values of it, a length validation on it, and several logic methods concerning it.

# app/models/document_data.rb
class DocumentData < ApplicationRecord
  scope :blank_data, -> { where(data_content: nil) }
  scope :non_blank_data, -> { where.not(data_content: nil) }

  validates :data_content, length: { maximum: 2000 }

  # other model stuff
end

Actual Output

$ yard stats --list-undoc

...other files...

(in file: app/models/document_data.rb)
DocumentData#data_content

Expected Output

I expected that file not to be in the output of undocumented files.

Environment details:

I have read the Contributing Guide.

lsegal commented 1 year ago

I cannot reproduce this with the information provided.

Please report the results of yard stats --debug and the listing of .yardopts if present / any plugins that may be used here. tl;dr it seems like you may be using a YARD plugin that is parsing this method, yard-rails perhaps?

istrasci commented 1 year ago

It looks like an issue with yard-activerecord. I'll close this.