Skip to content

Commit 62acbf6

Browse files
committed
feat: add the arm project type [FIX-488]
The ARM parser plugin reports "arm" as its config file project type, so it is a filterable type in its own right rather than something folded onto another family.
1 parent ccd8eb1 commit 62acbf6

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

pkg/project/project.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const (
4040
CDKPython Type = "cdk_python"
4141
CiscoStacks Type = "cisco_stacks"
4242
Kubernetes Type = "kubernetes"
43+
ARM Type = "arm"
4344
)
4445

4546
// IsCDK reports whether a project is one of the CDK languages.
@@ -101,7 +102,7 @@ func Resolve(t Type, dir string) Type {
101102
// display order. It is deliberately coarser than the full set above:
102103
// NormalizeForFilter folds the niche and derived types onto the family a user
103104
// would recognise, so policies are written against a short, stable list.
104-
var Filterable = []Type{Terraform, Terragrunt, CloudFormation, Kubernetes}
105+
var Filterable = []Type{Terraform, Terragrunt, CloudFormation, ARM, Kubernetes}
105106

106107
// NormalizeForFilter collapses a project type onto the Filterable set, so a
107108
// policy targeting "cloudformation" also covers the CDK variants that the

pkg/project/project_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ func TestResolve(t *testing.T) {
2020
{"terragrunt is unchanged", Terragrunt, nil, Terragrunt},
2121
{"cloudformation is unchanged", CloudFormation, nil, CloudFormation},
2222
{"kubernetes is unchanged", Kubernetes, nil, Kubernetes},
23+
{"arm is unchanged", ARM, nil, ARM},
2324

2425
// Cisco Stacks has its own parser plugin, so unlike filtering this must
2526
// not fold it onto terraform.
@@ -69,6 +70,7 @@ func TestParserFamily(t *testing.T) {
6970
{Terragrunt, Terragrunt},
7071
{CloudFormation, CloudFormation},
7172
{Kubernetes, Kubernetes},
73+
{ARM, ARM},
7274
{CiscoStacks, CiscoStacks},
7375
{CDKTypeScript, CloudFormation},
7476
{CDKJavaScript, CloudFormation},
@@ -111,6 +113,7 @@ func TestNormalizeForFilter(t *testing.T) {
111113
{"terragrunt stays distinct", Terragrunt, Terragrunt},
112114
{"cloudformation is unchanged", CloudFormation, CloudFormation},
113115
{"kubernetes is unchanged", Kubernetes, Kubernetes},
116+
{"arm is unchanged", ARM, ARM},
114117

115118
{"untyped project folds to terraform", Unknown, Terraform},
116119
{"cisco stacks folds to terraform", CiscoStacks, Terraform},
@@ -135,7 +138,7 @@ func TestNormalizeForFilter(t *testing.T) {
135138
func TestNormalizeForFilter_LandsOnFilterableSet(t *testing.T) {
136139
all := []Type{
137140
Unknown, Terraform, Terragrunt, CloudFormation,
138-
CDKTypeScript, CDKJavaScript, CDKPython, CiscoStacks, Kubernetes,
141+
CDKTypeScript, CDKJavaScript, CDKPython, CiscoStacks, Kubernetes, ARM,
139142
}
140143

141144
for _, projectType := range all {

0 commit comments

Comments
 (0)