Skip to content

Commit 89f65fb

Browse files
feat(exec): prevent misinterpreting paths as options (#11)
Signed-off-by: Shigure Kurosaki <shigure@hqsy.net>
1 parent 38cfa10 commit 89f65fb

File tree

14 files changed

+14
-13
lines changed

14 files changed

+14
-13
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/formatters/prettier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export async function runner(
1313

1414
info(`[runner] Checking ${paths.length} files with ${name}`)
1515

16-
await exec(name, ['--check', ...options, ...paths])
16+
await exec(name, ['--check', ...options, '--', ...paths])
1717
}

src/formatters/shfmt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ export async function runner(
1515

1616
info(`[runner] Checking ${paths.length} files with ${name}`)
1717

18-
await exec('sh', ['-c', cli, '--diff', ...options, ...paths])
18+
await exec('sh', ['-c', cli, '--diff', ...options, '--', ...paths])
1919
}

src/formatters/taplo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export async function runner(
1313

1414
info(`[runner] Checking ${paths.length} files with ${name}`)
1515

16-
await exec(name, ['fmt', '--check', ...options, ...paths])
16+
await exec(name, ['fmt', '--check', ...options, '--', ...paths])
1717
}

src/linters/actionlint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ export async function runner(
1515

1616
info(`[runner] Checking ${paths.length} files with ${name}`)
1717

18-
await exec('sh', ['-c', cli, ...options, ...paths])
18+
await exec('sh', ['-c', cli, ...options, '--', ...paths])
1919
}

src/linters/alex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export async function runner(
1313

1414
info(`[runner] Checking ${paths.length} files with ${name}`)
1515

16-
await exec(name, [...options, ...paths])
16+
await exec(name, [...options, '--', ...paths])
1717
}

src/linters/ast-grep.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export async function runner(
1313

1414
info(`[runner] Checking ${paths.length} files with ${name}`)
1515

16-
await exec(name.replace('_', '-'), ['scan', ...options, ...paths])
16+
await exec(name.replace('_', '-'), ['scan', ...options, '--', ...paths])
1717
}

src/linters/eslint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ export async function runner(
1414
info(`[runner] Checking ${paths.length} files with ${name}`)
1515

1616
await exec('nci', ['--dev'])
17-
await exec(name, [...options, ...paths])
17+
await exec(name, [...options, '--', ...paths])
1818
}

src/linters/markdownlint-cli2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export async function runner(
1313

1414
info(`[runner] Checking ${paths.length} files with ${name}`)
1515

16-
await exec(name.replace('_', '-'), [...options, ...paths])
16+
await exec(name.replace('_', '-'), [...options, '--', ...paths])
1717
}

src/linters/shellcheck.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export async function runner(
2222
'"$PWD:/mnt"',
2323
`koalaman/${name}:${tag}`,
2424
...options,
25+
'--',
2526
...paths,
2627
])
2728
}

0 commit comments

Comments
 (0)