-
Notifications
You must be signed in to change notification settings - Fork 274
Issue 79: Add a json reporter to quantify the extend of the cli's documenation #32
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it would make sense to add an extra flag to generate the report.
return &report | ||
} | ||
|
||
func (report *Report) Write(w io.Writer) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linters will fail on public methods without docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, weird. My linter must have overlooked it for unknown reasons. I will get that fixed.
usage/html.go
Outdated
|
||
// report | ||
repjson := path.Join(dir, "report.json") | ||
rjw, err := os.Create(repjson) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will override a previous report. If you think this can be an issue you can use utils.WriteFile() that will ask the user for consent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. I think I will stick with what's there now. The default behavior of the HTML help is to overwrite existing files.
a81dd25
to
7dfdc0c
Compare
usage/help.go
Outdated
cli.StringFlag{ | ||
Name: "report", | ||
Usage: "The report <directory> for JSON report based on HTML docs.", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way that the code works, looks like this should be a cli.BoolFlag
instead of a string with the directory, with this, we will generate the report with step help --html <directory> --report
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. That works for me too. I'll make the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Description
Implemented a simple word/line counter report based on the HTML page generation written to the output ./html directory.
https://github.com/smallstep/ca-component/issues/79