{"action":"created","comment":{"url":"https://api.github.com/repos/openhab/static-code-analysis/pulls/comments/134083972","pull_request_review_id":57187461,"id":134083972,"diff_hunk":"@@ -0,0 +1,248 @@\n+/**\n+ * Copyright (c) 2010-2017 by the respective copyright holders.\n+ *\n+ * All rights reserved. This program and the accompanying materials\n+ * are made available under the terms of the Eclipse Public License v1.0\n+ * which accompanies this distribution, and is available at\n+ * http://www.eclipse.org/legal/epl-v10.html\n+ */\n+package org.openhab.tools.analysis.checkstyle.test;\n+\n+import static com.puppycrawl.tools.checkstyle.utils.CommonUtils.EMPTY_STRING_ARRAY;\n+import static org.openhab.tools.analysis.checkstyle.api.CheckConstants.README_MD_FILE_NAME;\n+import org.openhab.tools.analysis.checkstyle.api.AbstractStaticCheckTest;\n+import org.openhab.tools.analysis.checkstyle.readme.MarkDownCheck;\n+import com.puppycrawl.tools.checkstyle.DefaultConfiguration;\n+import com.puppycrawl.tools.checkstyle.api.Configuration;\n+import java.io.File;\n+import java.io.IOException;\n+\n+import org.junit.Before;\n+import org.junit.Test;\n+\n+/**\n+ * Tests for {@link MarkDownCheck}\n+ *\n+ * @author Erdoan Hadzhiyusein - Initial implementation\n+ */\n+public class MarkDownCheckTest extends AbstractStaticCheckTest {\n+    private static final String README_MD_CHECK_TEST_DIRECTORY_NAME = \"markDownCheckTest\";\n+    private static final String ADDED_README_IN_BUILD_PROPERTIES_MSG = \"README.MD file must not be added to the bin.includes property\";\n+    private static final String ADDED_DOC_FOLDER_IN_BUILD_PROPERTIES_MSG = \"The doc folder must not be added to the bin.includes property\";\n+    private DefaultConfiguration config;\n+\n+    @Before\n+    public void setUpClass() {\n+        createValidConfig();\n+    }\n+\n+    @Test\n+    public void testHeader() throws Exception {\n+        String[] expectedMessages = generateExpectedMessages(1, \"Missing an empty line after the markdown header (#).\");\n+        verifyMarkDownFile(\"testHeader\", expectedMessages);\n+    }\n+\n+    @Test\n+    public void testNestedHeaderInText() throws Exception {\n+        String[] expectedMessages = EMPTY_STRING_ARRAY;\n+        verifyMarkDownFile(\"testNestedHeaderInText\", expectedMessages);\n+    }\n+\n+    @Test\n+    public void headerAtEndOfFile() throws Exception {\n+        String[] expectedMessages = generateExpectedMessages(6, \"Missing an empty line after the markdown header (#).\");","path":"src/test/java/org/openhab/tools/analysis/checkstyle/test/MarkDownCheckTest.java","position":53,"original_position":53,"commit_id":"08bb43573afaef773cd536df5ff5caa993b53ae4","original_commit_id":"08bb43573afaef773cd536df5ff5caa993b53ae4","user":{"login":"martinvw","id":2625279,"avatar_url":"https://avatars3.githubusercontent.com/u/2625279?v=4","gravatar_id":"","url":"https://api.github.com/users/martinvw","html_url":"https://github.com/martinvw","followers_url":"https://api.github.com/users/martinvw/followers","following_url":"https://api.github.com/users/martinvw/following{/other_user}","gists_url":"https://api.github.com/users/martinvw/gists{/gist_id}","starred_url":"https://api.github.com/users/martinvw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinvw/subscriptions","organizations_url":"https://api.github.com/users/martinvw/orgs","repos_url":"https://api.github.com/users/martinvw/repos","events_url":"https://api.github.com/users/martinvw/events{/privacy}","received_events_url":"https://api.github.com/users/martinvw/received_events","type":"User","site_admin":false},"body":"I still think this might not really be a proper error for this case","created_at":"2017-08-19T06:07:18Z","updated_at":"2017-08-19T06:14:19Z","html_url":"https://github.com/openhab/static-code-analysis/pull/139#discussion_r134083972","pull_request_url":"https://api.github.com/repos/openhab/static-code-analysis/pulls/139","_links":{"self":{"href":"https://api.github.com/repos/openhab/static-code-analysis/pulls/comments/134083972"},"html":{"href":"https://github.com/openhab/static-code-analysis/pull/139#discussion_r134083972"},"pull_request":{"href":"https://api.github.com/repos/openhab/static-code-analysis/pulls/139"}}},"pull_request":{"url":"https://api.github.com/repos/openhab/static-code-analysis/pulls/139","id":135357340,"html_url":"https://github.com/openhab/static-code-analysis/pull/139","diff_url":"https://github.com/openhab/static-code-analysis/pull/139.diff","patch_url":"https://github.com/openhab/static-code-analysis/pull/139.patch","issue_url":"https://api.github.com/repos/openhab/static-code-analysis/issues/139","number":139,"state":"open","locked":false,"title":"Adding README.md check. ","user":{"login":"doandzhi","id":17512690,"avatar_url":"https://avatars0.githubusercontent.com/u/17512690?v=4","gravatar_id":"","url":"https://api.github.com/users/doandzhi","html_url":"https://github.com/doandzhi","followers_url":"https://api.github.com/users/doandzhi/followers","following_url":"https://api.github.com/users/doandzhi/following{/other_user}","gists_url":"https://api.github.com/users/doandzhi/gists{/gist_id}","starred_url":"https://api.github.com/users/doandzhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doandzhi/subscriptions","organizations_url":"https://api.github.com/users/doandzhi/orgs","repos_url":"https://api.github.com/users/doandzhi/repos","events_url":"https://api.github.com/users/doandzhi/events{/privacy}","received_events_url":"https://api.github.com/users/doandzhi/received_events","type":"User","site_admin":false},"body":"**Task description** \r\n\r\nCreate a check that verifies a README.MD file. The requirements are described [here](https://www.eclipse.org/smarthome/documentation/development/bindings/docs.html). Some of the most important are:\r\n\r\n- There must be an empty line after every header (#...);\r\n- There must be an empty line before and after every list;\r\n- There must be an empty line before and after every code section.\r\n\r\nThere is an open issue about this check - https://github.com/openhab/static-code-analysis/issues/13.\r\n\r\nCloses #13 \r\nSigned-off-by: Erdoan Hadzhiyusein <3rdoan@gmail.com>","created_at":"2017-08-11T15:10:54Z","updated_at":"2017-08-19T06:14:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e9f336a4f27101625cdd59cab78ad16473cdee2","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/openhab/static-code-analysis/pulls/139/commits","review_comments_url":"https://api.github.com/repos/openhab/static-code-analysis/pulls/139/comments","review_comment_url":"https://api.github.com/repos/openhab/static-code-analysis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openhab/static-code-analysis/issues/139/comments","statuses_url":"https://api.github.com/repos/openhab/static-code-analysis/statuses/08bb43573afaef773cd536df5ff5caa993b53ae4","head":{"label":"MusalaSoft:markdown-check-erdo","ref":"markdown-check-erdo","sha":"08bb43573afaef773cd536df5ff5caa993b53ae4","user":{"login":"MusalaSoft","id":19668691,"avatar_url":"https://avatars0.githubusercontent.com/u/19668691?v=4","gravatar_id":"","url":"https://api.github.com/users/MusalaSoft","html_url":"https://github.com/MusalaSoft","followers_url":"https://api.github.com/users/MusalaSoft/followers","following_url":"https://api.github.com/users/MusalaSoft/following{/other_user}","gists_url":"https://api.github.com/users/MusalaSoft/gists{/gist_id}","starred_url":"https://api.github.com/users/MusalaSoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MusalaSoft/subscriptions","organizations_url":"https://api.github.com/users/MusalaSoft/orgs","repos_url":"https://api.github.com/users/MusalaSoft/repos","events_url":"https://api.github.com/users/MusalaSoft/events{/privacy}","received_events_url":"https://api.github.com/users/MusalaSoft/received_events","type":"Organization","site_admin":false},"repo":{"id":84063676,"name":"static-code-analysis","full_name":"MusalaSoft/static-code-analysis","owner":{"login":"MusalaSoft","id":19668691,"avatar_url":"https://avatars0.githubusercontent.com/u/19668691?v=4","gravatar_id":"","url":"https://api.github.com/users/MusalaSoft","html_url":"https://github.com/MusalaSoft","followers_url":"https://api.github.com/users/MusalaSoft/followers","following_url":"https://api.github.com/users/MusalaSoft/following{/other_user}","gists_url":"https://api.github.com/users/MusalaSoft/gists{/gist_id}","starred_url":"https://api.github.com/users/MusalaSoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MusalaSoft/subscriptions","organizations_url":"https://api.github.com/users/MusalaSoft/orgs","repos_url":"https://api.github.com/users/MusalaSoft/repos","events_url":"https://api.github.com/users/MusalaSoft/events{/privacy}","received_events_url":"https://api.github.com/users/MusalaSoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MusalaSoft/static-code-analysis","description":"Maven tooling for static code analysis","fork":true,"url":"https://api.github.com/repos/MusalaSoft/static-code-analysis","forks_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/forks","keys_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/teams","hooks_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/hooks","issue_events_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/issues/events{/number}","events_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/events","assignees_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/assignees{/user}","branches_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/branches{/branch}","tags_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/tags","blobs_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/git/refs{/sha}","trees_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/statuses/{sha}","languages_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/languages","stargazers_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/stargazers","contributors_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/contributors","subscribers_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/subscribers","subscription_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/subscription","commits_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/commits{/sha}","git_commits_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/git/commits{/sha}","comments_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/comments{/number}","issue_comment_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/issues/comments{/number}","contents_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/contents/{+path}","compare_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/merges","archive_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/downloads","issues_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/issues{/number}","pulls_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/pulls{/number}","milestones_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/milestones{/number}","notifications_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/labels{/name}","releases_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/releases{/id}","deployments_url":"https://api.github.com/repos/MusalaSoft/static-code-analysis/deployments","created_at":"2017-03-06T11:07:28Z","updated_at":"2017-03-06T11:07:30Z","pushed_at":"2017-08-18T14:00:42Z","git_url":"git://github.com/MusalaSoft/static-code-analysis.git","ssh_url":"git@github.com:MusalaSoft/static-code-analysis.git","clone_url":"https://github.com/MusalaSoft/static-code-analysis.git","svn_url":"https://github.com/MusalaSoft/static-code-analysis","homepage":null,"size":533,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openhab:master","ref":"master","sha":"88afd6cd98a7c14103551db2750971a14ccd6fde","user":{"login":"openhab","id":1007353,"avatar_url":"https://avatars0.githubusercontent.com/u/1007353?v=4","gravatar_id":"","url":"https://api.github.com/users/openhab","html_url":"https://github.com/openhab","followers_url":"https://api.github.com/users/openhab/followers","following_url":"https://api.github.com/users/openhab/following{/other_user}","gists_url":"https://api.github.com/users/openhab/gists{/gist_id}","starred_url":"https://api.github.com/users/openhab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openhab/subscriptions","organizations_url":"https://api.github.com/users/openhab/orgs","repos_url":"https://api.github.com/users/openhab/repos","events_url":"https://api.github.com/users/openhab/events{/privacy}","received_events_url":"https://api.github.com/users/openhab/received_events","type":"Organization","site_admin":false},"repo":{"id":83811108,"name":"static-code-analysis","full_name":"openhab/static-code-analysis","owner":{"login":"openhab","id":1007353,"avatar_url":"https://avatars0.githubusercontent.com/u/1007353?v=4","gravatar_id":"","url":"https://api.github.com/users/openhab","html_url":"https://github.com/openhab","followers_url":"https://api.github.com/users/openhab/followers","following_url":"https://api.github.com/users/openhab/following{/other_user}","gists_url":"https://api.github.com/users/openhab/gists{/gist_id}","starred_url":"https://api.github.com/users/openhab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openhab/subscriptions","organizations_url":"https://api.github.com/users/openhab/orgs","repos_url":"https://api.github.com/users/openhab/repos","events_url":"https://api.github.com/users/openhab/events{/privacy}","received_events_url":"https://api.github.com/users/openhab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openhab/static-code-analysis","description":"Maven tooling for static code analysis","fork":false,"url":"https://api.github.com/repos/openhab/static-code-analysis","forks_url":"https://api.github.com/repos/openhab/static-code-analysis/forks","keys_url":"https://api.github.com/repos/openhab/static-code-analysis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openhab/static-code-analysis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openhab/static-code-analysis/teams","hooks_url":"https://api.github.com/repos/openhab/static-code-analysis/hooks","issue_events_url":"https://api.github.com/repos/openhab/static-code-analysis/issues/events{/number}","events_url":"https://api.github.com/repos/openhab/static-code-analysis/events","assignees_url":"https://api.github.com/repos/openhab/static-code-analysis/assignees{/user}","branches_url":"https://api.github.com/repos/openhab/static-code-analysis/branches{/branch}","tags_url":"https://api.github.com/repos/openhab/static-code-analysis/tags","blobs_url":"https://api.github.com/repos/openhab/static-code-analysis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openhab/static-code-analysis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openhab/static-code-analysis/git/refs{/sha}","trees_url":"https://api.github.com/repos/openhab/static-code-analysis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openhab/static-code-analysis/statuses/{sha}","languages_url":"https://api.github.com/repos/openhab/static-code-analysis/languages","stargazers_url":"https://api.github.com/repos/openhab/static-code-analysis/stargazers","contributors_url":"https://api.github.com/repos/openhab/static-code-analysis/contributors","subscribers_url":"https://api.github.com/repos/openhab/static-code-analysis/subscribers","subscription_url":"https://api.github.com/repos/openhab/static-code-analysis/subscription","commits_url":"https://api.github.com/repos/openhab/static-code-analysis/commits{/sha}","git_commits_url":"https://api.github.com/repos/openhab/static-code-analysis/git/commits{/sha}","comments_url":"https://api.github.com/repos/openhab/static-code-analysis/comments{/number}","issue_comment_url":"https://api.github.com/repos/openhab/static-code-analysis/issues/comments{/number}","contents_url":"https://api.github.com/repos/openhab/static-code-analysis/contents/{+path}","compare_url":"https://api.github.com/repos/openhab/static-code-analysis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openhab/static-code-analysis/merges","archive_url":"https://api.github.com/repos/openhab/static-code-analysis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openhab/static-code-analysis/downloads","issues_url":"https://api.github.com/repos/openhab/static-code-analysis/issues{/number}","pulls_url":"https://api.github.com/repos/openhab/static-code-analysis/pulls{/number}","milestones_url":"https://api.github.com/repos/openhab/static-code-analysis/milestones{/number}","notifications_url":"https://api.github.com/repos/openhab/static-code-analysis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openhab/static-code-analysis/labels{/name}","releases_url":"https://api.github.com/repos/openhab/static-code-analysis/releases{/id}","deployments_url":"https://api.github.com/repos/openhab/static-code-analysis/deployments","created_at":"2017-03-03T15:12:39Z","updated_at":"2017-08-09T10:31:05Z","pushed_at":"2017-08-18T14:54:36Z","git_url":"git://github.com/openhab/static-code-analysis.git","ssh_url":"git@github.com:openhab/static-code-analysis.git","clone_url":"https://github.com/openhab/static-code-analysis.git","svn_url":"https://github.com/openhab/static-code-analysis","homepage":null,"size":471,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":14,"forks":7,"open_issues":14,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openhab/static-code-analysis/pulls/139"},"html":{"href":"https://github.com/openhab/static-code-analysis/pull/139"},"issue":{"href":"https://api.github.com/repos/openhab/static-code-analysis/issues/139"},"comments":{"href":"https://api.github.com/repos/openhab/static-code-analysis/issues/139/comments"},"review_comments":{"href":"https://api.github.com/repos/openhab/static-code-analysis/pulls/139/comments"},"review_comment":{"href":"https://api.github.com/repos/openhab/static-code-analysis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openhab/static-code-analysis/pulls/139/commits"},"statuses":{"href":"https://api.github.com/repos/openhab/static-code-analysis/statuses/08bb43573afaef773cd536df5ff5caa993b53ae4"}}}}
{"actor":{"display_login":"martinvw"}}