{"action":"created","issue":{"url":"https://api.github.com/repos/se-edu/addressbook-level4/issues/238","repository_url":"https://api.github.com/repos/se-edu/addressbook-level4","labels_url":"https://api.github.com/repos/se-edu/addressbook-level4/issues/238/labels{/name}","comments_url":"https://api.github.com/repos/se-edu/addressbook-level4/issues/238/comments","events_url":"https://api.github.com/repos/se-edu/addressbook-level4/issues/238/events","html_url":"https://github.com/se-edu/addressbook-level4/pull/238","id":197676620,"number":238,"title":" Check for line endings in Travis CI #195 ","user":{"login":"pyokagan","id":109479,"avatar_url":"https://avatars.githubusercontent.com/u/109479?v=3","gravatar_id":"","url":"https://api.github.com/users/pyokagan","html_url":"https://github.com/pyokagan","followers_url":"https://api.github.com/users/pyokagan/followers","following_url":"https://api.github.com/users/pyokagan/following{/other_user}","gists_url":"https://api.github.com/users/pyokagan/gists{/gist_id}","starred_url":"https://api.github.com/users/pyokagan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyokagan/subscriptions","organizations_url":"https://api.github.com/users/pyokagan/orgs","repos_url":"https://api.github.com/users/pyokagan/repos","events_url":"https://api.github.com/users/pyokagan/events{/privacy}","received_events_url":"https://api.github.com/users/pyokagan/received_events","type":"User","site_admin":false},"labels":[{"id":456150764,"url":"https://api.github.com/repos/se-edu/addressbook-level4/labels/s.MergeApproved","name":"s.MergeApproved","color":"0e8a16","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-12-27T09:47:52Z","updated_at":"2017-01-01T14:30:49Z","closed_at":"2016-12-31T09:25:59Z","pull_request":{"url":"https://api.github.com/repos/se-edu/addressbook-level4/pulls/238","html_url":"https://github.com/se-edu/addressbook-level4/pull/238","diff_url":"https://github.com/se-edu/addressbook-level4/pull/238.diff","patch_url":"https://github.com/se-edu/addressbook-level4/pull/238.patch"},"body":"Fixes #195 \r\n\r\nIn our repository, we want:\r\n\r\n* All text files to use only LF ('\\n') as their line endings. Not CRLF\r\n  ('\\r\\n')\r\n\r\n* All text files to end with a newline (Newline at EOF).\r\n\r\nSo, ideally, we should have checks that automatically check for these\r\nrequirements in our repository.\r\n\r\nHowever, we can't impose these checks on all developers, namely Windows\r\ndevelopers. They could be using either LF or CRLF (e.g. if the developer\r\nactivated Git's core.autocrlf configuration). Even if we did, we can't\r\nguarantee that developers do not bypass these checks. As such, we have\r\nto implement these checks on the Travis CI level instead.\r\n\r\nThe next question is how do we implement these checks. Checkstyle is\r\nalready helping us with that, but it is not completely effective as it\r\ndoes not check *all* text files -- it only checks the source files which\r\nare used for compilation.  This means that it does not check things like\r\nresource files (CSS and FXML files), test data and documentation.\r\n\r\nWhile we could probably teach it to check all files, we meet another\r\nproblem; Checkstyle does not know what a text file is. At best, we can\r\nonly give it a filter of file extensions to check.\r\n\r\nOn the other hand, Git knows the difference between text files and\r\nbinary files. As such, let's implement some shell scripts that will use\r\nGit's facilities to implement our line ending checks on all text files.\r\nThese checks will be run on Travis CI, thus guaranteeing that master\r\nwill not have any more line ending problems.\r\n\r\nThese checks are implemented in POSIX shell scripts so that Travis CI\r\nwould not need to download any additional dependencies in order to run\r\nthem. Furthermore, developers running Linux or Macs can also run them\r\nlocally without downloading additional dependencies as well. Windows\r\ndevs would be unable to run them, but then again these line ending\r\nchecks are not useful to them because as mentioned above, Windows devs\r\nmay be using CRLF line endings anyway.\r\n\r\nWhile our checkstyle configuration already checks for trailing\r\nwhitespace in our java files, it does not cover all text files in our\r\nrepository. Notably: our documentation files and other configuration\r\nfiles such as `build.gradle`.\r\n\r\nWhile we could probably coax checkstyle and gradle to check for these\r\nfiles, it is much easier to just hook onto our existing \"Travis CI\r\nchecks\" architecture to implement this check.\r\n\r\nTrailing whitespace should be considered an error, however we treat\r\ntrailing whitespace in markdown (`*.md`) files as warnings instead to\r\naccomodate developers who prefer to edit documentation using the GitHub\r\nweb interface which does not provide facilities to easily detect and\r\nremove trailing whitespace.\r\n\r\n<!-- Reviewable:start -->\r\n---\r\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/se-edu/addressbook-level4/238)\r\n<!-- Reviewable:end -->\r\n"},"comment":{"url":"https://api.github.com/repos/se-edu/addressbook-level4/issues/comments/269905064","html_url":"https://github.com/se-edu/addressbook-level4/pull/238#issuecomment-269905064","issue_url":"https://api.github.com/repos/se-edu/addressbook-level4/issues/238","id":269905064,"user":{"login":"damithc","id":1673303,"avatar_url":"https://avatars.githubusercontent.com/u/1673303?v=3","gravatar_id":"","url":"https://api.github.com/users/damithc","html_url":"https://github.com/damithc","followers_url":"https://api.github.com/users/damithc/followers","following_url":"https://api.github.com/users/damithc/following{/other_user}","gists_url":"https://api.github.com/users/damithc/gists{/gist_id}","starred_url":"https://api.github.com/users/damithc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damithc/subscriptions","organizations_url":"https://api.github.com/users/damithc/orgs","repos_url":"https://api.github.com/users/damithc/repos","events_url":"https://api.github.com/users/damithc/events{/privacy}","received_events_url":"https://api.github.com/users/damithc/received_events","type":"User","site_admin":false},"created_at":"2017-01-01T14:30:49Z","updated_at":"2017-01-01T14:30:49Z","body":"@pyokagan \r\n\r\n> I just noticed that GitHub assigned you as the author for the squash commit d782898 :O Is that a GitHub bug?\r\n\r\nPossibly. Previously they used to mention all authors. e.g. 15d91fd909ad422aaa0cc13039cbb297c199b448\r\n\r\nIf this continues, it could affect mentionbot's effectiveness."}}
{"actor":{"display_login":"damithc"}}