{"action":"created","issue":{"url":"https://api.github.com/repos/OfficeDev/PnP/issues/316","labels_url":"https://api.github.com/repos/OfficeDev/PnP/issues/316/labels{/name}","comments_url":"https://api.github.com/repos/OfficeDev/PnP/issues/316/comments","events_url":"https://api.github.com/repos/OfficeDev/PnP/issues/316/events","html_url":"https://github.com/OfficeDev/PnP/issues/316","id":51887770,"number":316,"title":"FxCop custom rules for PnP","user":{"login":"jansenbe","id":7451219,"avatar_url":"https://avatars.githubusercontent.com/u/7451219?v=3","gravatar_id":"","url":"https://api.github.com/users/jansenbe","html_url":"https://github.com/jansenbe","followers_url":"https://api.github.com/users/jansenbe/followers","following_url":"https://api.github.com/users/jansenbe/following{/other_user}","gists_url":"https://api.github.com/users/jansenbe/gists{/gist_id}","starred_url":"https://api.github.com/users/jansenbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jansenbe/subscriptions","organizations_url":"https://api.github.com/users/jansenbe/orgs","repos_url":"https://api.github.com/users/jansenbe/repos","events_url":"https://api.github.com/users/jansenbe/events{/privacy}","received_events_url":"https://api.github.com/users/jansenbe/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OfficeDev/PnP/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-12-13T13:28:39Z","updated_at":"2015-03-04T13:38:28Z","closed_at":"2015-03-04T13:38:28Z","body":"From Erwin: \r\n\r\nI just created a custom FxCop rule that can check for it. It requires that we create a specific ruleset for the PnP project and include the assembly with the rule code somewhere in the dev branch. We then point to our custom rule set in the code analysis setting. I guess we then also should add the FxCop rule code to the dev branch. The code will of course not get compiled into the Core library, but it's a nice touch to have the FxCop rule visible too for other people to reuse. \r\n\r\nOf course it adds a bit of 'overhead'.\r\n•We add a new project to the dev branch containing the FxCop fule (a separate project because it needs references to 2 assemblies that are of no use for the Core library)\r\n•We create a new custom ruleset and add our custom rule to it\r\n•We use that ruleset for code analysis\r\n•This would open up things for more rules in the future of course :-)\r\n\r\nAny comments?\r\n\r\n[Update] It seems that Visual Studio likes the compiled assembly to be in place if it wants to use it in a ruleset. That's a bit ugly. Dynamically building the project and then using the assembly with the rules seems not to work for me.\r\n"},"comment":{"url":"https://api.github.com/repos/OfficeDev/PnP/issues/comments/77158523","html_url":"https://github.com/OfficeDev/PnP/issues/316#issuecomment-77158523","issue_url":"https://api.github.com/repos/OfficeDev/PnP/issues/316","id":77158523,"user":{"login":"erwinvanhunen","id":7666381,"avatar_url":"https://avatars.githubusercontent.com/u/7666381?v=3","gravatar_id":"","url":"https://api.github.com/users/erwinvanhunen","html_url":"https://github.com/erwinvanhunen","followers_url":"https://api.github.com/users/erwinvanhunen/followers","following_url":"https://api.github.com/users/erwinvanhunen/following{/other_user}","gists_url":"https://api.github.com/users/erwinvanhunen/gists{/gist_id}","starred_url":"https://api.github.com/users/erwinvanhunen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erwinvanhunen/subscriptions","organizations_url":"https://api.github.com/users/erwinvanhunen/orgs","repos_url":"https://api.github.com/users/erwinvanhunen/repos","events_url":"https://api.github.com/users/erwinvanhunen/events{/privacy}","received_events_url":"https://api.github.com/users/erwinvanhunen/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T13:38:28Z","updated_at":"2015-03-04T13:38:28Z","body":"Maybe we should close the issue for now. The pattern is pretty clear among the core team members that perform the merges."}}