Loading lint-data-models.sh +12 −2 Original line number Diff line number Diff line #!/bin/bash # Copyright ETSI 2020 LOGFILE=yang-linting.log echo "------ Switching to $1 folder --------" cd $1 Loading @@ -21,11 +23,19 @@ docker run --rm -v $(pwd)/yang-models:/yang hellt/pyang:2.1 pyang --version echo "------ Linting all YANG files ------" # Display all errors and warnings to the user. Errors are allowed. docker run --rm -v $(pwd)/yang-models:/yang hellt/pyang:2.1 "/bin/sh" -c 'pyang --lint -p external-yams _3gpp-*.yang' docker run --rm -v $(pwd)/yang-models:/yang hellt/pyang:2.1 "/bin/sh" -c 'pyang --lint -p external-yams _3gpp-*.yang' 2>>$LOGFILE >>$LOGFILE ret=$? echo "Output of Linting commad saved to $LOGFILE." echo "------ Linting result ------" echo $ret if [ $ret == 1 ] ; then echo "Some issues were collected by the linter, but they are treated as warnings and are not failing the validation." echo "To see the full output of the linter, download the archived artifact named '$LOGFILE'." fi # exit $ret exit 0 Loading
lint-data-models.sh +12 −2 Original line number Diff line number Diff line #!/bin/bash # Copyright ETSI 2020 LOGFILE=yang-linting.log echo "------ Switching to $1 folder --------" cd $1 Loading @@ -21,11 +23,19 @@ docker run --rm -v $(pwd)/yang-models:/yang hellt/pyang:2.1 pyang --version echo "------ Linting all YANG files ------" # Display all errors and warnings to the user. Errors are allowed. docker run --rm -v $(pwd)/yang-models:/yang hellt/pyang:2.1 "/bin/sh" -c 'pyang --lint -p external-yams _3gpp-*.yang' docker run --rm -v $(pwd)/yang-models:/yang hellt/pyang:2.1 "/bin/sh" -c 'pyang --lint -p external-yams _3gpp-*.yang' 2>>$LOGFILE >>$LOGFILE ret=$? echo "Output of Linting commad saved to $LOGFILE." echo "------ Linting result ------" echo $ret if [ $ret == 1 ] ; then echo "Some issues were collected by the linter, but they are treated as warnings and are not failing the validation." echo "To see the full output of the linter, download the archived artifact named '$LOGFILE'." fi # exit $ret exit 0