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

Docs: add description_method struct tag support #3064

Merged
merged 3 commits into from
Sep 28, 2022

Conversation

pracucci
Copy link
Collaborator

@pracucci pracucci commented Sep 27, 2022

What this PR does

Me and @bboreham had a conversation about the long help text that will be produced by grafana/dskit#217. We both agree that having it in the markdown is fine, but in the -help output is not that nice. So, in this PR I'm introducing a way to specify the auto-generated doc description via function too, so that we can use it in grafana/dskit#217.

To show how it works, I've applied to the GCS service account description, which was one of our few cases with a multi line description.

Which issue(s) this PR fixes or relates to

N/A

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci marked this pull request as ready for review September 28, 2022 07:47
@pracucci pracucci requested a review from a team as a code owner September 28, 2022 07:47
Copy link
Contributor

@colega colega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice approach.

Copy link
Member

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nit: I would suggest to call it description_method to indicate it's a method on the type.

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci changed the title Docs: add description_func struct tag support Docs: add description_method struct tag support Sep 28, 2022
@pracucci
Copy link
Collaborator Author

Nit: I would suggest to call it description_method to indicate it's a method on the type.

👍 Done in c1914ac

@pracucci pracucci enabled auto-merge (squash) September 28, 2022 08:10
@pracucci pracucci merged commit bb004ff into main Sep 28, 2022
@pracucci pracucci deleted the add-doc-description-func-support branch September 28, 2022 08:19
sysedwinistrator pushed a commit to sysedwinistrator/mimir that referenced this pull request Nov 21, 2022
* Docs: add description_func struct tag support

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Revert rename to make diff easier

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Renamed description_func to description_method

Signed-off-by: Marco Pracucci <marco@pracucci.com>

Signed-off-by: Marco Pracucci <marco@pracucci.com>
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

3 participants