Skip to content

Commit

Permalink
Merge pull request securego#99 from mcpeak/fix-nosec
Browse files Browse the repository at this point in the history
Fix nosec to work as documented
  • Loading branch information
gcmurphy committed Dec 2, 2016
2 parents 3911321 + 942f40a commit 365e9f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ func (gas *Analyzer) ProcessSource(filename string, source string) error {
return err
}

// ignore a node (and sub-tree) if it is tagged with a "nosec" comment
// ignore a node (and sub-tree) if it is tagged with a "#nosec" comment
func (gas *Analyzer) ignore(n ast.Node) bool {
if groups, ok := gas.context.Comments[n]; ok && !gas.ignoreNosec {
for _, group := range groups {
if strings.Contains(group.Text(), "nosec") {
if strings.Contains(group.Text(), "#nosec") {
gas.Stats.NumNosec++
return true
}
Expand Down

0 comments on commit 365e9f6

Please sign in to comment.