From 374e2a3c1f7bc76665d2a065706181212b8c2306 Mon Sep 17 00:00:00 2001 From: Aleksei Khoroshilov <5928869+goodov@users.noreply.github.com> Date: Wed, 23 Oct 2024 18:51:11 +0700 Subject: [PATCH] [staging] Default studies_dir parameter to 'studies' and seed path to seed.bin. (#1232) --- src/scripts/lint.ts | 4 ++-- src/seed_tools/commands/create.ts | 8 ++++++-- src/seed_tools/commands/lint.ts | 6 +++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/scripts/lint.ts b/src/scripts/lint.ts index 8ce3e4b1..878776f4 100644 --- a/src/scripts/lint.ts +++ b/src/scripts/lint.ts @@ -41,7 +41,7 @@ function getLintAllCommands(options: Options): string[] { return [ 'prettier . --ignore-unknown' + (options.fix ? ' --write' : ' --check'), 'eslint . --config src/.eslintrc.js' + (options.fix ? ' --fix' : ''), - 'npm run seed_tools -- lint studies' + (options.fix ? ' --fix' : ''), + 'npm run -- seed_tools lint' + (options.fix ? ' --fix' : ''), ]; } @@ -52,7 +52,7 @@ function getLintDiffCommands(options: Options): Record { '*.{ts,js,tsx,jsx}': 'eslint --config src/.eslintrc.js' + (options.fix ? ' --fix' : ''), 'studies/*': () => - 'npm run seed_tools -- lint studies' + (options.fix ? ' --fix' : ''), + 'npm run -- seed_tools lint' + (options.fix ? ' --fix' : ''), }; } diff --git a/src/seed_tools/commands/create.ts b/src/seed_tools/commands/create.ts index 58e32f7b..ff3bc6f8 100644 --- a/src/seed_tools/commands/create.ts +++ b/src/seed_tools/commands/create.ts @@ -12,8 +12,12 @@ import { readStudiesToSeed } from '../utils/studies_to_seed'; export default function createCommand() { return new Command('create') .description('Create seed.bin from study files') - .argument('', 'path to the directory containing study files') - .argument('', 'output seed file') + .argument( + '[studies_dir]', + 'path to the directory containing study files', + 'studies', + ) + .argument('[output_seed_file]', 'output seed file', 'seed.bin') .option('--mock_serial_number ', 'mock serial number') .option( '--output_serial_number_file ', diff --git a/src/seed_tools/commands/lint.ts b/src/seed_tools/commands/lint.ts index 9108deae..166bfddf 100644 --- a/src/seed_tools/commands/lint.ts +++ b/src/seed_tools/commands/lint.ts @@ -9,7 +9,11 @@ import { readStudiesToSeed } from '../utils/studies_to_seed'; export default function createCommand() { return new Command('lint') .description('Lint study files without creating seed.bin') - .argument('', 'path to the directory containing study files') + .argument( + '[studies_dir]', + 'path to the directory containing study files', + 'studies', + ) .option('--fix', 'fix format errors in-place') .action(lintStudies); }