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

Use VisibleFlags during doc generation #999

Merged
merged 2 commits into from
Dec 20, 2019
Merged

Use VisibleFlags during doc generation #999

merged 2 commits into from
Dec 20, 2019

Conversation

subpop
Copy link
Contributor

@subpop subpop commented Dec 18, 2019

Motivation

Hidden commands are excluded during doc generation but hidden flags are not. This results in generated documentation (man pages and markdown) including hidden flags in the output. Using VisibleFlags() instead of the Flags slice filters out hidden flags before preparing them for document output.

Testing

I added a hidden flag to the testApp. Test output should remain unchanged, since hidden flags should not be included in documentation output.

@subpop subpop requested a review from a team as a code owner December 18, 2019 19:56
@codecov
Copy link

codecov bot commented Dec 18, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@716b748). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #999   +/-   ##
=========================================
  Coverage          ?   73.38%           
=========================================
  Files             ?       32           
  Lines             ?     2435           
  Branches          ?        0           
=========================================
  Hits              ?     1787           
  Misses            ?      539           
  Partials          ?      109
Impacted Files Coverage Δ
docs.go 89.74% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 716b748...8827318. Read the comment docs.

coilysiren
coilysiren previously approved these changes Dec 18, 2019
Copy link
Member

@coilysiren coilysiren left a comment

Choose a reason for hiding this comment

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

LGTM, defer to @saschagrunert though!

rliebz
rliebz previously approved these changes Dec 18, 2019
saschagrunert
saschagrunert previously approved these changes Dec 19, 2019
@saschagrunert
Copy link
Member

Thanks for the fix, @subpop :)

Hidden commands are excluded during doc generation but hidden flags are
not. Using VisibleFlags() instead of the Flags slice fixes that.

Signed-off-by: Link Dupont <link@sub-pop.net>
@subpop
Copy link
Contributor Author

subpop commented Dec 19, 2019

Ugh, sorry. Rebased this change onto master and it invalidated the approvals. :(

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.

4 participants