12345678910111213141516171819202122232425262728 |
- #!/usr/bin/env zx
- import 'zx/globals';
- import {
- cliArguments,
- getToolchainArgument,
- popArgument,
- workingDirectory,
- } from '../utils.mjs';
- // Configure additional arguments here, e.g.:
- // ['--arg1', '--arg2', ...cliArguments()]
- const lintArgs = cliArguments();
- const fix = popArgument(lintArgs, '--fix');
- const toolchain = getToolchainArgument('format');
- const manifestPath = path.join(
- workingDirectory,
- 'clients',
- 'rust',
- 'Cargo.toml'
- );
- // Check the client using Clippy.
- if (fix) {
- await $`cargo ${toolchain} clippy --manifest-path ${manifestPath} --fix ${lintArgs}`;
- } else {
- await $`cargo ${toolchain} clippy --manifest-path ${manifestPath} ${lintArgs}`;
- }
|