Skip to content

Commit

Permalink
Add test cases to cover a paragraph after a list (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
trask authored Dec 6, 2024
1 parent 4cb5868 commit 03e0f51
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ groups:
it's RECOMMENDED to:
* Use a domain-specific attribute
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not
And something more.
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ groups:
it's RECOMMENDED to:
* Use a domain-specific attribute
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not
And something more.
2 changes: 2 additions & 0 deletions crates/weaver_forge/expected_output/comment_format/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ const DNS_QUESTION_NAME = ""
// - Use a domain-specific attribute
// - Set `error.type` to capture all errors, regardless of whether they are
// defined within the domain-specific set or not
//
// And something more
const ERROR_TYPE = ""

// Examples of comments for group other
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
* <li>Use a domain-specific attribute
* <li>Set {@code error.type} to capture all errors, regardless of whether they are defined within the domain-specific set or not
* </ul>
* And something more
*/
static ERROR_TYPE = "";

Expand Down
2 changes: 2 additions & 0 deletions crates/weaver_forge/expected_output/comment_format/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
- Use a domain-specific attribute
- Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not
And something more
"""

ATTR: Final = ""
Expand Down
2 changes: 2 additions & 0 deletions crates/weaver_forge/expected_output/comment_format/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
///
/// - Use a domain-specific attribute
/// - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not
///
/// And something more
const ERROR_TYPE: &str = "";


Expand Down
9 changes: 8 additions & 1 deletion crates/weaver_forge/src/extensions/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,9 @@ If a specific domain defines its own set of error identifiers (such as HTTP or g
it's RECOMMENDED to:
* Use a domain-specific attribute
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.. "#;
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not
And something more.. "#;
let ctx = serde_json::json!({
"note": note
});
Expand Down Expand Up @@ -368,6 +370,7 @@ it's RECOMMENDED to:
* <li>Use a domain-specific attribute
* <li>Set {@code error.type} to capture all errors, regardless of whether they are defined within the domain-specific set or not
* </ul>
* And something more
*/"##
);

Expand Down Expand Up @@ -398,6 +401,7 @@ it's RECOMMENDED to:
* <li>Use a domain-specific attribute
* <li>Set {@code error.type} to capture all errors, regardless of whether they are defined within the domain-specific set or not
* </ul>
* And something more
*/"##
);

Expand Down Expand Up @@ -428,6 +432,7 @@ it's RECOMMENDED to:
* <li>Use a domain-specific attribute
* <li>Set {@code error.type} to capture all errors, regardless of whether they are defined within the domain-specific set or not
* </ul>
* And something more
*/"##
);

Expand Down Expand Up @@ -458,6 +463,7 @@ it's RECOMMENDED to:
* <li>Use a domain-specific attribute
* <li>Set {@code error.type} to capture all errors, regardless of whether they are defined within the domain-specific set or not
* </ul>
* And something more
*/"##
);

Expand Down Expand Up @@ -517,6 +523,7 @@ it's RECOMMENDED to:
* are defined within the
* domain-specific set or not
* </ul>
* And something more
*/"##
);

Expand Down
16 changes: 10 additions & 6 deletions crates/weaver_forge/src/formats/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,9 @@ If a specific domain defines its own set of error identifiers (such as HTTP or g
it's RECOMMENDED to:
* Use a domain-specific attribute
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not."##;
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not
And something more."##;
let html = renderer.render(markdown, "java", None)?;
assert_string_eq!(
&html,
Expand All @@ -550,9 +552,9 @@ If a specific domain defines its own set of error identifiers (such as HTTP or g
it's RECOMMENDED to:
<ul>
<li>Use a domain-specific attribute
<li>Set {@code error.type} to capture all errors, regardless of whether they are defined within the domain-specific set or not.
<li>Set {@code error.type} to capture all errors, regardless of whether they are defined within the domain-specific set or not
</ul>
"##
And something more."##
);
Ok(())
}
Expand Down Expand Up @@ -728,7 +730,9 @@ If a specific domain defines its own set of error identifiers (such as HTTP or g
it's RECOMMENDED to:
* Use a domain-specific attribute
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not."##;
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not
And something more."##;
let html = renderer.render(markdown, "java", None)?;
assert_string_eq!(
&html,
Expand Down Expand Up @@ -776,9 +780,9 @@ RECOMMENDED to:
capture all errors,
regardless of whether they
are defined within the
domain-specific set or not.
domain-specific set or not
</ul>
"##
And something more."##
);
Ok(())
}
Expand Down
18 changes: 14 additions & 4 deletions crates/weaver_forge/src/formats/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,9 @@ If a specific domain defines its own set of error identifiers (such as HTTP or g
it's RECOMMENDED to:
* Use a domain-specific attribute
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not."##;
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not
And something more."##;
let rendered_md = renderer.render(markdown, "go", None)?;
assert_string_eq!(
&rendered_md,
Expand All @@ -650,7 +652,10 @@ If a specific domain defines its own set of error identifiers (such as HTTP or g
it's RECOMMENDED to:
- Use a domain-specific attribute
- Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not."##
- Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not
And something more.
"##
);

let config = WeaverConfig {
Expand Down Expand Up @@ -835,7 +840,9 @@ If a specific domain defines its own set of error identifiers (such as HTTP or g
it's RECOMMENDED to:
* Use a domain-specific attribute
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not."##;
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not
And something more."##;
let rendered_md = renderer.render(markdown, "go", None)?;
assert_string_eq!(
&rendered_md,
Expand Down Expand Up @@ -881,7 +888,10 @@ RECOMMENDED to:
all errors, regardless of
whether they are defined
within the domain-specific
set or not."##
set or not
And something more.
"##
);

let config = WeaverConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"500"
],
"requirement_level": "recommended",
"note": "The `error.type` SHOULD be predictable and SHOULD have low cardinality.\nInstrumentations SHOULD document the list of errors they report.\n\nThe cardinality of `error.type` within one instrumentation library SHOULD be low.\nTelemetry consumers that aggregate data from multiple instrumentation libraries and applications\nshould be prepared for `error.type` to have high cardinality at query time when no\nadditional filters are applied.\n\nIf the operation has completed successfully, instrumentations SHOULD NOT set `error.type`.\n\nIf a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes),\nit's RECOMMENDED to:\n\n* Use a domain-specific attribute\n* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.",
"note": "The `error.type` SHOULD be predictable and SHOULD have low cardinality.\nInstrumentations SHOULD document the list of errors they report.\n\nThe cardinality of `error.type` within one instrumentation library SHOULD be low.\nTelemetry consumers that aggregate data from multiple instrumentation libraries and applications\nshould be prepared for `error.type` to have high cardinality at query time when no\nadditional filters are applied.\n\nIf the operation has completed successfully, instrumentations SHOULD NOT set `error.type`.\n\nIf a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes),\nit's RECOMMENDED to:\n\n* Use a domain-specific attribute\n* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not\n\nAnd something more.",
"stability": "stable"
},
{
Expand Down Expand Up @@ -1203,7 +1203,7 @@
"requirement_level": {
"conditionally_required": "If and only if the messaging operation has failed."
},
"note": "The `error.type` SHOULD be predictable and SHOULD have low cardinality.\nInstrumentations SHOULD document the list of errors they report.\n\nThe cardinality of `error.type` within one instrumentation library SHOULD be low.\nTelemetry consumers that aggregate data from multiple instrumentation libraries and applications\nshould be prepared for `error.type` to have high cardinality at query time when no\nadditional filters are applied.\n\nIf the operation has completed successfully, instrumentations SHOULD NOT set `error.type`.\n\nIf a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes),\nit's RECOMMENDED to:\n\n* Use a domain-specific attribute\n* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.",
"note": "The `error.type` SHOULD be predictable and SHOULD have low cardinality.\nInstrumentations SHOULD document the list of errors they report.\n\nThe cardinality of `error.type` within one instrumentation library SHOULD be low.\nTelemetry consumers that aggregate data from multiple instrumentation libraries and applications\nshould be prepared for `error.type` to have high cardinality at query time when no\nadditional filters are applied.\n\nIf the operation has completed successfully, instrumentations SHOULD NOT set `error.type`.\n\nIf a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes),\nit's RECOMMENDED to:\n\n* Use a domain-specific attribute\n* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not\n\nAnd something more.",
"stability": "stable"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ groups:
it's RECOMMENDED to:
* Use a domain-specific attribute
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not
And something more.
4 changes: 3 additions & 1 deletion data/update_markdown/registry/registry/error.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ groups:
it's RECOMMENDED to:
* Use a domain-specific attribute
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.
* Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not
And something more.

0 comments on commit 03e0f51

Please sign in to comment.