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

Generate descriptions for parameters #273

Closed
stek29 opened this issue May 5, 2022 · 2 comments · Fixed by #275
Closed

Generate descriptions for parameters #273

stek29 opened this issue May 5, 2022 · 2 comments · Fixed by #275
Labels
enhancement New feature or request

Comments

@stek29
Copy link
Contributor

stek29 commented May 5, 2022

Currently there's no way to generate @parameters with description

I'm not sure what would be the best way to document them, but this might be an option:

having:

# @parameter exemptImages array string
#  Any container that uses an image that matches an entry in this list will be excluded
#  from enforcement. Prefix-matching can be signified with `*`. For example: `my-image-*`.

generate:

properties:
  exemptImages:
    description: >-
      Any container that uses an image that matches an entry in this list will be excluded
      from enforcement. Prefix-matching can be signified with `*`. For example: `my-image-*`.
    type: array
    items:
      type: string
@jalseth jalseth added the enhancement New feature or request label May 6, 2022
@jalseth
Copy link
Collaborator

jalseth commented May 6, 2022

H @stek29, thanks for opening the issue! I think this makes sense. From an implementation standpoint, I think it may be easier if there's an indicator on the same line as the @parameter tag that lets Konstraint know to expect a description.

For example, all the three following scenarios would generate the same description.

# @parameter foo string -- Parameter foo is a string
# @parameter foo string -- Parameter foo
#  is a string
# @paramater foo string --
#  Parameter foo is a string

As always, I'd welcome a PR!

@stek29
Copy link
Contributor Author

stek29 commented May 6, 2022

@jalseth I've submitted the pull request.

jalseth pushed a commit that referenced this issue May 11, 2022
Signed-off-by: Viktor Oreshkin <imselfish@stek29.rocks>
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

Successfully merging a pull request may close this issue.

2 participants