diff --git a/dist/index.js b/dist/index.js index 0a94336..056e5e5 100644 Binary files a/dist/index.js and b/dist/index.js differ diff --git a/dist/index.js.map b/dist/index.js.map index 59c7484..cef6ec6 100644 Binary files a/dist/index.js.map and b/dist/index.js.map differ diff --git a/src/main.ts b/src/main.ts index 393847d..4ffa283 100644 --- a/src/main.ts +++ b/src/main.ts @@ -13,7 +13,7 @@ async function run(): Promise { try { const reviewdogVersion = core.getInput('reviewdog_version') || 'latest' const toolName = core.getInput('tool_name') || 'clippy' - const clippyFlags = core.getInput('clippy_flags'); + const clippyFlags = core.getInput('clippy_flags') const level = core.getInput('level') || 'error' const reporter = core.getInput('reporter') || 'github-pr-check' const filterMode = core.getInput('filter_mode') || 'added' @@ -38,7 +38,15 @@ async function run(): Promise { const output: string[] = [] await exec.exec( 'cargo', - ['clippy', '--color', 'never', '-q', '--message-format', 'json', ...parse(clippyFlags)], + [ + 'clippy', + '--color', + 'never', + '-q', + '--message-format', + 'json', + ...parse(clippyFlags) + ], { cwd, ignoreReturnCode: true, @@ -64,11 +72,13 @@ async function run(): Promise { core.debug('this is a compiler-message!') const span = content.message.spans[0] + const messageLevel = + content.message.level === 'warning' ? 'w' : 'e' const rendered = reporter === 'github-pr-review' ? ` \n
${content.message.rendered}
\n__END__` : `${content.message.rendered}\n__END__` - const ret = `${span.file_name}:${span.line_start}:${span.column_start}:${rendered}` + const ret = `${span.file_name}:${span.line_start}:${span.column_start}:${messageLevel}:${rendered}` output.push(ret) } } @@ -80,8 +90,10 @@ async function run(): Promise { return await exec.exec( reviewdog, [ - '-efm=%E%f:%l:%c:%m', + '-efm=
%E%f:%l:%c:%t:%m',
+            '-efm=%E%f:%l:%c:%t:%m',
             '-efm=%Z__END__',
+            '-efm=%C%m
', '-efm=%C%m', '-efm=%C', `-name=${toolName}`,