Accept Clippy flags

This commit is contained in:
Takayuki Nakata 2022-11-09 22:22:37 +09:00
parent 1220ab17a8
commit a1bead11ea
3 changed files with 2 additions and 2 deletions

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View file

@ -13,6 +13,7 @@ async function run(): Promise<void> {
try { try {
const reviewdogVersion = core.getInput('reviewdog_version') || 'latest' const reviewdogVersion = core.getInput('reviewdog_version') || 'latest'
const toolName = core.getInput('tool_name') || 'clippy' const toolName = core.getInput('tool_name') || 'clippy'
const clippyFlags = core.getInput('clippy_flags');
const level = core.getInput('level') || 'error' const level = core.getInput('level') || 'error'
const reporter = core.getInput('reporter') || 'github-pr-check' const reporter = core.getInput('reporter') || 'github-pr-check'
const filterMode = core.getInput('filter_mode') || 'added' const filterMode = core.getInput('filter_mode') || 'added'
@ -37,7 +38,7 @@ async function run(): Promise<void> {
const output: string[] = [] const output: string[] = []
await exec.exec( await exec.exec(
'cargo', 'cargo',
['clippy', '--color', 'never', '-q', '--message-format', 'json'], ['clippy', '--color', 'never', '-q', '--message-format', 'json', ...parse(clippyFlags)],
{ {
cwd, cwd,
ignoreReturnCode: true, ignoreReturnCode: true,
@ -128,7 +129,6 @@ function parse(flags: string): string[] {
return [] return []
} }
// TODO: need to simulate bash?
return flags.split(/\s+/) return flags.split(/\s+/)
} }