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 `lint` function in index.js to *not* trying to figure out `is it a path/url/encoded` question.
  • Loading branch information
Neil Zhao committed Oct 22, 2023
1 parent fff69cc commit 67ec98f
Showing 1 changed file with 5 additions and 3 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

0 comments on commit 67ec98f

Please sign in to comment.