File tree Expand file tree Collapse file tree 4 files changed +58
-1
lines changed
test_data/replace-terraform-version Expand file tree Collapse file tree 4 files changed +58
-1
lines changed Original file line number Diff line number Diff line change @@ -398,14 +398,16 @@ func getDefaultHeadersToSkip() []*regexp.Regexp {
398398 regexp .MustCompile ("[Dd]ebugging" ),
399399 regexp .MustCompile ("[Tt]erraform CLI" ),
400400 regexp .MustCompile ("[Tt]erraform Cloud" ),
401+ regexp .MustCompile ("Delete Protection" ),
401402 }
402403 return defaultHeaderSkipRegexps
403404}
404405
405406func getTfVersionsToRemove () []* regexp.Regexp {
406407 tfVersionsToRemove := []* regexp.Regexp {
407- regexp .MustCompile (`It requires [tT]erraform [v0-9]+\.?[0-9]?\.?[0-9]? or later.` ),
408+ regexp .MustCompile (`(It|This provider) requires( at least)? [tT]erraform [v0-9]+\.?[0-9]?\.?[0-9]?( or later)? .` ),
408409 regexp .MustCompile (`(?s)(For )?[tT]erraform [v0-9]+\.?[0-9]?\.?[0-9]? and (later|earlier):` ),
410+ regexp .MustCompile (`A minimum of [tT]erraform [v0-9]+\.?[0-9]?\.?[0-9]? is recommended.` ),
409411 }
410412 return tfVersionsToRemove
411413}
Original file line number Diff line number Diff line change @@ -278,6 +278,34 @@ func TestApplyEditRules(t *testing.T) {
278278 },
279279 expected : []byte ("This is a provider with an example.\n Use this code." ),
280280 },
281+ {
282+ name : "Strips mentions of Terraform version pattern 6" ,
283+ docFile : DocFile {
284+ Content : []byte ("This provider requires at least Terraform 1.0." ),
285+ },
286+ expected : []byte ("" ),
287+ },
288+ {
289+ name : "Strips mentions of Terraform version pattern 7" ,
290+ docFile : DocFile {
291+ Content : []byte ("This provider requires Terraform 1.0." ),
292+ },
293+ expected : []byte ("" ),
294+ },
295+ {
296+ name : "Strips mentions of Terraform version pattern 8" ,
297+ docFile : DocFile {
298+ Content : []byte ("A minimum of Terraform 1.4.0 is recommended." ),
299+ },
300+ expected : []byte ("" ),
301+ },
302+ {
303+ name : "Strips mentions of Terraform version With Surrounding Text" ,
304+ docFile : DocFile {
305+ Content : []byte (readfile (t , "test_data/replace-terraform-version/input.md" )),
306+ },
307+ expected : []byte (readfile (t , "test_data/replace-terraform-version/expected.md" )),
308+ },
281309 }
282310 for _ , tt := range tests {
283311 tt := tt
Original file line number Diff line number Diff line change 1+ Use the GitLab provider to interact with GitLab resources, like
2+ users, groups, projects and more. You must configure the provider with
3+ the proper credentials before you can use it.
4+
5+ The provider uses the [ ` xanzy/go-gitlab ` ] ( https://github.com/xanzy/go-gitlab ) library
6+ to interact with the [ GitLab REST API] ( https://docs.gitlab.com/ee/api/api_resources.html ) .
7+
8+ Each data source and resource references the appropriate upstream GitLab REST API documentation,
9+ which may be consumed to better understand the behavior of the API.
10+
11+ Use the navigation to the left to read about the valid data sources and resources.
Original file line number Diff line number Diff line change 1+ Use the GitLab provider to interact with GitLab resources, like
2+ users, groups, projects and more. You must configure the provider with
3+ the proper credentials before you can use it.
4+
5+ The provider uses the [ ` xanzy/go-gitlab ` ] ( https://github.com/xanzy/go-gitlab ) library
6+ to interact with the [ GitLab REST API] ( https://docs.gitlab.com/ee/api/api_resources.html ) .
7+
8+ This provider requires Terraform 1.0.
9+
10+ Each data source and resource references the appropriate upstream GitLab REST API documentation,
11+ which may be consumed to better understand the behavior of the API.
12+
13+ Use the navigation to the left to read about the valid data sources and resources.
14+
15+ This provider requires at least [ Terraform 1.0] ( https://www.terraform.io/downloads.html ) .
16+ A minimum of Terraform 1.4.0 is recommended.
You can’t perform that action at this time.
0 commit comments