Skip to content

Commit

Permalink
Remove deprecated IncludeNotCreated option (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
wata727 authored Jul 29, 2023
1 parent ee6dcd7 commit 069cad7
Show file tree
Hide file tree
Showing 6 changed files with 332 additions and 356 deletions.
7 changes: 3 additions & 4 deletions plugin/internal/fromproto/fromproto.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,9 @@ func GetModuleContentOption(opts *proto.GetModuleContent_Option) tflint.GetModul
}

return tflint.GetModuleContentOption{
ModuleCtx: ModuleCtxType(opts.ModuleCtx),
IncludeNotCreated: opts.IncludeNotCreated,
ExpandMode: ExpandMode(opts.ExpandMode),
Hint: GetModuleContentHint(opts.Hint),
ModuleCtx: ModuleCtxType(opts.ModuleCtx),
ExpandMode: ExpandMode(opts.ExpandMode),
Hint: GetModuleContentHint(opts.Hint),
}
}

Expand Down
12 changes: 3 additions & 9 deletions plugin/internal/plugin2host/plugin2host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -651,10 +651,9 @@ volume_size = 10`)
Name: "get content with options",
Args: func() (*hclext.BodySchema, *tflint.GetModuleContentOption) {
return &hclext.BodySchema{}, &tflint.GetModuleContentOption{
ModuleCtx: tflint.RootModuleCtxType,
IncludeNotCreated: true,
ExpandMode: tflint.ExpandModeNone,
Hint: tflint.GetModuleContentHint{ResourceType: "aws_instance"},
ModuleCtx: tflint.RootModuleCtxType,
ExpandMode: tflint.ExpandModeNone,
Hint: tflint.GetModuleContentHint{ResourceType: "aws_instance"},
}
},
ServerImpl: func(schema *hclext.BodySchema, opts tflint.GetModuleContentOption) (*hclext.BodyContent, hcl.Diagnostics) {
Expand All @@ -663,11 +662,6 @@ volume_size = 10`)
&hcl.Diagnostic{Severity: hcl.DiagError, Summary: "unexpected moduleCtx options"},
}
}
if !opts.IncludeNotCreated {
return &hclext.BodyContent{}, hcl.Diagnostics{
&hcl.Diagnostic{Severity: hcl.DiagError, Summary: "unexpected includeNotCreatedResources options"},
}
}
if opts.ExpandMode != tflint.ExpandModeNone {
return &hclext.BodyContent{}, hcl.Diagnostics{
&hcl.Diagnostic{Severity: hcl.DiagError, Summary: "unexpected expand mode options"},
Expand Down
Loading

0 comments on commit 069cad7

Please sign in to comment.