mbj4668 / pyang

An extensible YANG validator and converter in python
ISC License
530 stars 342 forks source link

Add --yang-no-newlines option #823

Open telia-ok opened 1 year ago

telia-ok commented 1 year ago

pyang --help:

    --yang-no-newlines  Don't insert newlines after ('description',
                        'reference', 'contact', 'organization')
fredgan commented 1 year ago

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

telia-ok commented 1 year ago

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.