Skip to content

Commit

Permalink
Merge pull request #2 from tyler-technologies-oss/file-path-allowlist
Browse files Browse the repository at this point in the history
Uncommitted scan - check global allowlist before other rules
  • Loading branch information
mattbartel-tyler authored Mar 23, 2021
2 parents c8c1321 + 98a6b75 commit e8494db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scan/unstaged.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ func (us *UnstagedScanner) Scan() (Report, error) {
continue
}

if us.cfg.Allowlist.FileAllowed(filepath.Base(fn)) ||
us.cfg.Allowlist.PathAllowed(fn) {
// file or path is allowlisted, no need to compute diff or check other rules
continue
}

if state.Staging != git.Untracked {
if state.Staging == git.Deleted {
// file in staging has been deleted, aka it is not on the filesystem
Expand Down

0 comments on commit e8494db

Please sign in to comment.