{"action":"created","issue":{"url":"https://api.github.com/repos/darold/pgFormatter/issues/56","repository_url":"https://api.github.com/repos/darold/pgFormatter","labels_url":"https://api.github.com/repos/darold/pgFormatter/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/darold/pgFormatter/issues/56/comments","events_url":"https://api.github.com/repos/darold/pgFormatter/issues/56/events","html_url":"https://github.com/darold/pgFormatter/issues/56","id":356692707,"node_id":"MDU6SXNzdWUzNTY2OTI3MDc=","number":56,"title":"plpython support","user":{"login":"PhilipTrauner","id":9287847,"node_id":"MDQ6VXNlcjkyODc4NDc=","avatar_url":"https://avatars3.githubusercontent.com/u/9287847?v=4","gravatar_id":"","url":"https://api.github.com/users/PhilipTrauner","html_url":"https://github.com/PhilipTrauner","followers_url":"https://api.github.com/users/PhilipTrauner/followers","following_url":"https://api.github.com/users/PhilipTrauner/following{/other_user}","gists_url":"https://api.github.com/users/PhilipTrauner/gists{/gist_id}","starred_url":"https://api.github.com/users/PhilipTrauner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhilipTrauner/subscriptions","organizations_url":"https://api.github.com/users/PhilipTrauner/orgs","repos_url":"https://api.github.com/users/PhilipTrauner/repos","events_url":"https://api.github.com/users/PhilipTrauner/events{/privacy}","received_events_url":"https://api.github.com/users/PhilipTrauner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-04T07:53:50Z","updated_at":"2018-09-07T22:12:38Z","closed_at":null,"author_association":"NONE","body":"```sql\r\nCREATE OR REPLACE FUNCTION plpython_demo()\r\nRETURNS void\r\nAS $$\r\n\tfrom this import s, d\r\n\r\n\tfor char in s:\r\n\t\tprint(d.get(char, char), end=\"\")\r\n\r\n\tprint()\r\n$$\r\nLANGUAGE 'plpython3u';\r\n```\r\n↓\r\n```sql\r\nCREATE OR REPLACE FUNCTION plpython_demo ()\r\n    RETURNS void\r\nAS $$\r\nFROM\r\n    this import s,\r\n    d FOR char IN s: print (d.get (char,\r\n            char),\r\nEND = \"\") print ()\r\n$$\r\nLANGUAGE 'plpython3u';\r\n```\r\nThis issue looks pretty much just like #54. It would be great if the contents of `plpython3u` and `plpythonu` language blocks could be ignored by pgFormatter.\r\n\r\nWith kind regards,\r\nPhilip Trauner"},"comment":{"url":"https://api.github.com/repos/darold/pgFormatter/issues/comments/419579862","html_url":"https://github.com/darold/pgFormatter/issues/56#issuecomment-419579862","issue_url":"https://api.github.com/repos/darold/pgFormatter/issues/56","id":419579862,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTU3OTg2Mg==","user":{"login":"darold","id":538862,"node_id":"MDQ6VXNlcjUzODg2Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/538862?v=4","gravatar_id":"","url":"https://api.github.com/users/darold","html_url":"https://github.com/darold","followers_url":"https://api.github.com/users/darold/followers","following_url":"https://api.github.com/users/darold/following{/other_user}","gists_url":"https://api.github.com/users/darold/gists{/gist_id}","starred_url":"https://api.github.com/users/darold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darold/subscriptions","organizations_url":"https://api.github.com/users/darold/orgs","repos_url":"https://api.github.com/users/darold/repos","events_url":"https://api.github.com/users/darold/events{/privacy}","received_events_url":"https://api.github.com/users/darold/received_events","type":"User","site_admin":false},"created_at":"2018-09-07T22:12:38Z","updated_at":"2018-09-07T22:12:38Z","author_association":"OWNER","body":"I know, the problem is that pgFormatter parse the file token by token. It would be easy if we can detect that the function have LANGUAGE set to plpython or more generally other language than SQL or PLPGSQL.\r\n\r\nThis require a preprocessing to autodetect the function language before the tokenizer. I think it is possible and I will work on it when I found some more time.\r\n\r\nBest regards,"}}
{"actor":{"display_login":"darold"}}