{"action":"created","issue":{"url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/2062","repository_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer","labels_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/2062/labels{/name}","comments_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/2062/comments","events_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/2062/events","html_url":"https://github.com/squizlabs/PHP_CodeSniffer/issues/2062","id":332696559,"node_id":"MDU6SXNzdWUzMzI2OTY1NTk=","number":2062,"title":"CodeSniffer.conf gets removed after version update","user":{"login":"digitalsounds","id":17026763,"node_id":"MDQ6VXNlcjE3MDI2NzYz","avatar_url":"https://avatars2.githubusercontent.com/u/17026763?v=4","gravatar_id":"","url":"https://api.github.com/users/digitalsounds","html_url":"https://github.com/digitalsounds","followers_url":"https://api.github.com/users/digitalsounds/followers","following_url":"https://api.github.com/users/digitalsounds/following{/other_user}","gists_url":"https://api.github.com/users/digitalsounds/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalsounds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalsounds/subscriptions","organizations_url":"https://api.github.com/users/digitalsounds/orgs","repos_url":"https://api.github.com/users/digitalsounds/repos","events_url":"https://api.github.com/users/digitalsounds/events{/privacy}","received_events_url":"https://api.github.com/users/digitalsounds/received_events","type":"User","site_admin":false},"labels":[{"id":144368661,"node_id":"MDU6TGFiZWwxNDQzNjg2NjE=","url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/labels/Awaiting%20Feedback","name":"Awaiting Feedback","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-15T08:58:08Z","updated_at":"2018-06-18T12:35:46Z","closed_at":null,"author_association":"NONE","body":"When running `composer global update`, if there is even a minor version update, e.g. from 3.2.3 to 3.3.0 then the CodeSniffer.conf gets removed (for me its here: ~/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer.conf) I have it installed globally. \r\nThis file as you know stores the global config settings for default_standard and installed_paths, etc; which means i lose these settings after every time code sniffer updates and i have to set them again, any way we can avoid this?"},"comment":{"url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/comments/398039369","html_url":"https://github.com/squizlabs/PHP_CodeSniffer/issues/2062#issuecomment-398039369","issue_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/2062","id":398039369,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODAzOTM2OQ==","user":{"login":"digitalsounds","id":17026763,"node_id":"MDQ6VXNlcjE3MDI2NzYz","avatar_url":"https://avatars2.githubusercontent.com/u/17026763?v=4","gravatar_id":"","url":"https://api.github.com/users/digitalsounds","html_url":"https://github.com/digitalsounds","followers_url":"https://api.github.com/users/digitalsounds/followers","following_url":"https://api.github.com/users/digitalsounds/following{/other_user}","gists_url":"https://api.github.com/users/digitalsounds/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalsounds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalsounds/subscriptions","organizations_url":"https://api.github.com/users/digitalsounds/orgs","repos_url":"https://api.github.com/users/digitalsounds/repos","events_url":"https://api.github.com/users/digitalsounds/events{/privacy}","received_events_url":"https://api.github.com/users/digitalsounds/received_events","type":"User","site_admin":false},"created_at":"2018-06-18T12:35:46Z","updated_at":"2018-06-18T12:35:46Z","author_association":"NONE","body":"So after looking into it a bit further, using composer's `-vvv` cli option when updating:\r\n```\r\ncomposer global require \"squizlabs/php_codesniffer=3.3.0\" -vvv\r\n```\r\nIt looks like composer uses zip archives to install the packages, which means the entire package directory is being completely overwritten when an update happens, this led me to think i could use the `--prefer-source` cli option when installing (this actually clones the repository into the vendor directory instead of using zip files)\":\r\n```\r\ncomposer global require \"squizlabs/php_codesniffer=3.3.0\" -vvv --prefer-source\r\n```\r\nThis in fact resolves the issue when updating (so the config file remains using this option), but I think you'd agree that this is not a very practical or long term solution, and the clone actually took quite a long time.\r\n\r\nI think a better solution would be to just change where this config file is stored in the first place; is this possible? i.e. so when we run:\r\n```\r\nphpcs --config-set default_standard PSR2\r\n```\r\ninstead of generating the file here:\r\n```\r\n~/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer.conf\r\n```\r\ncreate it here instead:\r\n```\r\n~/.CodeSniffer.conf\r\n```\r\n\r\nObviously you could play with the name a little."}}
{"actor":{"display_login":"digitalsounds"}}