Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to studies dir and seed.bin output file. #1235

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/scripts/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ function getLintAllCommands(options: Options): string[] {
return [
'prettier . --ignore-unknown' + (options.fix ? ' --write' : ' --check'),
'eslint . --config src/.eslintrc.js' + (options.fix ? ' --fix' : ''),
// TODO(goodov): Add a command to lint JSON studies when per-file structure
// appears.
// TODO(goodov): Enable when per-file structure appears.
// 'npm run seed_tools lint --' + (options.fix ? ' --fix' : ''),
];
}

Expand All @@ -53,7 +53,7 @@ function getLintDiffCommands(options: Options): Record<string, any> {
'*.{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' : ''),
};
}

Expand Down
8 changes: 6 additions & 2 deletions src/seed_tools/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('<studies_dir>', 'path to the directory containing study files')
.argument('<output_seed_file>', '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 <value>', 'mock serial number')
.option(
'--output_serial_number_file <path>',
Expand Down
6 changes: 5 additions & 1 deletion src/seed_tools/commands/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('<studies_dir>', '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);
}
Expand Down