chore: update cli yargs config to highlight "ruleset*" options are mutually exclusive. #308
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should help clean up the
lint
function in index.js to not trying to figure outis it a path/url/encoded
question.Motivation
The current design of the
lint
function inindex.js
spends much effort trying to figure out how to ingest ruleset config correctly.Adding
conflicts
inyargs
creates a 3-way option exclusion, so we can have better control over CLI option intake.I have some plan to update the
lint
function to call a newlintEngine
function, so the existing exposedlint
function will remain the same, but we'll use a newlintEngine
function to separaterulesetPath
,rulesetUrl
andrulesetEncoded
.It would also help separate
--allowPaths
and future--ignorePaths
option, since I don't see an easy way to add the proposed--ignorePaths
easily in current setup.Proposed Changes
Add the conflicts to create a 3-way exclusion.
Test Plan
This should be expected behavior of how customer use the repolinter cli tool, and I'm not testing yargs here.
So I didn't add any additional testing.
Passed all existing tests.