From ae227181b2917ea4a972a56cf1da072dd161fe33 Mon Sep 17 00:00:00 2001 From: Georgi Dankov Date: Tue, 16 Oct 2018 15:57:09 +0300 Subject: [PATCH] Add an option to ignore tests --- parser.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parser.go b/parser.go index ab5f99a..9c8a80b 100644 --- a/parser.go +++ b/parser.go @@ -146,10 +146,11 @@ type Config struct { MatchWithConstants bool MinStringLength int MinOccurrences int + IgnoreTests bool } func Run(files []*ast.File, fset *token.FileSet, cfg *Config) ([]Issue, error) { - p := New("", "", false, cfg.MatchWithConstants, false, cfg.MinStringLength) + p := New("", "", cfg.IgnoreTests, cfg.MatchWithConstants, false, cfg.MinStringLength) var issues []Issue for _, f := range files { ast.Walk(&treeVisitor{