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

puppet-strings insists on redundant return value for puppet functions #297

Open
smortex opened this issue Jun 1, 2022 · 2 comments
Open
Labels

Comments

@smortex
Copy link
Contributor

smortex commented Jun 1, 2022

Describe the Bug

When generating the documentation of a Puppet function, puppet-strings wants to see a @return tag in the comments, while the code already include the returned type.

Expected Behavior

puppet-strings should not want a @return tag.

Steps to Reproduce

Generate the documentation of a function (example taken from stdlib):

# @summary function to cast ensure parameter to resource specific value
function stdlib::ensure(
  Variant[Boolean, Enum['present', 'absent']] $ensure,
  Enum['directory', 'link', 'mounted', 'service', 'file', 'package'] $resource,
) >> String {
  # [...]
}

Note the >> String that tells what the function returns.

Environment

  • Version : 2.9.0
  • Platform : Any

Additional Context

Suggested by @ekohl in puppetlabs/puppetlabs-stdlib#1239 (comment)

@greatflyingsteve
Copy link

Currently, the generated Markdown documentation will contain the return type whether or not a @return tag exists; however, Strings will still issue a warning about the missing tag. It should always be possible to include a tag, and that's of course what's recommended in the style guide, but if your type names are sufficiently descriptive, just being forced to type in a @return to shut Strings up feels pretty superfluous, especially for very simple returns.

@ekohl
Copy link
Contributor

ekohl commented Sep 8, 2023

puppet-strings should not want a @return tag.

I'd narrow this down to "if a data type can be determined"

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

No branches or pull requests

3 participants