Skip to content

Commit

Permalink
Merge pull request bflad#3 from YakDriver/b-add-data-source-header
Browse files Browse the repository at this point in the history
Add data source friendly header
  • Loading branch information
YakDriver authored Jun 30, 2023
2 parents 6970117 + 0b692e3 commit 9db8673
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions check/contents/check_attributes_section.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,19 @@ func (d *Document) checkAttributesSection() error {
paragraphs := section.Paragraphs
expectedBylineTexts := []string{
"This resource exports the following attributes in addition to the arguments above:",
"This data source exports the following attributes in addition to the arguments above:",
"In addition to all arguments above, the following attributes are exported:",
"No additional attributes are exported.",
}

switch len(paragraphs) {
case 0:
return fmt.Errorf("attribute section byline should be: %q (preferred), %q or %q", expectedBylineTexts[0], expectedBylineTexts[1], expectedBylineTexts[2])
return fmt.Errorf("attribute section byline should be: %q, %q, %q, or %q", expectedBylineTexts[0], expectedBylineTexts[1], expectedBylineTexts[2], expectedBylineTexts[3])
case 1:
paragraphText := string(paragraphs[0].Text(d.source))

if paragraphText != expectedBylineTexts[0] && paragraphText != expectedBylineTexts[1] && paragraphText != expectedBylineTexts[2] {
return fmt.Errorf("attribute section byline (%s) should be: %q (preferred), %q or %q", paragraphText, expectedBylineTexts[0], expectedBylineTexts[1], expectedBylineTexts[2])
if paragraphText != expectedBylineTexts[0] && paragraphText != expectedBylineTexts[1] && paragraphText != expectedBylineTexts[2] && paragraphText != expectedBylineTexts[3] {
return fmt.Errorf("attribute section byline (%s) should be: %q, %q, %q, or %q", paragraphText, expectedBylineTexts[0], expectedBylineTexts[1], expectedBylineTexts[2], expectedBylineTexts[3])
}
}

Expand Down

0 comments on commit 9db8673

Please sign in to comment.