{"action":"opened","issue":{"url":"https://api.github.com/repos/triandicAnt/Formatme/issues/3","repository_url":"https://api.github.com/repos/triandicAnt/Formatme","labels_url":"https://api.github.com/repos/triandicAnt/Formatme/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/triandicAnt/Formatme/issues/3/comments","events_url":"https://api.github.com/repos/triandicAnt/Formatme/issues/3/events","html_url":"https://github.com/triandicAnt/Formatme/issues/3","id":321004949,"number":3,"title":"Convert upper case SOQL keywords to lowercase","user":{"login":"malloryw","id":3484259,"avatar_url":"https://avatars1.githubusercontent.com/u/3484259?v=4","gravatar_id":"","url":"https://api.github.com/users/malloryw","html_url":"https://github.com/malloryw","followers_url":"https://api.github.com/users/malloryw/followers","following_url":"https://api.github.com/users/malloryw/following{/other_user}","gists_url":"https://api.github.com/users/malloryw/gists{/gist_id}","starred_url":"https://api.github.com/users/malloryw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malloryw/subscriptions","organizations_url":"https://api.github.com/users/malloryw/orgs","repos_url":"https://api.github.com/users/malloryw/repos","events_url":"https://api.github.com/users/malloryw/events{/privacy}","received_events_url":"https://api.github.com/users/malloryw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-08T00:41:38Z","updated_at":"2018-05-08T00:41:38Z","closed_at":null,"author_association":"COLLABORATOR","body":"Example: \r\n```\r\n// wrong\r\nList<Account> accs = [SELECT Id FROM Account \r\n                      WHERE Name = 'Test'];\r\n// should be\r\nList<Account> accs = [select Id from Account\r\n                      where Name = 'Test'];\r\n```\r\n\r\n\r\nRegex solutions would be something like:\r\n- r'\\[SELECT ' ==> r'[select '\r\n-- make sure there is a space after the word 'select'\r\n- r'\\[select(\\s|\\w|,|\\(|\\))+ FROM ' => custom function\r\n-- make sure this rule is after the rule above\r\n-- the stuff between 'select' and 'FROM' represent whitespace, words, number, and commas and parenthesis. \r\n-- make sure there is 1 space before AND after ' FROM ' to completely isolate the keyword.\r\n-- custom function gets all text before 'FROM' and returns a new string with lower case 'from'\r\n- r'\\[select(\\s|\\w|,|\\(|\\))+from(\\s|\\w|,|\\(|\\))+ WHERE ' => custom function\r\n-- make sure there is 1 space before AND after ' WHERE ' to completely isolate the keyword.\r\n-- custom function gets all text before 'WHERE' and returns a new string with lower case 'where'\r\n- r'\\[select(\\s|\\w|,|\\(|\\))+from(\\s|\\w|,|\\(|\\))+ LIMIT ' => custom function\r\n- r'\\[select(\\s|\\w|,|\\(|\\))+from(\\s|\\w|,|\\(|\\))+ ORDER BY ' => custom function\r\n- r'\\[select(\\s|\\w|,|\\(|\\))+from(\\s|\\w|,|\\(|\\))+ GROUP BY ' => custom function\r\n\r\n"}}
{"actor":{"display_login":"malloryw"}}