Skip to content

Commit fd16090

Browse files
committed
file matchers2
1 parent 917c4a2 commit fd16090

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

internal/configs/parser_file_processor.go renamed to internal/configs/parser_file_matchers.go

+5-12
Original file line numberDiff line numberDiff line change
@@ -130,30 +130,23 @@ func (p *Parser) rootFiles(dir string, matchers []FileMatcher, fileSet *ConfigFi
130130
return diags
131131
}
132132

133-
// WithFileHandler adds a file matcher to the parser
134-
func WithFileHandler(matcher FileMatcher) Option {
135-
return func(o *Options) {
136-
o.matchers = append(o.matchers, matcher)
137-
}
138-
}
139-
140133
// WithTestFiles adds a matcher for Terraform test files (.tftest.hcl and .tftest.json)
141134
func WithTestFiles(dir string) Option {
142135
return func(o *Options) {
143136
o.testDirectory = dir
144-
WithFileHandler(&testFiles{})(o)
137+
o.matchers = append(o.matchers, &testFiles{})
145138
}
146139
}
147140

148141
// WithQueryFiles adds a matcher for Terraform query files (.tfquery.hcl)
149142
func WithQueryFiles() Option {
150-
return WithFileHandler(&queryFiles{})
143+
return func(o *Options) {
144+
o.matchers = append(o.matchers, &queryFiles{})
145+
}
151146
}
152147

153148
// moduleFiles processes regular Terraform configuration files (.tf and .tf.json)
154-
type moduleFiles struct {
155-
overrideOnly bool
156-
}
149+
type moduleFiles struct{}
157150

158151
func (m *moduleFiles) Matches(name string) bool {
159152
ext := fileExt(name)

0 commit comments

Comments
 (0)