Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --mask-directive option #1459

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

estum
Copy link

@estum estum commented Sep 7, 2022

Description

This PR adds the --mask-directive option similar to --hide-tag but for directives.

The following example will mask @!parse directive with YARD::Tags::NilDirective class to suppress any callbacks:

yardoc --mask-directive parse

Also, the option allows to suppress warnings on unknown directives in different contexts.

Completed Tasks

  • I have read the Contributing Guide.
  • The pull request is complete (implemented / written).
  • Git commits have been cleaned up (squash WIP / revert commits).
  • I wrote tests and ran bundle exec rake locally (if code is attached to PR).

@estum
Copy link
Author

estum commented Sep 7, 2022

Honestly, the second use-case was a main target for me and I explain why:

I have a project depended on swagger-yard gem which defines several custom YARD tags & directives to declare docs for RESTful API in controllers by using YARD syntax.

The same files may contain documentation for regular ruby methods, so I have tried to make a custom definitions to be ignored by yardoc.

Whilst the --hide-tag option has already supplied to do it with custom tags, directives won't to be tamed and were keeping to annoy with unknown directive warnings. So, there is the dumbest solution I found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant