-
Notifications
You must be signed in to change notification settings - Fork 836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(semantic-conventions): bump weaver; use comment filter rather than deprecated comment_with_prefix #5100
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6e4bc17
chore(semconv): stop prefixing deprecated message with '*'
trentm 16fef6b
bump weaver to latest; use comment filter rather than deprecated comm…
trentm 9850d57
use 'escape_backslashes: true' in weaver comment config
trentm a06c634
changelog entry
trentm 2babf73
fix the markup of RFC 2119 words when the phrase starts with one of t…
trentm bf00f2a
Merge branch 'main' into tm-semconv-play-1.28
trentm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 33 additions & 20 deletions
53
scripts/semconv/templates/registry/stable/docstring.ts.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,34 @@ | ||
{% macro strong_reqs(string) -%}{{ string | replace(" MUST ", " **MUST** ") | replace(" MUST NOT ", " **MUST NOT** ") | replace(" SHOULD ", " **SHOULD** ") | replace(" SHOULD NOT ", " **SHOULD NOT** ") | replace(" MAY ", " **MAY** ") | replace(" NOT ", " **NOT** ") }}{% endmacro -%} | ||
{% macro strong_rfc2119(string) -%}{{ string | regex_replace("\\b(MUST NOT|MUST|REQUIRED|SHALL NOT|SHALL|SHOULD NOT|SHOULD|RECOMMENDED|MAY|OPTIONAL)\\b", "**$1**") }}{% endmacro -%} | ||
|
||
{% macro docstring(obj, type="value") -%}/** | ||
{{ strong_reqs(obj.brief | comment_with_prefix(" * ")) }} | ||
{% if obj.examples is sequence %}{% for example in obj.examples %} | ||
* | ||
* @example {{ example }} | ||
{% endfor %}{%elif obj.examples%} | ||
* | ||
* @example {{ obj.examples | print_member_value }} | ||
{% endif %}{% if obj.note %} | ||
* | ||
{{ ("@note " ~ strong_reqs(obj.note)) | comment_with_prefix(" * ") }} | ||
{% endif %}{% if (obj.stability) != "stable" %} | ||
* | ||
* @experimental This {{type}} is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. | ||
{% endif %}{% if obj.deprecated %} | ||
* | ||
* @deprecated {{ strong_reqs(obj.deprecated) | comment_with_prefix(" * ") }} | ||
{% endif %} | ||
*/{% endmacro -%} | ||
{% macro docstring(obj, type="value") -%} | ||
{%- set examples_jsdoc %} | ||
{% if obj.examples is sequence %} | ||
{% for example in obj.examples %} | ||
@example {{ example }} | ||
{% endfor %} | ||
{% elif obj.examples %} | ||
@example {{ obj.examples | print_member_value }} | ||
{% endif %} | ||
{% endset -%} | ||
|
||
{%- if obj.note %} | ||
{% set note_jsdoc = "@note " ~ strong_rfc2119(obj.note) %} | ||
{% endif -%} | ||
|
||
{%- if obj.stability != "stable" %} | ||
{% set stability_jsdoc = "@experimental This " ~ type ~ " is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`." %} | ||
{% endif -%} | ||
|
||
{%- if obj is deprecated %} | ||
{%- set deprecated_jsdoc = "\n@deprecated " ~ strong_rfc2119(obj.deprecated) -%} | ||
{%- endif -%} | ||
|
||
{{ [ | ||
strong_rfc2119(obj.brief) | trim, | ||
"\n", | ||
examples_jsdoc, | ||
note_jsdoc, | ||
stability_jsdoc, | ||
deprecated_jsdoc, | ||
] | comment }} | ||
{%- endmacro -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I support the
strong_rfc2119
renaming. More clear what's actually going on.