mirror of
https://github.com/securego/gosec.git
synced 2025-11-25 22:22:17 +02:00
Fix no-sec alternative tag (#962)
The no-sec alternative tag prepends now automatically the # symbol Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
This commit is contained in:
@@ -449,10 +449,12 @@ func (gosec *Analyzer) ignore(n ast.Node) map[string]issue.SuppressionInfo {
|
||||
if groups, ok := gosec.context.Comments[n]; ok && !gosec.ignoreNosec {
|
||||
|
||||
// Checks if an alternative for #nosec is set and, if not, uses the default.
|
||||
noSecDefaultTag := "#nosec"
|
||||
noSecDefaultTag := NoSecTag(string(Nosec))
|
||||
noSecAlternativeTag, err := gosec.config.GetGlobal(NoSecAlternative)
|
||||
if err != nil {
|
||||
noSecAlternativeTag = noSecDefaultTag
|
||||
} else {
|
||||
noSecAlternativeTag = NoSecTag(noSecAlternativeTag)
|
||||
}
|
||||
|
||||
for _, group := range groups {
|
||||
|
||||
Reference in New Issue
Block a user