You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #277 from Sherlouk/resilient-script
Improve SemanticConvention generation template:
At the moment, if you run the generate script, it will make changes to the project which will cause compiler or test failures.
The three failures which this protects against:
The value "int" being used as an enum value. This needs to be "Int" instead.
The keyword "internal" being used as a case value. This should be wrapped with backticks like internal.
The Swift telemetry language which we have chosen to add, outside of the specification.
While not technically a failure, this change will also revert the documentation changes made in a previous PR which changed all the Int values to "int" incorrectly. This fixes that too.
- Requires: Value should be one of [`{{enum}}.{{class_name}}`](x-source-tag://otel{{class_name}}) (of type `{{to_swift_return_type(attribute.attr_type|lower)}}`)
58
+
{%else%}
53
59
- Requires: Value type should be `{{to_swift_return_type(attribute.attr_type|lower)}}`
60
+
{%endif -%}
54
61
*/
55
62
{%- ifattribute.deprecated%}
56
63
@available(*, deprecated)
@@ -76,6 +83,7 @@ public enum {{enum}}: String {
76
83
/**
77
84
{{attribute.brief | to_doc_brief}}.
78
85
*/
86
+
/// - Tag: otel{{class_name}}
79
87
{%- ifattribute.attr_type.custom_values%}
80
88
public struct {{class_name}}: CustomStringConvertible {
81
89
{%- formemberinattribute.attr_type.members%}
@@ -101,7 +109,7 @@ public enum {{enum}}: String {
0 commit comments