Skip to content

Commit

Permalink
Fix bug with newlines around enums. (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
Oberon00 authored Jul 22, 2021
1 parent cab67bf commit abf5f37
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ def parse(prefix, semconv_stability, yaml_attributes):
validate_id(attr_id, position_data["id"])
attr_type, brief, examples = SemanticAttribute.parse_id(attribute)
fqn = "{}.{}".format(prefix, attr_id)
attr_id = attr_id.strip()
else:
# Ref
attr_type = None
Expand Down Expand Up @@ -462,10 +461,10 @@ def parse(attribute_type):
EnumMember(
member_id=member["id"],
value=member["value"],
brief=member.get("brief")
brief=member.get("brief").strip()
if "brief" in member
else member["id"],
note=member.get("note") if "note" in member else "",
note=member.get("note").strip() if "note" in member else "",
)
)
enum_type = AttributeType.get_type(members[0].value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ def to_markdown_enum(self, output: io.StringIO):
for note in notes:
output.write("\n\n**[{}]:** {}".format(counter, note))
counter += 1
if notes:
output.write("\n")

def render_attribute_id(self, attribute_id):
"""
Expand Down
2 changes: 1 addition & 1 deletion semantic-conventions/src/opentelemetry/semconv/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.4.0"
__version__ = "0.4.1"
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,20 @@

| Value | Description |
|---|---|
| `wifi` | wifi |
| `wifi` | wifi [1] |
| `wired` | wired |
| `cell` | cell |
| `unavailable` | unavailable |

**[1]:** Usually 802.11

`net.host.connection.subtype` MUST be one of the following or, if none of the listed values apply, a custom value:

| Value | Description |
|---|---|
| `1G` | 1G
|
| `2G` | 2G
|
| `3G` | 3G
|
| `4G` | 4G
|
| `5G` | 5G
|
| `1G` | 1G |
| `2G` | 2G |
| `3G` | 3G |
| `4G` | 4G |
| `5G` | 5G |
<!-- endsemconv -->
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ groups:
members:
- id: wifi
value: "wifi"
note: "Usually 802.11"
- id: wired
value: "wired"
- id: cell
Expand Down Expand Up @@ -139,4 +140,4 @@ groups:
Scopes or granted authorities the client currently possesses extracted from token
or application security context. The value would come from the scope associated
with an OAuth 2.0 Access Token or an attribute value in a SAML 2.0 Assertion.
examples: 'read:message, write:files'
examples: 'read:message, write:files'

0 comments on commit abf5f37

Please sign in to comment.