{"action":"created","issue":{"url":"https://api.github.com/repos/checkstyle/checkstyle/issues/1045","labels_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/1045/labels{/name}","comments_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/1045/comments","events_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/1045/events","html_url":"https://github.com/checkstyle/checkstyle/pull/1045","id":72631072,"number":1045,"title":" Add LineSeparatorOption.ANY","user":{"login":"msteiger","id":1820007,"avatar_url":"https://avatars.githubusercontent.com/u/1820007?v=3","gravatar_id":"","url":"https://api.github.com/users/msteiger","html_url":"https://github.com/msteiger","followers_url":"https://api.github.com/users/msteiger/followers","following_url":"https://api.github.com/users/msteiger/following{/other_user}","gists_url":"https://api.github.com/users/msteiger/gists{/gist_id}","starred_url":"https://api.github.com/users/msteiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msteiger/subscriptions","organizations_url":"https://api.github.com/users/msteiger/orgs","repos_url":"https://api.github.com/users/msteiger/repos","events_url":"https://api.github.com/users/msteiger/events{/privacy}","received_events_url":"https://api.github.com/users/msteiger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-05-02T11:14:15Z","updated_at":"2015-05-17T15:57:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/checkstyle/checkstyle/pulls/1045","html_url":"https://github.com/checkstyle/checkstyle/pull/1045","diff_url":"https://github.com/checkstyle/checkstyle/pull/1045.diff","patch_url":"https://github.com/checkstyle/checkstyle/pull/1045.patch"},"body":"This PR adds the `LineSeparatorOption.ANY` and the respective checks in `NewlineAtEndOfFileCheck`. Also, a unit test is added to cover the new functionality.\r\n\r\n**Why is that useful?**\r\nOur team uses common configuration files, so we need to share one setting. However, I would like to use `LF` line endings on Windows, just as git does internally to avoid file conversions. This is currently not possible.\r\n\r\nWith the `ANY` option, the two questions \"Which line ending type is used?\" and \"Is there a new line at the end of the file\" can now be looked at separately. \r\n\r\nI also changed the comparison method from String to byte[] in the `US_ASCII` charset, as it avoids the wrapping and is invariant to the used Locale. It is also probably a lot faster.\r\n\r\nSidenote: The first question is not answered yet by any of the checks yet. Maybe a new LineEnding check makes sense to ensure that all files use the same type?\r\n\r\nI also added \"InputNewlineLfAtEndOfFile.java\" to `.gitattributes`, since the test explicitly covers `LF` line endings.\r\n\r\nhttps://help.github.com/articles/dealing-with-line-endings/\r\nhttp://git-scm.com/docs/gitattributes"},"comment":{"url":"https://api.github.com/repos/checkstyle/checkstyle/issues/comments/102817250","html_url":"https://github.com/checkstyle/checkstyle/pull/1045#issuecomment-102817250","issue_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/1045","id":102817250,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars.githubusercontent.com/u/2354108?v=3","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2015-05-17T15:57:07Z","updated_at":"2015-05-17T15:57:07Z","body":"\n[![Coverage Status](https://coveralls.io/builds/2583392/badge)](https://coveralls.io/builds/2583392)\n\nCoverage decreased (-0.09%) to 91.03% when pulling **4a6d737ff456ac85e8911e824dc5837a19b37207 on msteiger:line_endings_any** into **fb9f55e8905f9d7ff130f4f339d58ef26f3a20c7 on checkstyle:master**.\n"}}