yapf breaks up dict line with noqa

Created on 7 Jul 2017  路  2Comments  路  Source: google/yapf

This got broken up:

'item': {
   'very long string that would exceed line limit': 5,  # noqa
}

to

'item': {
   'very long string that would exceed line limit':
   5,  # noqa
}

which then caused the line with the key to exceed the line limit.

Most helpful comment

I'm not sure whether to make this an option or to hardcode it into the formatter. It might be best as an option. Perhaps along the lines of DISABLE_FORMATTING_COMMENTS and that can be set to a list of comments which, if present, will disable formatting on a line. Thoughts?

All 2 comments

I'm not sure whether to make this an option or to hardcode it into the formatter. It might be best as an option. Perhaps along the lines of DISABLE_FORMATTING_COMMENTS and that can be set to a list of comments which, if present, will disable formatting on a line. Thoughts?

Shouldn't you be commenting # yapf: disable instead?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Daenyth picture Daenyth  路  8Comments

prokher picture prokher  路  7Comments

hayd picture hayd  路  8Comments

pankdm picture pankdm  路  8Comments

thisfred picture thisfred  路  7Comments