8000 diff filtering for SARIF input is broken if executed within subdirectories · Issue #2105 · reviewdog/reviewdog · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
diff filtering for SARIF input is broken if executed within subdirectories #2105
Open
@wafrelka

Description

@wafrelka

The diff filtering feature of reviewdog does not work correctly under the following conditions:

  • The input format is SARIF (-f sarif).
  • The current working directory is a subdirectory within a git project.

Due to this, github-* reporters remain silent for SARIF inputs. I encountered this issue while investigating reviewdog/action-trivy#74.

It appears that the issue arises because the SARIF parser and the rest of the codebase interpret relative paths differently. The SARIF parser in reviewdog creates Diagnostics with file locations relative to the git root. However, the rest of the codebase treats file locations within Diagnostics as relative to the current working directory.

if root, err := serviceutil.GetGitRoot(); err == nil {
basedir = root
}

pathutil.NormalizePathInResults(results, wd)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0