lirantal / lockfile-lint

Lint an npm or yarn lockfile to analyze and detect security issues
Apache License 2.0
780 stars 35 forks source link

feat: add format options for report output #134

Closed rheimus closed 1 year ago

rheimus commented 1 year ago

Description

Adds a flag for setting what type of report output is desired

Types of changes

Related Issue

133

Motivation and Context

Sadly many environments and parsing tools don't like fancy characters or color sequences, this just gives an alternative friendly output for more basic systems.

How Has This Been Tested?

I could add tests for the 'success' (no errors) path if desired.

Screenshots (if appropriate):

Checklist:

rheimus commented 1 year ago

Interesting note, this repo does not work under native windows, has problems spawning processes for the unit tests.

lirantal commented 1 year ago

We'll look into it shortly @rheimus 🙏🏼

lirantal commented 1 year ago

@rheimus looks good to me to land. Thank you for refactoring to support the error/warn/success functions and building this plain/pretty capability into the lockfile-lint CLI. Much appreciated 👏🙏🏼

codecov-commenter commented 1 year ago

Codecov Report

Merging #134 (875e6d9) into master (48a93a2) will not change coverage. The diff coverage is n/a.

:exclamation: Current head 875e6d9 differs from pull request most recent head 496595a. Consider uploading reports for the commit 496595a to get more accurate results

@@           Coverage Diff           @@
##           master     #134   +/-   ##
=======================================
  Coverage   97.75%   97.75%           
=======================================
  Files          12       12           
  Lines         312      312           
  Branches       67       67           
=======================================
  Hits          305      305           
  Misses          7        7           
Impacted Files Coverage Δ
packages/lockfile-lint/src/config.js 100.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

rheimus commented 1 year ago

Applied the requested changes and fixed a typo in the plain formatting test set.

lirantal commented 1 year ago

Looks great, thank you!