{"action":"created","issue":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/2442","labels_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2442/labels{/name}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2442/comments","events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2442/events","html_url":"https://github.com/bbatsov/rubocop/issues/2442","id":117586010,"number":2442,"title":"Question: Setting up single rubocop setup for multiple repositories","user":{"login":"AvnerCohen","id":1297254,"avatar_url":"https://avatars.githubusercontent.com/u/1297254?v=3","gravatar_id":"","url":"https://api.github.com/users/AvnerCohen","html_url":"https://github.com/AvnerCohen","followers_url":"https://api.github.com/users/AvnerCohen/followers","following_url":"https://api.github.com/users/AvnerCohen/following{/other_user}","gists_url":"https://api.github.com/users/AvnerCohen/gists{/gist_id}","starred_url":"https://api.github.com/users/AvnerCohen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AvnerCohen/subscriptions","organizations_url":"https://api.github.com/users/AvnerCohen/orgs","repos_url":"https://api.github.com/users/AvnerCohen/repos","events_url":"https://api.github.com/users/AvnerCohen/events{/privacy}","received_events_url":"https://api.github.com/users/AvnerCohen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-18T13:24:17Z","updated_at":"2015-11-19T07:13:04Z","closed_at":"2015-11-19T07:13:04Z","body":"(1. Apologies if this is not the prefect place, if anywhere else is better, do let me know)\r\n(2. Regardless, once I come up with some conclusion, this can go into the wiki).\r\n(3. Sorry for the longish post)\r\n\r\n\r\n**Q: How would people recommend setup a single rubocop setup for multiple repositories and across many developers?**\r\n\r\nPartial Answer:\r\n\r\nIn our case, we defined a githook on commit, something like:\r\n\r\n````sh\r\nif ! bundle exec rubocop -c \"../style-guide/.rubocop.yml\" ; then\r\n  exit 1\r\nfi\r\n````\r\n\r\nWe make sure all repositories (think >50, in a micro-services environment) are under the same \"root\" folder and this command picks up the configuration file relatively.\r\n\r\nTo make sure the guidelines repo is present, we also have that in the same githook file:\r\n\r\n````sh\r\nif ! [ -e \"../style-guide/\" ] ; then\r\n  re=`git clone git@github.com:org/style-guide.git ../style-guide`\r\n  if [ $? -ne 0 ] ; then\r\n    echo \"Failed Cloning Style Guide.\"\r\n    exit 1\r\n  fi\r\nfi\r\n````\r\n\r\nSo this will once in the life time of all repositories, and from that point on, all files will be style checked against the same setup.\r\n\r\n\r\n\r\nThis hack is ugly, but is working.\r\nBut than things changes in the style guide, and somehow we need to propogate this to all developers, ask them to manually pull latest master or something..\r\nWe could of course pull latest with each commit, but this would be so nice, we can implement a code to pull every X commits to reduce impact, but this is weird..\r\n_______________________________________________\r\n\r\nAny thoughts on best ways to approach that?\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/comments/157972873","html_url":"https://github.com/bbatsov/rubocop/issues/2442#issuecomment-157972873","issue_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2442","id":157972873,"user":{"login":"AvnerCohen","id":1297254,"avatar_url":"https://avatars.githubusercontent.com/u/1297254?v=3","gravatar_id":"","url":"https://api.github.com/users/AvnerCohen","html_url":"https://github.com/AvnerCohen","followers_url":"https://api.github.com/users/AvnerCohen/followers","following_url":"https://api.github.com/users/AvnerCohen/following{/other_user}","gists_url":"https://api.github.com/users/AvnerCohen/gists{/gist_id}","starred_url":"https://api.github.com/users/AvnerCohen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AvnerCohen/subscriptions","organizations_url":"https://api.github.com/users/AvnerCohen/orgs","repos_url":"https://api.github.com/users/AvnerCohen/repos","events_url":"https://api.github.com/users/AvnerCohen/events{/privacy}","received_events_url":"https://api.github.com/users/AvnerCohen/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T07:13:04Z","updated_at":"2015-11-19T07:13:04Z","body":"OMG! this is exactly what i was after, thanks so much , and thanks @ptrippett for making that PR!\r\n"}}