Skip to content
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

Add --yang-no-newlines option #823

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

telia-ok
Copy link

@telia-ok telia-ok commented Sep 8, 2022

  • Add output YANG option to not insert newlines after _force_newline_arg

pyang --help:

    --yang-no-newlines  Don't insert newlines after ('description',
                        'reference', 'contact', 'organization')

@fredgan
Copy link
Collaborator

fredgan commented Nov 6, 2022

why you need this feature? What are the usage scenarios?

@telia-ok
Copy link
Author

When we work on large YANG models this change can reduce the total number of lines by several hundred when formatting the YANG file with pyang.

A lot of our descriptions have short descriptions so there's no need to split them up into two lines. Example:

    `description "VSI  ID";`

vs.

description
          "VSI  ID";

Easier to read and keeps the total number of lines down. This is an optional flag and won't affect the default behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants