Skip to content

Commit

Permalink
feat: use recursive scan when running in CI mode by default
Browse files Browse the repository at this point in the history
  • Loading branch information
vlasy committed May 27, 2021
1 parent c00416e commit 109652e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export default class Run {
let { authorization } = cmd;
const { apiToken, apiUrl } = cmd;

if (cmd.recursive === undefined) {
cmd.recursive = cmd.ci ? true : false; // default is true for CI mode, false otherwise
}

const hrstart = process.hrtime();

cli.action.start(`Scanning URI: ${scanPath}`);
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ class DXScannerCommand {
.option('--fixPattern <pattern>', 'fix only rules with IDs matching the regex')
.option('-j --json', 'print report in JSON', false)
.option('--html [path]', 'save report in HTML', false)
.option('-r --recursive', 'scan all components recursively in all sub folders', false)
.option('-r --recursive', 'scan all components recursively in all sub folders')
.option('--no-recursive', 'disable recursive scan in CI mode')
.action(Run.run)
.on('--help', () => {
console.log('');
Expand Down
2 changes: 1 addition & 1 deletion src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export type CLIArgs = {
authorization?: string;
json: boolean;
details: boolean;
recursive: boolean;
recursive?: boolean;
ci: boolean;
fail: PracticeImpact;
fix: boolean;
Expand Down

0 comments on commit 109652e

Please sign in to comment.