Skip to content

Commit

Permalink
chore: update cli yargs config to highlight "ruleset" options are mut…
Browse files Browse the repository at this point in the history
…ually exclusive. This should help clean up the function in index.js to *not* trying to figure out "is it a path/url/encoded" question.

Signed-off-by: Neil Zhao <[email protected]>
  • Loading branch information
zhaoyuheng200 committed Oct 23, 2023
2 parents 893920a + d401219 commit 3c9afb0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions bin/repolinter.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ require('yargs')
.option('rulesetFile', {
alias: 'r',
describe:
'Specify an alternate location for the repolinter configuration to use (This will default to repolinter.json/repolinter.yaml at the root of the project, or the internal default ruleset if none is found).',
'Specify an alternate file location for repolinter configuration to use. This option is mutually exclusive from all other "ruleset*" options. If no "ruleset*" option provided, repolinter will use default repolinter.json/repolinter.yaml at the root of the project.',
type: 'string'
})
.option('rulesetUrl', {
alias: 'u',
describe:
'Specify an alternate URL repolinter configuration to use (This will default to repolinter.json/repolinter.yaml at the root of the project, or the internal default ruleset if none is found).',
'Specify an alternate URL location for repolinter configuration to use. This option is mutually exclusive from all other "ruleset*" options. If no "ruleset*" option provided, repolinter will use default repolinter.json/repolinter.yaml at the root of the project.',
type: 'string'
})
.option('rulesetEncoded', {
alias: 'c',
describe:
'Specify a base64 encoded ruleset that repolinter will decode and use instead.',
'Specify a base64 encoded ruleset that repolinter will decode and use instead. This option is mutually exclusive from all other "ruleset*" options. If no "ruleset*" option provided, repolinter will use default repolinter.json/repolinter.yaml at the root of the project',
type: 'string'
})
.option('git', {
Expand All @@ -67,6 +67,8 @@ require('yargs')
default: 'console',
type: 'string'
})
.conflicts('rulesetFile', ['rulesetUrl', 'rulesetEncoded'])
.conflicts('rulesetEncoded', 'rulesetUrl')
},
async (/** @type {any} */ argv) => {
let tmpDir = null
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3c9afb0

Please sign in to comment.