{"action":"created","issue":{"url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/issues/1251","repository_url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine","labels_url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/issues/1251/labels{/name}","comments_url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/issues/1251/comments","events_url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/issues/1251/events","html_url":"https://github.com/TeamPorcupine/ProjectPorcupine/issues/1251","id":176170539,"number":1251,"title":"StyleCop rules and var usage","user":{"login":"dusho","id":12616499,"avatar_url":"https://avatars.githubusercontent.com/u/12616499?v=3","gravatar_id":"","url":"https://api.github.com/users/dusho","html_url":"https://github.com/dusho","followers_url":"https://api.github.com/users/dusho/followers","following_url":"https://api.github.com/users/dusho/following{/other_user}","gists_url":"https://api.github.com/users/dusho/gists{/gist_id}","starred_url":"https://api.github.com/users/dusho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dusho/subscriptions","organizations_url":"https://api.github.com/users/dusho/orgs","repos_url":"https://api.github.com/users/dusho/repos","events_url":"https://api.github.com/users/dusho/events{/privacy}","received_events_url":"https://api.github.com/users/dusho/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-09-10T09:22:53Z","updated_at":"2016-09-10T21:27:34Z","closed_at":null,"body":"Was just hit by [StyleCop] tag and going through the list I was wondering about some rules:\r\n\r\n**System using directives must be placed before all other using directives**\r\nthere is already rule to keep it in alphabetical order and Organize using -> sort usings does that.. can we remove this rule and keep only alphabetical one?\r\n\r\n**The body of the if statement must be wrapped in opening and closing curly brackets.**\r\nso it wants me to create from \r\n```\r\nif (IsWorkshop)\r\n    workshop.Update(deltaTime);\r\n```\r\ncode like this:\r\n```\r\nif (IsWorkshop)\r\n{\r\n    workshop.Update(deltaTime);\r\n}\r\n\r\n```\r\nis there point for this? One liners are often used for events.. and with extra 2 lines it's getting longer. Usually good habit is to fit one method on one screen so you don't have to scroll around if method has some tough logic inside.. so having rules that force you stretch your methods is not a good rule, I think\r\n\r\n**general (not a StyleCop) one is not use var**\r\nWhat is the reasoning behind this? We are already using LUA that also doesn't work with explicit types. And I think everyone uses some smart editor here (MonoDevelop or VS2015) that ships with Unity. Using 'var' is faster to write code and lines are usually shorted and don't need splitting.\r\n`foreach (var toConsume in flaggedForTaking)`\r\nvs.\r\n`foreach (KeyValuePair<Tile, int> toConsume in flaggedForTaking)`\r\nor\r\n`var flaggedForTaking = new List<KeyValuePair<Tile, int>>();`\r\nvs.\r\n`List<KeyValuePair<Tile, int>> flaggedForTaking = new List<KeyValuePair<Tile, int>>();`\r\n"},"comment":{"url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/issues/comments/246141367","html_url":"https://github.com/TeamPorcupine/ProjectPorcupine/issues/1251#issuecomment-246141367","issue_url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/issues/1251","id":246141367,"user":{"login":"sboigelot","id":6545998,"avatar_url":"https://avatars.githubusercontent.com/u/6545998?v=3","gravatar_id":"","url":"https://api.github.com/users/sboigelot","html_url":"https://github.com/sboigelot","followers_url":"https://api.github.com/users/sboigelot/followers","following_url":"https://api.github.com/users/sboigelot/following{/other_user}","gists_url":"https://api.github.com/users/sboigelot/gists{/gist_id}","starred_url":"https://api.github.com/users/sboigelot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sboigelot/subscriptions","organizations_url":"https://api.github.com/users/sboigelot/orgs","repos_url":"https://api.github.com/users/sboigelot/repos","events_url":"https://api.github.com/users/sboigelot/events{/privacy}","received_events_url":"https://api.github.com/users/sboigelot/received_events","type":"User","site_admin":false},"created_at":"2016-09-10T21:27:34Z","updated_at":"2016-09-10T21:27:34Z","body":"Can you post us your stylecop report, is my stylecop miss-configured?\r\nI only see 3 violation on master:\r\n\r\n------ StyleCop completed ------\r\n\r\n========== Violation Count: 3 ==========\r\n"}}
{"actor":{"display_login":"sboigelot"}}