skip warnings on commented out and empty lines
parent
4e486b3b07
commit
7b2db4ca87
|
@ -39,6 +39,9 @@ func (r *DriftIgnore) readIgnoreFile() error {
|
||||||
line := scanner.Text()
|
line := scanner.Text()
|
||||||
typeVal := readDriftIgnoreLine(line)
|
typeVal := readDriftIgnoreLine(line)
|
||||||
nbArgs := len(typeVal)
|
nbArgs := len(typeVal)
|
||||||
|
if nbArgs == 0 || strings.HasPrefix(line, "#") {
|
||||||
|
continue // skip empty or commented out lines
|
||||||
|
} else {
|
||||||
if nbArgs < 2 {
|
if nbArgs < 2 {
|
||||||
logrus.WithFields(logrus.Fields{
|
logrus.WithFields(logrus.Fields{
|
||||||
"line": line,
|
"line": line,
|
||||||
|
@ -70,6 +73,7 @@ func (r *DriftIgnore) readIgnoreFile() error {
|
||||||
ignoreSublist = append(ignoreSublist, path)
|
ignoreSublist = append(ignoreSublist, path)
|
||||||
r.driftExclusionList[res] = ignoreSublist
|
r.driftExclusionList[res] = ignoreSublist
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err := scanner.Err(); err != nil {
|
if err := scanner.Err(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue