@@ -37,7 +37,13 @@ const (
3737)
3838
3939// RunTflintWithOpts runs tflint with the given options and returns an error if there are any issues.
40- func RunTflintWithOpts (ctx context.Context , l log.Logger , opts * TFLintOptions , cfg * runcfg.RunConfig , hook * runcfg.Hook ) error {
40+ func RunTflintWithOpts (
41+ ctx context.Context ,
42+ l log.Logger ,
43+ opts * TFLintOptions ,
44+ cfg * runcfg.RunConfig ,
45+ hook * runcfg.Hook ,
46+ ) error {
4147 hookExecute := slices .Clone (hook .Execute )
4248 hookExecute = slices .DeleteFunc (hookExecute , func (arg string ) bool {
4349 return arg == tfExternalTFLint
@@ -49,7 +55,8 @@ func RunTflintWithOpts(ctx context.Context, l log.Logger, opts *TFLintOptions, c
4955 return err
5056 }
5157
52- l .Debugf ("Using .tflint.hcl file in %s" , util .RelPathForLog (opts .RootWorkingDir , configFile , opts .Writers .LogShowAbsPaths ))
58+ l .Debugf ("Using .tflint.hcl file in %s" ,
59+ util .RelPathForLog (opts .RootWorkingDir , configFile , opts .Writers .LogShowAbsPaths ))
5360
5461 variables , err := InputsToTflintVar (cfg .Inputs )
5562 if err != nil {
@@ -235,8 +242,9 @@ func tfArgumentsToTflintVar(l log.Logger, hook *runcfg.Hook,
235242 return variables , nil
236243}
237244
238- // findTflintConfigInProject looks for a .tflint.hcl file in the current folder or it's parents.
239- // When running from cache, we start searching from the original config directory to find config in the source directory.
245+ // findTflintConfigInProject looks for a .tflint.hcl file in the current
246+ // folder or it's parents. When running from cache, we start searching
247+ // from the original config directory to find config in the source directory.
240248func findTflintConfigInProject (l log.Logger , opts * TFLintOptions ) (string , error ) {
241249 startDir := opts .WorkingDir
242250 if opts .TerragruntConfigPath != "" {
@@ -259,7 +267,9 @@ func findTflintConfigInProject(l log.Logger, opts *TFLintOptions) (string, error
259267
260268 fileToFind := filepath .Join (previousDir , ".tflint.hcl" )
261269 if util .FileExists (fileToFind ) {
262- l .Debugf ("Found .tflint.hcl in %s" , util .RelPathForLog (opts .RootWorkingDir , fileToFind , opts .Writers .LogShowAbsPaths ))
270+ l .Debugf ("Found .tflint.hcl in %s" ,
271+ util .RelPathForLog (opts .RootWorkingDir , fileToFind , opts .Writers .LogShowAbsPaths ))
272+
263273 return fileToFind , nil
264274 }
265275
0 commit comments