{"action":"created","issue":{"url":"https://api.github.com/repos/google/yapf/issues/69","labels_url":"https://api.github.com/repos/google/yapf/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/google/yapf/issues/69/comments","events_url":"https://api.github.com/repos/google/yapf/issues/69/events","html_url":"https://github.com/google/yapf/issues/69","id":66428408,"number":69,"title":"Oddities with string formatting using % operator","user":{"login":"nickhutchinson","id":755692,"avatar_url":"https://avatars.githubusercontent.com/u/755692?v=3","gravatar_id":"","url":"https://api.github.com/users/nickhutchinson","html_url":"https://github.com/nickhutchinson","followers_url":"https://api.github.com/users/nickhutchinson/followers","following_url":"https://api.github.com/users/nickhutchinson/following{/other_user}","gists_url":"https://api.github.com/users/nickhutchinson/gists{/gist_id}","starred_url":"https://api.github.com/users/nickhutchinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickhutchinson/subscriptions","organizations_url":"https://api.github.com/users/nickhutchinson/orgs","repos_url":"https://api.github.com/users/nickhutchinson/repos","events_url":"https://api.github.com/users/nickhutchinson/events{/privacy}","received_events_url":"https://api.github.com/users/nickhutchinson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-05T11:11:13Z","updated_at":"2015-04-05T13:30:35Z","closed_at":null,"body":"`test_case.py`:\r\n```python\r\n# 79 characters\r\n###############################################################################\r\ndef f():\r\n    if True:\r\n        zzzzz = '%s-%s' % (xxxxxxxxxxxxxxxxxxxxxxxxxx + 1, xxxxxxxxxxxxxxxxx.yyy + 1)\r\n        zzzzz = '%s-%s'.ww(xxxxxxxxxxxxxxxxxxxxxxxxxx + 1, xxxxxxxxxxxxxxxxx.yyy + 1)\r\n        zzzzz = '%s-%s' % (xxxxxxxxxxxxxxxxxxxxxxx + 1, xxxxxxxxxxxxxxxxxxxxx + 1)\r\n        zzzzz = '%s-%s'.ww(xxxxxxxxxxxxxxxxxxxxxxx + 1, xxxxxxxxxxxxxxxxxxxxx + 1)\r\n```\r\n\r\n`> yapf test_case.py`:\r\n```python\r\n# 79 characters\r\n###############################################################################\r\ndef f():\r\n    if True:\r\n        zzzzz = '%s-%s' % (xxxxxxxxxxxxxxxxxxxxxxxxxx + 1, xxxxxxxxxxxxxxxxx.\r\n                           yyy + 1)\r\n        zzzzz = '%s-%s'.ww(xxxxxxxxxxxxxxxxxxxxxxxxxx + 1,\r\n                           xxxxxxxxxxxxxxxxx.yyy + 1)\r\n        zzzzz = '%s-%s' % (xxxxxxxxxxxxxxxxxxxxxxx + 1, xxxxxxxxxxxxxxxxxxxxx + 1)\r\n        zzzzz = '%s-%s'.ww(xxxxxxxxxxxxxxxxxxxxxxx + 1,\r\n                           xxxxxxxxxxxxxxxxxxxxx + 1)\r\n```\r\n\r\nNote that:\r\n\r\n- 79 character limit isn't being enforced consistently.\r\n- breaking tokens at '.' may be syntactically correct, but should be something yapf does as a last resort."},"comment":{"url":"https://api.github.com/repos/google/yapf/issues/comments/89770522","html_url":"https://github.com/google/yapf/issues/69#issuecomment-89770522","issue_url":"https://api.github.com/repos/google/yapf/issues/69","id":89770522,"user":{"login":"eliben","id":1130906,"avatar_url":"https://avatars.githubusercontent.com/u/1130906?v=3","gravatar_id":"","url":"https://api.github.com/users/eliben","html_url":"https://github.com/eliben","followers_url":"https://api.github.com/users/eliben/followers","following_url":"https://api.github.com/users/eliben/following{/other_user}","gists_url":"https://api.github.com/users/eliben/gists{/gist_id}","starred_url":"https://api.github.com/users/eliben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliben/subscriptions","organizations_url":"https://api.github.com/users/eliben/orgs","repos_url":"https://api.github.com/users/eliben/repos","events_url":"https://api.github.com/users/eliben/events{/privacy}","received_events_url":"https://api.github.com/users/eliben/received_events","type":"User","site_admin":false},"created_at":"2015-04-05T13:30:35Z","updated_at":"2015-04-05T13:30:35Z","body":"I can confirm this has to do with the `%` operator. Replacing it by `+` makes these particular problems go away (no breaking at `.`, no going over 79)"}}