drwl / annotaterb

A Ruby Gem that adds annotations to your Rails models and route files.
Other
190 stars 18 forks source link

Yardoc formatting for comments on database attributes #162

Open bryanmetzger opened 5 days ago

bryanmetzger commented 5 days ago

https://github.com/drwl/annotaterb/blob/7746f54b31674603b671db2433cd3d2e3da78fb7/spec/lib/annotate_rb/model_annotator/column_annotation/annotation_builder_spec.rb#L454

we were testing out using this with yardoc and this was breaking when we had database comments, I'm not 100% sure, but my understanding of yardoc is that the format for something with comments would be like this:

# @!attribute id
#  [is commented]
#  @return [Integer]

instead of

# @!attribute id([is commented])
#   @return [Integer]
drwl commented 3 days ago

Thanks for reporting this, I'll look into adding a fix.

drwl commented 2 days ago

@bryanmetzger I'm working on adding a fix for this now, it should be straight forward. But for my own knowledge, can you share with me where I can learn more about how proper yardoc should be formatted?

I poked around on the YARD website [1] and didn't see anything related. I did see this though [2], referenced from a yard cheatsheet, but doesn't recommend how the [is commented] should be formatted.

[1] https://yardoc.org/ [2] https://github.com/chriscz/cheatsheets/blob/main/yard/index.md#meta-programming