api-issue-tracker icon indicating copy to clipboard operation
api-issue-tracker copied to clipboard

Duplicated return value

Open Eneroth3 opened this issue 5 years ago • 3 comments

In both the Tool interface and the Animation interface, there are methods listing the return value twice. this seems to be a bug in how the docs are built.

2020-09-16_15h27_05

2020-09-16_15h22_15

2020-09-16_15h25_04

Eneroth3 avatar Sep 16 '20 13:09 Eneroth3

... this seems to be a bug in how the docs are built.

I don't think so. If you look at the doc for Tool#enableVCB?, you'll see that there is no "parroting" happening.

So this is human error. The method docstrings are parroting what the YARD @return tag is saying.

Also there should not be important informational sentences below the code examples. They should be up above the examples with the rest of the docstring.


Suggested keeping this issue for Sketchup::Tools class (and open a separate issue for the Sketchup::Animation class.)

DanRathbun avatar Sep 16 '20 14:09 DanRathbun

Yea, this is some YARD weirdness. I've seen YARD duplicate or add extra return statements. Haven't figured out exactly why and what causes/triggers that.

In this case onKeyDown has an explicit @return tag, so there should be no return nil line in the docs like that.

I wonder if YARD is struggling with @overload statements...

thomthom avatar Sep 17 '20 09:09 thomthom

Haven't figured out exactly why and what causes/triggers that.

Many of the booboos I noticed in the Camera class, have parameter names for @return which doesn't say it accepts them. https://rubydoc.info/gems/yard/file/docs/Tags.md#return

DanRathbun avatar Sep 17 '20 16:09 DanRathbun