Skip to content

Add --yang-no-newlines option#823

Open
telia-ok wants to merge 1 commit intombj4668:masterfrom
telia-ok:feature/yang-no-new-lines
Open

Add --yang-no-newlines option#823
telia-ok wants to merge 1 commit intombj4668:masterfrom
telia-ok:feature/yang-no-new-lines

Conversation

@telia-ok
Copy link
Copy Markdown

@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
Copy Markdown
Collaborator

fredgan commented Nov 6, 2022

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

@telia-ok
Copy link
Copy Markdown
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