-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Be able to run pyang #186
Comments
I've left this sort of linting to other tools. The Makefile for the QUIC drafts adds a lint that looks for line length, for instance. To that, I would use the native inclusion functions of the tool, whatever that is, and add a lint that uses <sourcecode type="yang">
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="file.yang" parse="text"/>
</sourcecode> ...and: lint::
pyang --ietf *.yang That said, it's probably good to integrate this sort of check into the tool proper. It's fairly easy to extract the relevant pieces using xmllint. |
Of note here is a new option for people who want more tools in CI images. pyang is probably small enough to include in the core image; but if it is not, then that option exists. |
You can't include the yang directly like this, as it needs CDATA, I think. |
At: https://github.com/anima-wg/voucher/runs/5436309463?check_suite_focus=true I notice that the pyang in the circleCI container is too old to understand --keep-comments. |
@mcr, the image I'm using is just 3 days old (as of your comment), so if pyang was updated in the intervening time to include support for that argument, that's expected. Do I need to rebuild the image for a new version? |
%pyang --help | grep keep-comment Could I be using something from git, rather than released? I don't think so. |
https://github.com/martinthomson/i-d-template/runs/5401518893?check_suite_focus=true#step:7:387 shows that pyang 2.5.2 was installed. So it's not that. The specific message is this:
Note here that the |
Yes, you are exactly correct. |
In xml2rfc v3, YANG code is marked with
It would be nice to strip those out and feed them through
pyang --ietf
for syntax-checks, and perhaps alsopyang -f yang --keep-comments
And maybe putmax-line-length 69
somewhere.The text was updated successfully, but these errors were encountered: