Skip to content

Commit

Permalink
Add another TF version pattern to removal regexes (#2531)
Browse files Browse the repository at this point in the history
This pull request adds another pattern to the `getTfVersionsToRemove`
regex collection. Ths one has back ticks around the version number.

Addresses a pattern found in confluentcloud provider.
  • Loading branch information
guineveresaenger authored Oct 30, 2024
1 parent c233576 commit b2722f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/tfgen/edit_rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,15 @@ func TestApplyEditRules(t *testing.T) {
expected: []byte(readfile(t, "test_data/replace-terraform-version/expected.md")),
phase: info.PostCodeTranslation,
},
{
// Found in confluentcloud
name: "Strips mentions of Terraform version With Backticks",
docFile: DocFile{
Content: []byte("Terraform `v0.13` and later:"),
},
expected: []byte(""),
phase: info.PostCodeTranslation,
},
{
// Found in linode
name: "Rewrites providers.tf to Pulumi.yaml",
Expand Down
1 change: 1 addition & 0 deletions pkg/tfgen/installation_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ func getTfVersionsToRemove() []*regexp.Regexp {
regexp.MustCompile(`(It|This provider) requires( at least)? [tT]erraform [v0-9]+\.?[0-9]?\.?[0-9]?( or later)?.`),
regexp.MustCompile(`(?s)(For )?[tT]erraform [v0-9]+\.?[0-9]?\.?[0-9]? and (later|earlier):`),
regexp.MustCompile(`A minimum of [tT]erraform [v0-9]+\.?[0-9]?\.?[0-9]? is recommended.`),
regexp.MustCompile("[tT]erraform `[v0-9.]+` (and|or) later:"),
}
return tfVersionsToRemove
}
Expand Down

0 comments on commit b2722f6

Please sign in to comment.