istanbuljs / nyc

the Istanbul command line interface
https://istanbul.js.org/
ISC License
5.6k stars 359 forks source link

nyc check-coverage: new command flag #432

Open tunnckoCore opened 8 years ago

tunnckoCore commented 8 years ago

Hello! Just want to suggest new CLI flag for the check-coverage command executes it like all other flags are set to 100.

npm check-coverage --max

instead

nyc check-coverage --lines 100 --branches 100 --statements 100 --functions 100

It looks visually better and shorter in the package.json.

Also why not to be more configurable like --max 90 to sets everything to 100, but branches to 90.

Better flag name?

bcoe commented 7 years ago

@tunnckoCore I like this idea. Tap implements it by simply allowing a user to pass: --100.

What if we did something similar where you could run, --check-coverage 95, where 95 is any numeric value, and we used the first positional argument as a shorthand like you suggest?

Want to take a stab at this feature?

tunnckoCore commented 7 years ago

What if we did something similar where you could run

Yea. Looks good and meaningful, but there will have duplication of names nyc check-coverage --check-coverage 95? or you mean flag to be for main nyc command. Everything is just about to have shorter syntax.

Want to take a stab at this feature?

I'm not familiar with the codebase and don't have the time.