disable validation

This commit is contained in:
Gavin Nishizawa 2023-09-28 15:52:16 -07:00
parent 574783ebd1
commit 8947e45a81
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD

View file

@ -1108,11 +1108,11 @@ func (c *compiler) validateEdges(g *d2graph.Graph) {
if srcGrid != dstGrid { if srcGrid != dstGrid {
// valid: a -> grid // valid: a -> grid
// invalid: a -> grid.child // invalid: a -> grid.child
if dstGrid != nil && !(srcGrid != nil && srcGrid.IsDescendantOf(dstGrid)) { // if dstGrid != nil && !(srcGrid != nil && srcGrid.IsDescendantOf(dstGrid)) {
c.errorf(edge.GetAstEdge(), "edge cannot enter grid diagram %#v", dstGrid.AbsID()) // c.errorf(edge.GetAstEdge(), "edge cannot enter grid diagram %#v", dstGrid.AbsID())
} else { // } else {
c.errorf(edge.GetAstEdge(), "edge cannot exit grid diagram %#v", srcGrid.AbsID()) // c.errorf(edge.GetAstEdge(), "edge cannot exit grid diagram %#v", srcGrid.AbsID())
} // }
continue continue
} }
@ -1128,12 +1128,12 @@ func (c *compiler) validateEdges(g *d2graph.Graph) {
srcIsGridCell := edge.Src == srcCell srcIsGridCell := edge.Src == srcCell
dstIsGridCell := edge.Dst == dstCell dstIsGridCell := edge.Dst == dstCell
if srcIsGridCell != dstIsGridCell { if srcIsGridCell != dstIsGridCell {
if srcIsGridCell { // if srcIsGridCell {
c.errorf(edge.GetAstEdge(), "grid cell %#v can only connect to another grid cell", edge.Src.AbsID()) // c.errorf(edge.GetAstEdge(), "grid cell %#v can only connect to another grid cell", edge.Src.AbsID())
} else { // } else {
c.errorf(edge.GetAstEdge(), "grid cell %#v can only connect to another grid cell", edge.Dst.AbsID()) // c.errorf(edge.GetAstEdge(), "grid cell %#v can only connect to another grid cell", edge.Dst.AbsID())
} // }
continue // continue
} }
if srcCell != dstCell && (!srcIsGridCell || !dstIsGridCell) { if srcCell != dstCell && (!srcIsGridCell || !dstIsGridCell) {