{"action":"created","issue":{"url":"https://api.github.com/repos/diffplug/spotless/issues/46","repository_url":"https://api.github.com/repos/diffplug/spotless","labels_url":"https://api.github.com/repos/diffplug/spotless/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/diffplug/spotless/issues/46/comments","events_url":"https://api.github.com/repos/diffplug/spotless/issues/46/events","html_url":"https://github.com/diffplug/spotless/issues/46","id":186265495,"number":46,"title":"Feature suggestion: Fail compile on file contents","user":{"login":"HaasJona","id":4310707,"avatar_url":"https://avatars.githubusercontent.com/u/4310707?v=3","gravatar_id":"","url":"https://api.github.com/users/HaasJona","html_url":"https://github.com/HaasJona","followers_url":"https://api.github.com/users/HaasJona/followers","following_url":"https://api.github.com/users/HaasJona/following{/other_user}","gists_url":"https://api.github.com/users/HaasJona/gists{/gist_id}","starred_url":"https://api.github.com/users/HaasJona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaasJona/subscriptions","organizations_url":"https://api.github.com/users/HaasJona/orgs","repos_url":"https://api.github.com/users/HaasJona/repos","events_url":"https://api.github.com/users/HaasJona/events{/privacy}","received_events_url":"https://api.github.com/users/HaasJona/received_events","type":"User","site_admin":false},"labels":[{"id":204882936,"url":"https://api.github.com/repos/diffplug/spotless/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-31T11:51:54Z","updated_at":"2016-11-01T19:30:08Z","closed_at":"2016-11-01T19:30:08Z","body":"It's very nice that we can automatically reformat code and replace things with spotless, but we also have sometimes problems that aren't easily fixed by replacements (for example missing license headers (no, just adding them automatically doesn't work because we want to list contributors and so on), usage of prohibited/deprecated classes, swear words in comments and so on.\r\n\r\nIt would be great if we could do something like\r\n\r\n```\r\nspotless {\r\n\t\tjava {\r\n\t\t\tcustomFailure 'test', {\r\n                            // it = file contents\r\n                            if(it.contains(\"java.util.Scanner\") {\r\n                                fail('please use BufferedReader instead')\r\n                            }\r\n\t\t\t}\r\n\t\t}\r\n```\r\n\r\nof course that's a very rough example. The currect \"custom\" block unfortunately eats all exceptions more or less silently (\"Unable to apply step \"), else that would be a workaround by just replacing nothing and throwing an exception."},"comment":{"url":"https://api.github.com/repos/diffplug/spotless/issues/comments/257668937","html_url":"https://github.com/diffplug/spotless/issues/46#issuecomment-257668937","issue_url":"https://api.github.com/repos/diffplug/spotless/issues/46","id":257668937,"user":{"login":"nedtwigg","id":2924992,"avatar_url":"https://avatars.githubusercontent.com/u/2924992?v=3","gravatar_id":"","url":"https://api.github.com/users/nedtwigg","html_url":"https://github.com/nedtwigg","followers_url":"https://api.github.com/users/nedtwigg/followers","following_url":"https://api.github.com/users/nedtwigg/following{/other_user}","gists_url":"https://api.github.com/users/nedtwigg/gists{/gist_id}","starred_url":"https://api.github.com/users/nedtwigg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nedtwigg/subscriptions","organizations_url":"https://api.github.com/users/nedtwigg/orgs","repos_url":"https://api.github.com/users/nedtwigg/repos","events_url":"https://api.github.com/users/nedtwigg/events{/privacy}","received_events_url":"https://api.github.com/users/nedtwigg/received_events","type":"User","site_admin":false},"created_at":"2016-11-01T19:30:08Z","updated_at":"2016-11-01T19:30:08Z","body":"Shipped in 2.4.0."}}
{"actor":{"display_login":"nedtwigg"}}