From b51991210742930cdffcba0568bc6885d9024e54 Mon Sep 17 00:00:00 2001 From: Rob Shakir Date: Thu, 23 Mar 2023 12:02:09 -0700 Subject: [PATCH] Enable `gofmt` CI against new directories by default. (#793) Co-authored-by: Wen Bo Li <50884368+wenovus@users.noreply.github.com> --- .github/workflows/go.yml | 2 +- gnmidiff/json.go | 44 +++++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 12932aa29..0988d59f3 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -174,7 +174,7 @@ jobs: - name: Gofmt run: | - for i in util ygot ygen ytypes ygot/pathtranslate testutil testcmp ypathgen; do + for i in `find . -type d | egrep -v "exampleoc|demo|proto|uexampleoc"`; do diff -u <(echo -n) <(gofmt -d -s ./$i) done diff --git a/gnmidiff/json.go b/gnmidiff/json.go index e021b40e5..e9e7b9214 100644 --- a/gnmidiff/json.go +++ b/gnmidiff/json.go @@ -33,29 +33,31 @@ import ( // Output path format is per gNMI's path conventions. // // e.g. -// { -// "openconfig-network-instance:config": { -// "description": "VRF RED", -// "enabled": true, -// "enabled-address-families": [ -// "openconfig-types:IPV4", -// "openconfig-types:IPV6" -// ], -// "name": "RED", -// "type": "openconfig-network-instance-types:L3VRF" -// }, -// "openconfig-network-instance:name": "RED" -// } +// +// { +// "openconfig-network-instance:config": { +// "description": "VRF RED", +// "enabled": true, +// "enabled-address-families": [ +// "openconfig-types:IPV4", +// "openconfig-types:IPV6" +// ], +// "name": "RED", +// "type": "openconfig-network-instance-types:L3VRF" +// }, +// "openconfig-network-instance:name": "RED" +// } // // returns -// { -// "openconfig-network-instance:config/description": "VRF RED", -// "openconfig-network-instance:config/enabled": true, -// "openconfig-network-instance:config/enabled-address-families": ["openconfig-types:IPV4", "openconfig-types:IPV6"], -// "openconfig-network-instance:config/name": "RED", -// "openconfig-network-instance:config/type": "openconfig-network-instance-types:L3VRF", -// "openconfig-network-instance:name": "RED", -// } +// +// { +// "openconfig-network-instance:config/description": "VRF RED", +// "openconfig-network-instance:config/enabled": true, +// "openconfig-network-instance:config/enabled-address-families": ["openconfig-types:IPV4", "openconfig-types:IPV6"], +// "openconfig-network-instance:config/name": "RED", +// "openconfig-network-instance:config/type": "openconfig-network-instance-types:L3VRF", +// "openconfig-network-instance:name": "RED", +// } // // When keepNamespace=false, then any namespace is removed from the flattened // *paths*, but still kept in any identity values.