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

feat: create --format flag #158

Merged
merged 2 commits into from
Jan 23, 2023
Merged

feat: create --format flag #158

merged 2 commits into from
Jan 23, 2023

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Jan 21, 2023

Helps with #156 and related to #85.

I've gone with --format instead of --output because it seems more common (looking at CLI tools like ESLint, Rubocop, bundler-audit, rspec, Terminus) and also because --output tends to match the flag used by some CLI tools for "output to file" such as ESLint and cURL which the scanner might decide to support one day.

I've also kept it simple for now since there's only a couple of formats supported - in future it might make sense to employ enum / const types and look at some fancy map similar to what lockfile has for its parsers, but I don't think that's needed here yet.

(this'll need rebasing when #161 is landed)

Copy link
Collaborator

@another-rex another-rex left a comment

Choose a reason for hiding this comment

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

Looks good to me, just a question about whether an enum would be better here.

internal/output/reporter.go Show resolved Hide resolved
@another-rex another-rex merged commit 5b6a7ad into google:main Jan 23, 2023
@G-Rath G-Rath deleted the add-output-flag branch January 23, 2023 03:26
hayleycd pushed a commit that referenced this pull request Mar 9, 2023
* feat: create `--format` flag

* fix: mark `--json` as deprecated
julieqiu pushed a commit to julieqiu/osv-scanner that referenced this pull request May 2, 2023
* feat: create `--format` flag

* fix: mark `--json` as deprecated
julieqiu pushed a commit to julieqiu/osv-scanner that referenced this pull request May 2, 2023
* feat: create `--format` flag

* fix: mark `--json` as deprecated
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

2 participants