Skip to content

Commit aea69f2

Browse files
authored
Add editorconfig for yaml, rego and makefile, fix rego tabs (#1286)
1 parent 65f8f15 commit aea69f2

File tree

2 files changed

+35
-19
lines changed

2 files changed

+35
-19
lines changed

.editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*.{yaml,yml}]
4+
indent_style = space
5+
indent_size = 2
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
9+
[*.rego]
10+
indent_style = space
11+
indent_size = 4
12+
trim_trailing_whitespace = true
13+
insert_final_newline = true
14+
15+
[Makefile]
16+
indent_style = tab

policies/registry.rego

+19-19
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@ package before_resolution
66

77
# Helper to create attribute registry violations.
88
attr_registry_violation(violation_id, group_id, attr_id) = violation {
9-
violation := {
10-
"id": violation_id,
11-
"type": "semantic_convention_policies",
12-
"category": "attribute_registry_checks",
13-
"group": group_id,
14-
"attr": attr_id,
15-
}
9+
violation := {
10+
"id": violation_id,
11+
"type": "semantic_convention_policies",
12+
"category": "attribute_registry_checks",
13+
"group": group_id,
14+
"attr": attr_id,
15+
}
1616
}
1717

1818
# We only allow attribute groups in the attribute registry.
1919
deny[attr_registry_violation("attribute_registry_can_only_contain_attribute_groups", group.id, "")] {
20-
group := input.groups[_]
21-
startswith(group.id, "registry.")
22-
group.type != "attribute_group"
20+
group := input.groups[_]
21+
startswith(group.id, "registry.")
22+
group.type != "attribute_group"
2323
}
2424

2525
# Any group that is NOT in the attribute registry that has an attribute id is
2626
# in violation of not using the attribute registry.
2727
deny[attr_registry_violation("attributes_must_be_defined_in_attribute_registry", group.id, attr.id)] {
28-
group := input.groups[_]
29-
not startswith(group.id, "registry.")
30-
attr := group.attributes[_]
31-
attr.id != null
28+
group := input.groups[_]
29+
not startswith(group.id, "registry.")
30+
attr := group.attributes[_]
31+
attr.id != null
3232
}
3333

3434
# A registry `attribute_group` containing at least one `ref` attribute is
3535
# considered invalid if it's not in the registry group.
3636
deny[attr_registry_violation("attributes_in_registry_cannot_reference_each_other", group.id, attr.ref)] {
37-
# TODO - this will need to be updated to support `embed` in the future.
38-
group := input.groups[_]
39-
startswith(group.id, "registry.")
40-
attr := group.attributes[_]
41-
attr.ref != null
37+
# TODO - this will need to be updated to support `embed` in the future.
38+
group := input.groups[_]
39+
startswith(group.id, "registry.")
40+
attr := group.attributes[_]
41+
attr.ref != null
4242
}

0 commit comments

Comments
 (0)