{"action":"created","issue":{"url":"https://api.github.com/repos/checkstyle/checkstyle/issues/6106","repository_url":"https://api.github.com/repos/checkstyle/checkstyle","labels_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/6106/labels{/name}","comments_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/6106/comments","events_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/6106/events","html_url":"https://github.com/checkstyle/checkstyle/issues/6106","id":356646978,"node_id":"MDU6SXNzdWUzNTY2NDY5Nzg=","number":6106,"title":"Potentially invalid Indentation and WhitespaceAround violations with google_checks.xml with code formatted by google-java-format.","user":{"login":"nathanburrell","id":25831413,"node_id":"MDQ6VXNlcjI1ODMxNDEz","avatar_url":"https://avatars0.githubusercontent.com/u/25831413?v=4","gravatar_id":"","url":"https://api.github.com/users/nathanburrell","html_url":"https://github.com/nathanburrell","followers_url":"https://api.github.com/users/nathanburrell/followers","following_url":"https://api.github.com/users/nathanburrell/following{/other_user}","gists_url":"https://api.github.com/users/nathanburrell/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanburrell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanburrell/subscriptions","organizations_url":"https://api.github.com/users/nathanburrell/orgs","repos_url":"https://api.github.com/users/nathanburrell/repos","events_url":"https://api.github.com/users/nathanburrell/events{/privacy}","received_events_url":"https://api.github.com/users/nathanburrell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-09-04T04:14:12Z","updated_at":"2018-09-09T14:58:17Z","closed_at":null,"author_association":"NONE","body":"I have made the following repository to demonstrate the failures when running with the google_checks.xml against code formatted by the latest version of google-java-format.\r\n\r\nI believe the violations reported are incorrect as the code is formatted by the google java formatter and the formatters check passes the code, is it simply the case that the google_checks.xml is out of date in regards to formatting lambdas?\r\n\r\nA repository that contains example code to demonstrate the issue:\r\nhttps://bitbucket.org/nburrell/google-style\r\n\r\nCI build that demonstrates the issue:\r\nhttps://bitbucket.org/nburrell/google-style/addon/pipelines/home#!/results/4\r\n\r\nCode that is formatted correctly yet checkstyle violates:\r\n\r\n[IndentCheck](https://bitbucket.org/nburrell/google-style/src/master/src/main/java/com/atlassian/IndentCheck.java)\r\n[WhitespaceAround](https://bitbucket.org/nburrell/google-style/src/master/src/main/java/com/atlassian/WhitespaceAroundCheck.java)\r\n\r\nThe first command formats the code:\r\n`mvn com.coveo:fmt-maven-plugin:format`\r\n\r\n> [INFO] Processed 2 files (0 reformatted).\r\n\r\n The second uses the formatter check method to check the formatted code:\r\n`mvn com.coveo:fmt-maven-plugin:check`\r\n\r\n> [INFO] Processed 2 files (0 non-complying).\r\n\r\nThe third runs checkstyle which reports multiple violations:\r\n`mvn checkstyle:check`\r\n\r\n> [INFO] Starting audit...\r\n> [WARN] /home/nburrell/code/java/google-style/src/main/java/com/atlassian/WhitespaceAroundCheck.java:11:24: WhitespaceAround: '{' is not followed by whitespace. Empty blocks may only be represented as {} when not part of a multi-block statement (4.1.3) [WhitespaceAround]\r\n> [WARN] /home/nburrell/code/java/google-style/src/main/java/com/atlassian/WhitespaceAroundCheck.java:11:24: WhitespaceAround: '}' is not preceded with whitespace. [WhitespaceAround]\r\n> [WARN] /home/nburrell/code/java/google-style/src/main/java/com/atlassian/IndentCheck.java:15: 'lambda arguments' have incorrect indentation level 12, expected level should be one of the following: 6, 8. [Indentation]\r\n> [WARN] /home/nburrell/code/java/google-style/src/main/java/com/atlassian/IndentCheck.java:16: 'block' child have incorrect indentation level 14, expected level should be one of the following: 8, 10, 12. [Indentation]\r\n> [WARN] /home/nburrell/code/java/google-style/src/main/java/com/atlassian/IndentCheck.java:17: 'block rcurly' have incorrect indentation level 12, expected level should be one of the following: 6, 8. [Indentation]\r\n> Audit done.\r\n> [WARNING] src/main/java/com/atlassian/WhitespaceAroundCheck.java:[11,24] (whitespace) WhitespaceAround: WhitespaceAround: '{' is not followed by whitespace. Empty blocks may only be represented as {} when not part of a multi-block statement (4.1.3)\r\n> [WARNING] src/main/java/com/atlassian/WhitespaceAroundCheck.java:[11,24] (whitespace) WhitespaceAround: WhitespaceAround: '}' is not preceded with whitespace.\r\n> [WARNING] src/main/java/com/atlassian/IndentCheck.java:[15] (indentation) Indentation: 'lambda arguments' have incorrect indentation level 12, expected level should be one of the following: 6, 8.\r\n> [WARNING] src/main/java/com/atlassian/IndentCheck.java:[16] (indentation) Indentation: 'block' child have incorrect indentation level 14, expected level should be one of the following: 8, 10, 12.\r\n> [WARNING] src/main/java/com/atlassian/IndentCheck.java:[17] (indentation) Indentation: 'block rcurly' have incorrect indentation level 12, expected level should be one of the following: 6, 8."},"comment":{"url":"https://api.github.com/repos/checkstyle/checkstyle/issues/comments/419721617","html_url":"https://github.com/checkstyle/checkstyle/issues/6106#issuecomment-419721617","issue_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/6106","id":419721617,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTcyMTYxNw==","user":{"login":"romani","id":812984,"node_id":"MDQ6VXNlcjgxMjk4NA==","avatar_url":"https://avatars3.githubusercontent.com/u/812984?v=4","gravatar_id":"","url":"https://api.github.com/users/romani","html_url":"https://github.com/romani","followers_url":"https://api.github.com/users/romani/followers","following_url":"https://api.github.com/users/romani/following{/other_user}","gists_url":"https://api.github.com/users/romani/gists{/gist_id}","starred_url":"https://api.github.com/users/romani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romani/subscriptions","organizations_url":"https://api.github.com/users/romani/orgs","repos_url":"https://api.github.com/users/romani/repos","events_url":"https://api.github.com/users/romani/events{/privacy}","received_events_url":"https://api.github.com/users/romani/received_events","type":"User","site_admin":false},"created_at":"2018-09-09T14:58:17Z","updated_at":"2018-09-09T14:58:17Z","author_association":"MEMBER","body":"@nathanburrell ,\r\n\r\n> For the first issue (the WhitespaceAround violation) that is mismatched with section 4.1.3.\r\nA simple fix for this is to also configure allowEmptyLambdas to true (ive done this locally and that check now passes with the autoformatted code).\r\n\r\nplease create separate issue on this and be welcome with PR, please do not forget to add few test cases to ITs for google style\r\n\r\n> So the indent check appears to be incorrectly enforced.\r\n\r\nyes, IndentationCheck is full of problems - https://github.com/checkstyle/checkstyle/issues?q=is%3Aopen+is%3Aissue+label%3Aindentaion\r\nWe need help from community to help with this Check.\r\n\r\n=============\r\n\r\nOnes issue on WhitespaceAround is created, I this this issue can be closed."}}
{"actor":{"display_login":"romani"}}