Skip to content

Commit

Permalink
adjust order of events
Browse files Browse the repository at this point in the history
  • Loading branch information
guineveresaenger committed Sep 20, 2024
1 parent 14b9056 commit 507aa1b
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions pkg/tfgen/installation_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,19 @@ import (
)

func plainDocsParser(docFile *DocFile, g *Generator) ([]byte, error) {

// Apply provider-supplied edit rules.
// Some of these may want to affect the code blocks themselves, so they should happen before code conversion.
contentBytes, err := applyProviderEditRules(docFile.Content, docFile.FileName, g)

Check failure on line 28 in pkg/tfgen/installation_docs.go

View workflow job for this annotation

GitHub Actions / Test and Lint / lint

ineffectual assignment to err (ineffassign)

// Get file content without front matter
content := trimFrontMatter(docFile.Content)
content := trimFrontMatter(contentBytes)
// Add pulumi-specific front matter
// Generate pulumi-specific front matter
frontMatter := writeFrontMatter(g.info.Name)

Check failure on line 35 in pkg/tfgen/installation_docs.go

View workflow job for this annotation

GitHub Actions / Test and Lint / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/pulumi/pulumi-terraform-bridge) (gci)
// Remove the title. A title gets populated from Hugo frontmatter; we do not want two.
content, err := removeTitle(content)
content, err = removeTitle(content)
if err != nil {
return nil, err
}
Expand All @@ -44,13 +49,14 @@ func plainDocsParser(docFile *DocFile, g *Generator) ([]byte, error) {

// Add instructions to top of file
contentStr := frontMatter + installationInstructions + overviewHeader + string(content)
//panic(contentStr)

// Apply provider-supplied edit rules.
// Some of these may want to affect the code blocks themselves, so they should happen before code conversion.
contentBytes, err := applyProviderEditRules([]byte(contentStr), docFile.FileName, g)
//// Apply provider-supplied edit rules.
//// Some of these may want to affect the code blocks themselves, so they should happen before code conversion.
//contentBytes, err := applyProviderEditRules([]byte(contentStr), docFile.FileName, g)

//Translate code blocks to Pulumi
contentStr, err = translateCodeBlocks(string(contentBytes), g)
contentStr, err = translateCodeBlocks(contentStr, g)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 507aa1b

Please sign in to comment.