Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pylint run; new approach to coverage
- Loading branch information
Showing
64 changed files
with
144 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[MASTER] | ||
ignore-patterns = .*yacc | ||
extension-pkg-whitelist = lxml.etree | ||
|
||
[SIMILARITIES] | ||
ignore-imports = yes | ||
|
||
[MESSAGES-CONTROL] | ||
disable = | ||
invalid-name, | ||
missing-docstring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ virtualenv | |
pycodestyle | ||
pyflakes | ||
flake8 | ||
pylint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang test.yang --print-error-code 2>&1 | grep BAD_VALUE | ||
$(PYANG) test.yang --print-error-code 2>&1 | grep BAD_VALUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
test: | ||
pyang tst-m.yang --lint --print-error-code 2>&1 | \ | ||
$(PYANG) tst-m.yang --lint --print-error-code 2>&1 | \ | ||
grep LINT_TOP_MANDATORY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang tst-m.yang --lint --print-error-code 2>&1 | grep LINT_BAD_REVISION | ||
$(PYANG) tst-m.yang --lint --print-error-code 2>&1 | grep LINT_BAD_REVISION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang test.yang --print-error-code 2>&1 | grep NODE_NOT_FOUND | ||
$(PYANG) test.yang --print-error-code 2>&1 | grep NODE_NOT_FOUND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
PYANG = pyang -Wnone | ||
PYANG := $(PYANG) -Wnone | ||
|
||
MODULES = $(wildcard *.yang) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,40 @@ | ||
PYANG = pyang -Werror -WWBAD_MODULE_NAME | ||
PYANGE := $(PYANG) -Werror -WWBAD_MODULE_NAME | ||
|
||
test: clean utf8-test mef-ieee-test | ||
@for m in $(wildcard *.yang); do \ | ||
echo "checking $$m..." | tr -d '\012'; \ | ||
$(PYANG) $$m || exit 1; \ | ||
$(PYANGE) $$m || exit 1; \ | ||
echo " generating yin..."; \ | ||
$(PYANG) -f yin -o $$m.yin $$m || exit 1; \ | ||
$(PYANGE) -f yin -o $$m.yin $$m || exit 1; \ | ||
echo " " | tr -d '\012'; \ | ||
echo " generating yang from the generated yin..."; \ | ||
$(PYANG) -f yang -o $$m.gen.yang $$m.yin || exit 1; \ | ||
$(PYANGE) -f yang -o $$m.gen.yang $$m.yin || exit 1; \ | ||
echo " " | tr -d '\012'; \ | ||
echo " generating yang..." | tr -d '\012'; \ | ||
$(PYANG) -f yang -o $$m.gen.yang $$m || exit 1; \ | ||
$(PYANGE) -f yang -o $$m.gen.yang $$m || exit 1; \ | ||
echo " generating yin from the generated yang..."; \ | ||
$(PYANG) -f yin -o $$m.gen.yin $$m.gen.yang || exit 1; \ | ||
$(PYANGE) -f yin -o $$m.gen.yin $$m.gen.yang || exit 1; \ | ||
echo " " | tr -d '\012'; \ | ||
echo " comparing the two generated yin..." | tr -d '\012';\ | ||
diff $$m.yin $$m.gen.yin > $$m.diff || \ | ||
{ cat $$m.diff; exit 1; }; \ | ||
rm -f $$m.diff; \ | ||
echo " generating DSDL..." | tr -d '\012'; \ | ||
(grep '^submodule' $$m > /dev/null || $(PYANG) -f dsdl -o $$m.dsdl $$m || exit 0); \ | ||
(grep '^submodule' $$m > /dev/null \ | ||
|| $(PYANGE) -f dsdl -o $$m.dsdl $$m || exit 0); \ | ||
echo " ok"; \ | ||
done | ||
|
||
utf8-test: | ||
pyang -f yang q.yang || exit 1; \ | ||
pyang -f yang q.yang > x || exit 1; \ | ||
pyang -f yang q.yang -o x || exit 1; \ | ||
$(PYANG) -f yang q.yang || exit 1; \ | ||
$(PYANG) -f yang q.yang > x || exit 1; \ | ||
$(PYANG) -f yang q.yang -o x || exit 1; \ | ||
rm -f x | ||
|
||
mef-ieee-test: | ||
pyang --mef mef-yt10.yang || exit 1; \ | ||
pyang --mef mef-yt11.yang || exit 1; \ | ||
pyang --ieee ieee-yt12.yang || exit 1; | ||
$(PYANG) --mef mef-yt10.yang || exit 1; \ | ||
$(PYANG) --mef mef-yt11.yang || exit 1; \ | ||
$(PYANG) --ieee ieee-yt12.yang || exit 1; | ||
|
||
clean: | ||
rm -rf *.yang.yin *.gen.* *.dsdl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang -Werror -L hello.xml | ||
$(PYANG) -Werror -L hello.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang a.yang --canonical --print-error-code 2>&1 | diff a.expect - | ||
$(PYANG) a.yang --canonical --print-error-code 2>&1 | diff a.expect - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
test: test1 test2 | ||
|
||
test1: | ||
pyang -f yin x.yang | pyang -f yang | diff x.yang - | ||
$(PYANG) -f yin x.yang | $(PYANG) -f yang | diff x.yang - | ||
|
||
test2: | ||
pyang -f tree x.yang | diff x.tree.expect - | ||
$(PYANG) -f tree x.yang | diff x.tree.expect - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
test: | ||
PYANG_PLUGINPATH=. pyang -f yin example-sports.yang \ | ||
PYANG_PLUGINPATH=. $(PYANG) -f yin example-sports.yang \ | ||
-o example-sports.yin | ||
pyang -f tree --tree-path=sports/person/name example-sports.yang \ | ||
$(PYANG) -f tree --tree-path=sports/person/name example-sports.yang \ | ||
-o example-sports.tree | ||
pyang -f omni --omni-path=sports/person/name example-sports.yang \ | ||
$(PYANG) -f omni --omni-path=sports/person/name example-sports.yang \ | ||
-o example-sports.omni | ||
rm -f *.yin *.tree *.omni | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# this used to crash | ||
test: | ||
pyang -f jsonxsl example-4-a.yang example-4-b.yang > /dev/null | ||
$(PYANG) -f jsonxsl example-4-a.yang example-4-b.yang > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang --deviation-module test-dev.yang test.yang > /dev/null | ||
$(PYANG) --deviation-module test-dev.yang test.yang > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
test: | ||
pyang --print-error-code test.yang --deviation-module=test-dev.yang \ | ||
$(PYANG) --print-error-code test.yang --deviation-module=test-dev.yang \ | ||
2>&1 | grep BAD_DEVIATE_ADD > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang --lint my-x.yang > /dev/null | ||
$(PYANG) --lint my-x.yang > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang --print-error-code x.yang 2>&1 | grep NODE_NOT_FOUND > /dev/null | ||
$(PYANG) --print-error-code x.yang 2>&1 | grep NODE_NOT_FOUND > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang x.yang --print-error-code 2>&1 | diff x.expect - | ||
$(PYANG) x.yang --print-error-code 2>&1 | diff x.expect - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang -f tree x.yang 2>&1 | grep c2 > /dev/null | ||
$(PYANG) -f tree x.yang 2>&1 | grep c2 > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang -f jsonxsl test.yang > /dev/null | ||
$(PYANG) -f jsonxsl test.yang > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
test: | ||
pyang a.yang --print-error-code 2>&1 | diff a.expect - | ||
$(PYANG) a.yang --print-error-code 2>&1 | diff a.expect - | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang devext.yang > /dev/null | ||
$(PYANG) devext.yang > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang a.yang > /dev/null | ||
$(PYANG) a.yang > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang a.yang > /dev/null | ||
$(PYANG) a.yang > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang a.yang > /dev/null | ||
$(PYANG) a.yang > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
test: | ||
pyang a.yang > /dev/null | ||
pyang b.yang --print-error-code 2>&1 | diff b.expect - | ||
$(PYANG) a.yang > /dev/null | ||
$(PYANG) b.yang --print-error-code 2>&1 | diff b.expect - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang a.yang --print-error-code 2>&1 | diff a.expect - | ||
$(PYANG) a.yang --print-error-code 2>&1 | diff a.expect - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang --lint --lint-ensure-hyphenated-names my-types.yang > /dev/null | ||
$(PYANG) --lint --lint-ensure-hyphenated-names my-types.yang > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
test: | ||
pyang --print-error-code test.yang --deviation-module=test-dev.yang \ | ||
$(PYANG) --print-error-code test.yang --deviation-module=test-dev.yang \ | ||
2>&1 | diff test-dev.expect - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
test: | ||
pyang -f tree -F a: b.yang | diff b.expect - | ||
$(PYANG) -f tree -F a: b.yang | diff b.expect - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
test: | ||
pyang -f tree --tree-print-groupings --tree-no-expand-uses a.yang \ | ||
$(PYANG) -f tree --tree-print-groupings --tree-no-expand-uses a.yang \ | ||
| diff a.expect - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
test: | ||
pyang -f yang a.yang > /dev/null | ||
$(PYANG) -f yang a.yang > /dev/null | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
test: | ||
test `pyang -f yang --yang-canonical a.yang | grep require-instance | \ | ||
test `$(PYANG) -f yang --yang-canonical a.yang | grep require-instance | \ | ||
wc -l` = 1 | ||
|
Oops, something went wrong.