diff --git a/internal/ignorefiles/terraformignore.go b/internal/ignorefiles/terraformignore.go index 978d6de..df7d569 100644 --- a/internal/ignorefiles/terraformignore.go +++ b/internal/ignorefiles/terraformignore.go @@ -171,18 +171,20 @@ func (r *rule) compile() error { var defaultExclusions = []rule{ { - val: strings.Join([]string{"**", ".git", "**"}, string(os.PathSeparator)), + val: strings.Join([]string{"**", ".terraform", "**"}, string(os.PathSeparator)), negated: false, negationsAfter: true, }, + // Place negation rules as high as possible in the list { - val: strings.Join([]string{"**", ".terraform", "**"}, string(os.PathSeparator)), - negated: false, - negationsAfter: true, + val: strings.Join([]string{"**", ".terraform", "modules", "**"}, string(os.PathSeparator)), + negated: true, + negationsAfter: false, }, { - val: strings.Join([]string{"**", ".terraform", "modules", "**"}, string(os.PathSeparator)), - negated: true, + val: strings.Join([]string{"**", ".git", "**"}, string(os.PathSeparator)), + negated: false, + negationsAfter: false, }, }