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
description :=sprintf("Semconv group '%s' does not contain stability field. All semconv definitions must include stability level.", [group.id])
90
90
}
91
91
92
+
# check that member ids do not collide within the same attribute
93
+
deny contains attr_registry_violation(description, group.id, attr.id) if {
94
+
group := input.groups[_]
95
+
startswith(group.id, "registry.")
96
+
97
+
attr := group.attributes[_]
98
+
member := attr.type.members[_]
99
+
100
+
collisions := [n | n := attr.type.members[_].id; n == member.id ]
101
+
count(collisions) >1
102
+
103
+
description :=sprintf("Member with id '%s' is already defined on the attribute '%s' in the group '%s'. Member id must be unique.", [member.id, attr.id, group.id])
104
+
}
105
+
106
+
# check that member values do not collide within the same attribute
107
+
deny contains attr_registry_violation(description, group.id, attr.id) if {
108
+
group := input.groups[_]
109
+
startswith(group.id, "registry.")
110
+
attr := group.attributes[_]
111
+
member := attr.type.members[_]
112
+
not is_property_set(member, "deprecated")
113
+
114
+
collisions := [m
115
+
| m := attr.type.members[_]
116
+
not is_property_set(m, "deprecated")
117
+
m.value == member.value
118
+
]
119
+
count(collisions) >1
120
+
121
+
description :=sprintf("Member with value '%s' (id '%s') is already defined on the attribute '%s' in the group '%s'. Member value must be unique.", [member.value, member.id, attr.id, group.id])
122
+
}
123
+
124
+
# check that member const names do not collide within the same attribute
125
+
deny contains attr_registry_violation(description, group.id, attr.id) if {
126
+
group := input.groups[_]
127
+
startswith(group.id, "registry.")
128
+
attr := group.attributes[_]
129
+
member := attr.type.members[_]
130
+
not member.annotations["code_generation"]["exclude"]
131
+
132
+
const_name :=to_const_name(member.id)
133
+
134
+
collisions := [m
135
+
| m := attr.type.members[_]
136
+
to_const_name(m.id) == const_name
137
+
not m.annotations["code_generation"]["exclude"]
138
+
]
139
+
count(collisions) >1
140
+
141
+
description :=sprintf("Member with const name '%s' (id '%s'), is already defined on the attribute '%s' in the group '%s'. Member const names must be unique.", [const_name, member.id, attr.id, group.id])
0 commit comments