mirror of
https://github.com/giraffate/clippy-action.git
synced 2024-11-24 00:49:33 +01:00
Accept Clippy flags
This commit is contained in:
parent
1220ab17a8
commit
a1bead11ea
3 changed files with 2 additions and 2 deletions
BIN
dist/index.js
generated
vendored
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
|
@ -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+/)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue