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: add command line interface #94

Merged
merged 15 commits into from
Sep 9, 2019
Merged

feat: add command line interface #94

merged 15 commits into from
Sep 9, 2019

Conversation

dbjorge
Copy link
Contributor

@dbjorge dbjorge commented Sep 6, 2019

Description of changes

Adds an axe-sarif-converter CLI tool to wrap the library and associated acceptance tests. Proposed usage:

> axe-sarif-converter --help
axe-sarif-converter: Converts JSON files containing axe-core Result object(s)
into SARIF files

Options:
  --help             Show help                                         [boolean]
  --version          Show version number                               [boolean]
  --input-files, -i  Input JSON file(s) containing axe-core Result object(s).
                     Does not support globs. Each input file may consist of
                     either a single root-level axe-core Results object or a
                     root-level array of axe-core Results objects.
                                                              [array] [required]
  --output-file, -o  Output SARIF file. Multiple input files (or input files
                     containing multiple Result objects) will be combined into
                     one output file with a SARIF Run per axe-core Result.
                                                             [string] [required]
  --verbose, -v      Enables verbose console output.  [boolean] [default: false]
  --pretty, -p       Includes line breaks and indentation in the output.
                                                      [boolean] [default: false]
  --force, -f        Overwrites the output file if it already exists.
                                                      [boolean] [default: false]

Examples:
  axe-sarif-converter -i axe-results.json -o axe-results.sarif

Looking for a review of both the command line interface and also the code.

Pull request checklist

  • PR title respects Conventional Commits (starts with fix:, feat:, etc, and is suitable for user-facing release notes)
  • PR contains no breaking changes, OR description of both PR and final merge commit starts with BREAKING CHANGE:
  • [n/a] (if applicable) Addresses issue: #0000
  • Added relevant unit tests for your changes
  • Ran yarn precheckin
  • Verified code coverage for the changes made

@dbjorge dbjorge requested a review from a team as a code owner September 6, 2019 04:19
@dbjorge
Copy link
Contributor Author

dbjorge commented Sep 6, 2019

The other option for this would be to use a separate axe-sarif-converter-cli package for it; this would avoid the yargs dependency for non-CLI users but would be a little more complex to manage. I imagine virtually all users of this package will use it as a devDependency (where the extra transitive dep isn't so important), so my inclination would be to do the simpler option in the same package, but I could be convinced otherwise.

README.md Show resolved Hide resolved
src/cli.test.ts Outdated Show resolved Hide resolved
src/cli.test.ts Outdated Show resolved Hide resolved
@dbjorge dbjorge merged commit 892ed0b into microsoft:master Sep 9, 2019
@ada-cat
Copy link
Collaborator

ada-cat commented Sep 9, 2019

🎉 This PR is included in version 2.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@dbjorge dbjorge deleted the cli branch February 26, 2021 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants