Skip to content

Commit

Permalink
feat: Parse for legacy DFDs and shift into the new format
Browse files Browse the repository at this point in the history
  • Loading branch information
xntrik authored and teamcfr committed Feb 6, 2023
1 parent 24a1fd7 commit bcbccec
Show file tree
Hide file tree
Showing 6 changed files with 382 additions and 337 deletions.
2 changes: 1 addition & 1 deletion cmd/hcltm/dfd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func TestDfdDot(t *testing.T) {
}
t.Logf("out: %s", out)

_, err = os.Open(fmt.Sprintf("%s/out/tm3-tm2onetm2one.dot", d))
_, err = os.Open(fmt.Sprintf("%s/out/tm3-tm2onelegacydfd.dot", d))
if err != nil {
t.Fatalf("Error opening dot: %s", err)
}
Expand Down
18 changes: 12 additions & 6 deletions cmd/hcltm/generate_interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ func (c *GenerateInteractiveCommand) Run(args []string) int {
return 1
}

err = tmParser.ValidateTm(&tm)
// err = tmParser.ValidateTm(&tm)
err = tm.ValidateTm(tmParser)
if err != nil {
fmt.Printf("Error validating TM: %s\n", err)
return 1
Expand Down Expand Up @@ -235,7 +236,8 @@ func (c *GenerateInteractiveCommand) Run(args []string) int {
return 1
}

err = tmParser.ValidateTm(&tm)
// err = tmParser.ValidateTm(&tm)
err = tm.ValidateTm(tmParser)
if err != nil {
fmt.Printf("Error validating TM: %s\n", err)
return 1
Expand Down Expand Up @@ -334,7 +336,8 @@ func (c *GenerateInteractiveCommand) Run(args []string) int {
return 1
}

err = tmParser.ValidateTm(&tm)
// err = tmParser.ValidateTm(&tm)
err = tm.ValidateTm(tmParser)
if err != nil {
fmt.Printf("Error validating TM: %s\n", err)
return 1
Expand Down Expand Up @@ -412,7 +415,8 @@ func (c *GenerateInteractiveCommand) Run(args []string) int {
return 1
}

err = tmParser.ValidateTm(&tm)
// err = tmParser.ValidateTm(&tm)
err = tm.ValidateTm(tmParser)
if err != nil {
fmt.Printf("Error validating TM: %s\n", err)
return 1
Expand Down Expand Up @@ -490,7 +494,8 @@ func (c *GenerateInteractiveCommand) Run(args []string) int {
return 1
}

err = tmParser.ValidateTm(&tm)
// err = tmParser.ValidateTm(&tm)
err = tm.ValidateTm(tmParser)
if err != nil {
fmt.Printf("Error validating TM: %s\n", err)
return 1
Expand Down Expand Up @@ -586,7 +591,8 @@ func (c *GenerateInteractiveCommand) Run(args []string) int {
return 1
}

err = tmParser.ValidateTm(&tm)
// err = tmParser.ValidateTm(&tm)
err = tm.ValidateTm(tmParser)
if err != nil {
fmt.Printf("Error validating TM: %s\n", err)
return 1
Expand Down

0 comments on commit bcbccec

Please sign in to comment.