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

Optional and required blocks #129

Open
AaronC81 opened this issue Jan 13, 2021 · 1 comment
Open

Optional and required blocks #129

AaronC81 opened this issue Jan 13, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@AaronC81
Copy link
Owner

Currently, the behaviour of blocks is a bit strange:

  • When outputting RBI, blocks are always required.
  • When outputting RBS, blocks are always optional.

This inconsistency isn't intuitive and could lead to some confusion, especially when targeting multiple output types. I think required should be the default across both output types, and that you should be able to change it to optional if you want.

I don't believe YARD has a way of specifying if a block is optional or required, so we'd have to hijack an existing tag somehow, like using the word "Optional" at the beginning of @yield to indicate that it's optional for that method.

@AaronC81 AaronC81 added the enhancement New feature or request label Jan 13, 2021
@wagenet
Copy link
Contributor

wagenet commented Dec 20, 2021

I think you're correct about YARD not being able to specify optional blocks. That does make this a bit annoying to resolve.

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

No branches or pull requests

2 participants