{"action":"opened","issue":{"url":"https://api.github.com/repos/SaschaGalley/grunt-phpcs/issues/39","labels_url":"https://api.github.com/repos/SaschaGalley/grunt-phpcs/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/SaschaGalley/grunt-phpcs/issues/39/comments","events_url":"https://api.github.com/repos/SaschaGalley/grunt-phpcs/issues/39/events","html_url":"https://github.com/SaschaGalley/grunt-phpcs/issues/39","id":72405475,"number":39,"title":"Allow global definition of src","user":{"login":"andrewholgate","id":3862180,"avatar_url":"https://avatars.githubusercontent.com/u/3862180?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewholgate","html_url":"https://github.com/andrewholgate","followers_url":"https://api.github.com/users/andrewholgate/followers","following_url":"https://api.github.com/users/andrewholgate/following{/other_user}","gists_url":"https://api.github.com/users/andrewholgate/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewholgate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewholgate/subscriptions","organizations_url":"https://api.github.com/users/andrewholgate/orgs","repos_url":"https://api.github.com/users/andrewholgate/repos","events_url":"https://api.github.com/users/andrewholgate/events{/privacy}","received_events_url":"https://api.github.com/users/andrewholgate/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-01T10:45:51Z","updated_at":"2015-05-01T10:45:51Z","closed_at":null,"body":"Rather than having to define `src` inside of a task, it would be useful to define it globally and with each task being able to override it if necessary.\r\n\r\nA common use-case for PHPCS is to have the exact same `src` files being examined but with different outputs, eg. CLI output for developers and a XML report for CI.\r\n\r\nProposal:\r\n\r\n```\r\nphpcs: {\r\n    options: {\r\n        bin: \"vendor/bin/phpcs\",\r\n        standard: \"Drupal\",\r\n        tabWidth: 4\r\n    },\r\n    src: [\r\n        \"code/**/*.php\",\r\n        \"code/**/*.module\",\r\n        \"code/**/*.install\",\r\n        \"code/**/*.profile\",\r\n        \"code/**/*.drush.inc\",\r\n        \"code/**/*.test\",\r\n        \"code/**/*.js\",\r\n        \"code/**/*.css\"\r\n    ],\r\n    dev: {\r\n        options: {\r\n            verbose: true\r\n        }\r\n    },\r\n    ci: {\r\n        options: {\r\n            report: \"checkstyle\",\r\n            reportFile: \"reports/checkstyle.xml\",\r\n        }\r\n    }\r\n}\r\n```"}}