pyang icon indicating copy to clipboard operation
pyang copied to clipboard

Add --yang-no-newlines option

Open telia-ok opened this issue 3 years ago • 2 comments

  • 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')

telia-ok avatar Sep 08 '22 12:09 telia-ok

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

fredgan avatar Nov 06 '22 09:11 fredgan

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.

telia-ok avatar Nov 10 '22 07:11 telia-ok