From 36103f418fc19bbbe614702d3452a2e58f620941 Mon Sep 17 00:00:00 2001 From: wenovus Date: Fri, 13 Oct 2023 12:57:39 -0700 Subject: [PATCH 1/2] Report pyang warnings as errors --- cmd_gen/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd_gen/main.go b/cmd_gen/main.go index f7351c3..ad6ca3c 100644 --- a/cmd_gen/main.go +++ b/cmd_gen/main.go @@ -138,8 +138,8 @@ script_options=( function run-dir() { declare prefix="$workdir"/"$1"=="$2"== shift 2 - echo pyang "${options[@]}" "$@" > ${prefix}cmd - if ! $($cmd "${options[@]}" "${script_options[@]}" "$@" &> ${prefix}pass); then + echo pyang -W error "${options[@]}" "$@" > ${prefix}cmd + if ! $($cmd -W error "${options[@]}" "${script_options[@]}" "$@" &> ${prefix}pass); then mv ${prefix}pass ${prefix}fail fi } From a605d29504f0acf71db0e0837cdec3256bc54d67 Mon Sep 17 00:00:00 2001 From: wenovus Date: Fri, 13 Oct 2023 13:02:51 -0700 Subject: [PATCH 2/2] Fix tests --- cmd_gen/main_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd_gen/main_test.go b/cmd_gen/main_test.go index 778f483..1c34c85 100644 --- a/cmd_gen/main_test.go +++ b/cmd_gen/main_test.go @@ -66,8 +66,8 @@ script_options=( function run-dir() { declare prefix="$workdir"/"$1"=="$2"== shift 2 - echo pyang "${options[@]}" "$@" > ${prefix}cmd - if ! $($cmd "${options[@]}" "${script_options[@]}" "$@" &> ${prefix}pass); then + echo pyang -W error "${options[@]}" "$@" > ${prefix}cmd + if ! $($cmd -W error "${options[@]}" "${script_options[@]}" "$@" &> ${prefix}pass); then mv ${prefix}pass ${prefix}fail fi } @@ -97,8 +97,8 @@ script_options=( function run-dir() { declare prefix="$workdir"/"$1"=="$2"== shift 2 - echo pyang "${options[@]}" "$@" > ${prefix}cmd - if ! $($cmd "${options[@]}" "${script_options[@]}" "$@" &> ${prefix}pass); then + echo pyang -W error "${options[@]}" "$@" > ${prefix}cmd + if ! $($cmd -W error "${options[@]}" "${script_options[@]}" "$@" &> ${prefix}pass); then mv ${prefix}pass ${prefix}fail fi }