|
8 | 8 | "strings"
|
9 | 9 |
|
10 | 10 | "github.com/hashicorp/hcl/v2"
|
11 |
| - "github.com/mitchellh/colorstring" |
12 | 11 | )
|
13 | 12 |
|
14 | 13 | type DirectoryDeprecationInfo struct {
|
@@ -69,16 +68,10 @@ func (i *ModuleVersionDeprecationInfo) hasDeprecations() bool {
|
69 | 68 | // as well as placed in the Diagnostic Extra for parsing for the SRO view in HCP Terraform
|
70 | 69 | func (i *DirectoryDeprecationInfo) BuildDeprecationWarning() *hcl.Diagnostic {
|
71 | 70 | modDeprecations := []string{}
|
72 |
| - color := colorstring.Colorize{ |
73 |
| - Colors: colorstring.DefaultColors, |
74 |
| - Disable: false, |
75 |
| - Reset: true, |
76 |
| - } |
77 | 71 | deprecationList := make([]*ModuleVersionDeprecationDiagnosticExtraDeprecationItem, 0, len(i.ModuleVersionDeprecationInfos))
|
78 | 72 | for _, modDeprecationInfo := range i.ModuleVersionDeprecationInfos {
|
79 | 73 | if modDeprecationInfo != nil && modDeprecationInfo.RegistryDeprecation != nil {
|
80 |
| - msg := color.Color("[reset][bold]Version %s of %s[reset]") |
81 |
| - modDeprecation := fmt.Sprintf(msg, modDeprecationInfo.RegistryDeprecation.Version, modDeprecationInfo.SourceName) |
| 74 | + modDeprecation := fmt.Sprintf("[reset][bold]Version %s of %s[reset]", modDeprecationInfo.RegistryDeprecation.Version, modDeprecationInfo.SourceName) |
82 | 75 | // Link and Message are optional fields, if unset they are an empty string by default
|
83 | 76 | if modDeprecationInfo.RegistryDeprecation.Message != "" {
|
84 | 77 | modDeprecation = modDeprecation + fmt.Sprintf("\n\n%s", modDeprecationInfo.RegistryDeprecation.Message)
|
@@ -112,17 +105,11 @@ func (i *DirectoryDeprecationInfo) BuildDeprecationWarning() *hcl.Diagnostic {
|
112 | 105 | }
|
113 | 106 |
|
114 | 107 | func buildChildModuleDeprecations(modDeprecations []*ModuleVersionDeprecationInfo, parentMods []string) ([]string, []*ModuleVersionDeprecationDiagnosticExtraDeprecationItem) {
|
115 |
| - color := colorstring.Colorize{ |
116 |
| - Colors: colorstring.DefaultColors, |
117 |
| - Disable: false, |
118 |
| - Reset: true, |
119 |
| - } |
120 | 108 | modDeprecationStrings := []string{}
|
121 | 109 | var deprecationList []*ModuleVersionDeprecationDiagnosticExtraDeprecationItem
|
122 | 110 | for _, deprecation := range modDeprecations {
|
123 | 111 | if deprecation.RegistryDeprecation != nil {
|
124 |
| - msg := color.Color("[reset][bold]Version %s of %s %s[reset]") |
125 |
| - modDeprecation := fmt.Sprintf(msg, deprecation.RegistryDeprecation.Version, deprecation.SourceName, buildModHierarchy(parentMods, deprecation.SourceName)) |
| 112 | + modDeprecation := fmt.Sprintf("[reset][bold]Version %s of %s %s[reset]", deprecation.RegistryDeprecation.Version, deprecation.SourceName, buildModHierarchy(parentMods, deprecation.SourceName)) |
126 | 113 | // Link and Message are optional fields, if unset they are an empty string by default
|
127 | 114 | if deprecation.RegistryDeprecation.Message != "" {
|
128 | 115 | modDeprecation = modDeprecation + fmt.Sprintf("\n\n%s", deprecation.RegistryDeprecation.Message)
|
|
0 commit comments