diff --git a/cmd/option.go b/cmd/option.go index 0aacc421e..d95f4f02a 100644 --- a/cmd/option.go +++ b/cmd/option.go @@ -1,7 +1,9 @@ package cmd import ( + "fmt" "log" + "os" "strings" "github.com/terraform-linters/tflint/terraform" @@ -59,10 +61,12 @@ func (opts *Options) toConfig() *tflint.Config { callModuleTypeSet := false // --call-module-type takes precedence over --module/--no-module. This is for backward compatibility. if opts.Module != nil { + fmt.Fprintln(os.Stderr, "WARNING: --module is deprecated. Use --call-module-type=all instead.") callModuleType = terraform.CallAllModule callModuleTypeSet = true } if opts.NoModule != nil { + fmt.Fprintln(os.Stderr, "WARNING: --no-module is deprecated. Use --call-module-type=none instead.") callModuleType = terraform.CallNoModule callModuleTypeSet = true } diff --git a/tflint/config.go b/tflint/config.go index 477b34191..c0462a37c 100644 --- a/tflint/config.go +++ b/tflint/config.go @@ -252,6 +252,7 @@ func loadConfig(file afero.File) (*Config, error) { // "module" attribute is deprecated. Use "call_module_type" instead. // This is for backward compatibility. case "module": + fmt.Fprintf(os.Stderr, "WARNING: \"module\" attribute in %s is deprecated. Use \"call_module_type\" instead.\n", file.Name()) if config.CallModuleTypeSet { // If "call_module_type" is set, ignore "module" attribute continue