Skip to content

Commit

Permalink
Make pragmas take priority over file names (#21)
Browse files Browse the repository at this point in the history
Co-authored-by: Tushar Sadhwani <[email protected]>
  • Loading branch information
akshit-deepsource and tushar-deepsource authored Mar 13, 2023
1 parent b234906 commit 3588bc1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/scatr/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/spf13/cobra"
)

const version = "0.4.0"
const version = "0.4.1"

var versionCmd = &cobra.Command{
Use: "version",
Expand Down
6 changes: 6 additions & 0 deletions runner/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ func matchFileNameIssueCodes(files map[string]*pragma.File, analysisResult *Resu
}

for _, file := range files {
// If the file already has an ignore/check pragma, that takes priority.
// Don't check its file name in that case.
if file.CheckMode != pragma.CheckAll {
continue
}

_, exists := analysisIssueCodes[file.Name]
if !exists {
continue
Expand Down

0 comments on commit 3588bc1

Please sign in to comment.