{"action":"created","comment":{"url":"https://api.github.com/repos/user-cont/colin/pulls/comments/198503876","pull_request_review_id":132444037,"id":198503876,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODUwMzg3Ng==","diff_hunk":"@@ -16,16 +16,42 @@\n import json\n \n from six import iteritems\n+from colin.core.fmf_metadata_loader import get_fmf_from_class, set_fmf_metadata\n \n \n class AbstractCheck(object):\n     name = None\n+    message = \"\"\n+    description = \"\"\n+    reference_url = \"\"\n+    tags = []\n+    base_init_list = [\"message\", \"description\", \"reference_url\", \"tags\"]\n+    init_list = []\n \n-    def __init__(self, message, description, reference_url, tags):\n-        self.message = message\n-        self.description = description\n-        self.reference_url = reference_url\n-        self.tags = tags\n+    def _fmf_meta_init(self, args, kwargs):\n+        required_value_list = list(set(self.base_init_list + self.init_list))\n+        if len(args) > 0 or len(kwargs) > 0:","path":"colin/core/checks/abstract_check.py","position":23,"original_position":23,"commit_id":"b1c9241c46b5ababe303ec7f5a295b70b1a0d889","original_commit_id":"b1c9241c46b5ababe303ec7f5a295b70b1a0d889","user":{"login":"codacy-bot","id":19940114,"node_id":"MDQ6VXNlcjE5OTQwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [Do not use `len(SEQUENCE)` to determine if a sequence is empty](https://app.codacy.com/app/user-cont/colin/pullRequest?prid=1718817)","created_at":"2018-06-27T13:54:02Z","updated_at":"2018-06-27T13:54:02Z","html_url":"https://github.com/user-cont/colin/pull/141#discussion_r198503876","pull_request_url":"https://api.github.com/repos/user-cont/colin/pulls/141","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/user-cont/colin/pulls/comments/198503876"},"html":{"href":"https://github.com/user-cont/colin/pull/141#discussion_r198503876"},"pull_request":{"href":"https://api.github.com/repos/user-cont/colin/pulls/141"}}},"pull_request":{"url":"https://api.github.com/repos/user-cont/colin/pulls/141","id":191766647,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxNzY2NjQ3","html_url":"https://github.com/user-cont/colin/pull/141","diff_url":"https://github.com/user-cont/colin/pull/141.diff","patch_url":"https://github.com/user-cont/colin/pull/141.patch","issue_url":"https://api.github.com/repos/user-cont/colin/issues/141","number":141,"state":"open","locked":false,"title":"WIP add fmf metadata support to colin","user":{"login":"jscotka","id":8735467,"node_id":"MDQ6VXNlcjg3MzU0Njc=","avatar_url":"https://avatars0.githubusercontent.com/u/8735467?v=4","gravatar_id":"","url":"https://api.github.com/users/jscotka","html_url":"https://github.com/jscotka","followers_url":"https://api.github.com/users/jscotka/followers","following_url":"https://api.github.com/users/jscotka/following{/other_user}","gists_url":"https://api.github.com/users/jscotka/gists{/gist_id}","starred_url":"https://api.github.com/users/jscotka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jscotka/subscriptions","organizations_url":"https://api.github.com/users/jscotka/orgs","repos_url":"https://api.github.com/users/jscotka/repos","events_url":"https://api.github.com/users/jscotka/events{/privacy}","received_events_url":"https://api.github.com/users/jscotka/received_events","type":"User","site_admin":false},"body":"## First initial commit\r\nfmf metadata support in colin.\r\n\r\n## TODOs:\r\n- [x]  research how to ideally solve two `__init__()` or how to check that all variables are set\r\n- [x] find way how to name tests\r\n- [ ]  transform all `__init__` s to FMF compatible way\r\n- [ ] transform rulesets to FMF testsets\r\n- [ ] remove all duplicated stuff from colin what is already implemented by FMF\r\n\r\n### Colin output:\r\n```\r\n$ python -m colin.cli.colin list-checks\r\nmaintainer_label\r\n   -> Label 'maintainer' has to be specified.\r\n   -> The name and email of the maintainer (usually the submitter).\r\n   -> https://fedoraproject.org/wiki/Container:Guidelines#LABELS\r\n   -> maintainer, label, required\r\n\r\nfrom_tag_not_latest\r\n   -> In FROM, tag has to be specified and not 'latest'.\r\n   -> Using the 'latest' tag may cause unpredictable builds. It is recommended that a specific tag is used in the FROM.\r\n   -> https://fedoraproject.org/wiki/Container:Guidelines#FROM\r\n   -> from, dockerfile, baseimage, latest, required\r\n\r\nmaintainer_deprecated\r\n   -> Dockerfile instruction `MAINTAINER` is deprecated.\r\n   -> Replace with label 'maintainer'.\r\n   -> https://docs.docker.com/engine/reference/builder/#maintainer-deprecated\r\n   -> maintainer, dockerfile, deprecated, required\r\n```\r\n### FMF formatted output (list of tests):\r\n```\r\n$ fmf . --format '{}/{}:{}\\n' --value 'os.path.dirname(sources[-1])'  --value 'data[\"test\"]' --value 'data[\"class\"]'\r\n/home/jscotka/git/colin/colin/checks/dockerfile.py:FromTagNotLatestCheck\r\n/home/jscotka/git/colin/colin/checks/dockerfile.py:MaintainerDeprecatedCheck\r\n```\r\n\r\n### FMF output with all metadata displayed\r\n```\r\n$ fmf . \r\ncolin/colin/checks/dockerfile/from_tag_not_latest\r\nclass: FromTagNotLatestCheck\r\ndescription: Using the 'latest' tag may cause unpredictable builds. It is recommended that a specific tag is used in the FROM.\r\nmessage: In FROM, tag has to be specified and not 'latest'.\r\nreference_url: https://fedoraproject.org/wiki/Container:Guidelines#FROM\r\ntags: from, dockerfile, baseimage and latest\r\ntest: dockerfile.py\r\n\r\ncolin/colin/checks/dockerfile/maintainer_deprecated\r\nclass: MaintainerDeprecatedCheck\r\ndescription: Replace with label 'maintainer'.\r\ninstruction: MAINTAINER\r\nmax_count: 0\r\nmessage: Dockerfile instruction `MAINTAINER` is deprecated.\r\nreference_url: https://docs.docker.com/engine/reference/builder/#maintainer-deprecated\r\ntags: maintainer, dockerfile and deprecated\r\ntest: dockerfile.py\r\n```","created_at":"2018-05-31T14:11:12Z","updated_at":"2018-06-27T13:54:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"06fee55db5277cb2a52e6be8be52b2e4e6cdb674","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/user-cont/colin/pulls/141/commits","review_comments_url":"https://api.github.com/repos/user-cont/colin/pulls/141/comments","review_comment_url":"https://api.github.com/repos/user-cont/colin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/user-cont/colin/issues/141/comments","statuses_url":"https://api.github.com/repos/user-cont/colin/statuses/b1c9241c46b5ababe303ec7f5a295b70b1a0d889","head":{"label":"jscotka:fmf_metadata","ref":"fmf_metadata","sha":"b1c9241c46b5ababe303ec7f5a295b70b1a0d889","user":{"login":"jscotka","id":8735467,"node_id":"MDQ6VXNlcjg3MzU0Njc=","avatar_url":"https://avatars0.githubusercontent.com/u/8735467?v=4","gravatar_id":"","url":"https://api.github.com/users/jscotka","html_url":"https://github.com/jscotka","followers_url":"https://api.github.com/users/jscotka/followers","following_url":"https://api.github.com/users/jscotka/following{/other_user}","gists_url":"https://api.github.com/users/jscotka/gists{/gist_id}","starred_url":"https://api.github.com/users/jscotka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jscotka/subscriptions","organizations_url":"https://api.github.com/users/jscotka/orgs","repos_url":"https://api.github.com/users/jscotka/repos","events_url":"https://api.github.com/users/jscotka/events{/privacy}","received_events_url":"https://api.github.com/users/jscotka/received_events","type":"User","site_admin":false},"repo":{"id":135155805,"node_id":"MDEwOlJlcG9zaXRvcnkxMzUxNTU4MDU=","name":"colin","full_name":"jscotka/colin","owner":{"login":"jscotka","id":8735467,"node_id":"MDQ6VXNlcjg3MzU0Njc=","avatar_url":"https://avatars0.githubusercontent.com/u/8735467?v=4","gravatar_id":"","url":"https://api.github.com/users/jscotka","html_url":"https://github.com/jscotka","followers_url":"https://api.github.com/users/jscotka/followers","following_url":"https://api.github.com/users/jscotka/following{/other_user}","gists_url":"https://api.github.com/users/jscotka/gists{/gist_id}","starred_url":"https://api.github.com/users/jscotka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jscotka/subscriptions","organizations_url":"https://api.github.com/users/jscotka/orgs","repos_url":"https://api.github.com/users/jscotka/repos","events_url":"https://api.github.com/users/jscotka/events{/privacy}","received_events_url":"https://api.github.com/users/jscotka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jscotka/colin","description":"Tool to check generic rules/best-practices for containers/images/dockerfiles.","fork":true,"url":"https://api.github.com/repos/jscotka/colin","forks_url":"https://api.github.com/repos/jscotka/colin/forks","keys_url":"https://api.github.com/repos/jscotka/colin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jscotka/colin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jscotka/colin/teams","hooks_url":"https://api.github.com/repos/jscotka/colin/hooks","issue_events_url":"https://api.github.com/repos/jscotka/colin/issues/events{/number}","events_url":"https://api.github.com/repos/jscotka/colin/events","assignees_url":"https://api.github.com/repos/jscotka/colin/assignees{/user}","branches_url":"https://api.github.com/repos/jscotka/colin/branches{/branch}","tags_url":"https://api.github.com/repos/jscotka/colin/tags","blobs_url":"https://api.github.com/repos/jscotka/colin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jscotka/colin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jscotka/colin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jscotka/colin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jscotka/colin/statuses/{sha}","languages_url":"https://api.github.com/repos/jscotka/colin/languages","stargazers_url":"https://api.github.com/repos/jscotka/colin/stargazers","contributors_url":"https://api.github.com/repos/jscotka/colin/contributors","subscribers_url":"https://api.github.com/repos/jscotka/colin/subscribers","subscription_url":"https://api.github.com/repos/jscotka/colin/subscription","commits_url":"https://api.github.com/repos/jscotka/colin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jscotka/colin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jscotka/colin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jscotka/colin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jscotka/colin/contents/{+path}","compare_url":"https://api.github.com/repos/jscotka/colin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jscotka/colin/merges","archive_url":"https://api.github.com/repos/jscotka/colin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jscotka/colin/downloads","issues_url":"https://api.github.com/repos/jscotka/colin/issues{/number}","pulls_url":"https://api.github.com/repos/jscotka/colin/pulls{/number}","milestones_url":"https://api.github.com/repos/jscotka/colin/milestones{/number}","notifications_url":"https://api.github.com/repos/jscotka/colin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jscotka/colin/labels{/name}","releases_url":"https://api.github.com/repos/jscotka/colin/releases{/id}","deployments_url":"https://api.github.com/repos/jscotka/colin/deployments","created_at":"2018-05-28T12:07:20Z","updated_at":"2018-05-28T12:07:21Z","pushed_at":"2018-06-27T13:51:52Z","git_url":"git://github.com/jscotka/colin.git","ssh_url":"git@github.com:jscotka/colin.git","clone_url":"https://github.com/jscotka/colin.git","svn_url":"https://github.com/jscotka/colin","homepage":null,"size":5697,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"user-cont:master","ref":"master","sha":"536329f1f0d13b1fb20499114c3c4cb0b811883e","user":{"login":"user-cont","id":35456931,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NDU2OTMx","avatar_url":"https://avatars1.githubusercontent.com/u/35456931?v=4","gravatar_id":"","url":"https://api.github.com/users/user-cont","html_url":"https://github.com/user-cont","followers_url":"https://api.github.com/users/user-cont/followers","following_url":"https://api.github.com/users/user-cont/following{/other_user}","gists_url":"https://api.github.com/users/user-cont/gists{/gist_id}","starred_url":"https://api.github.com/users/user-cont/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/user-cont/subscriptions","organizations_url":"https://api.github.com/users/user-cont/orgs","repos_url":"https://api.github.com/users/user-cont/repos","events_url":"https://api.github.com/users/user-cont/events{/privacy}","received_events_url":"https://api.github.com/users/user-cont/received_events","type":"Organization","site_admin":false},"repo":{"id":124359252,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQzNTkyNTI=","name":"colin","full_name":"user-cont/colin","owner":{"login":"user-cont","id":35456931,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NDU2OTMx","avatar_url":"https://avatars1.githubusercontent.com/u/35456931?v=4","gravatar_id":"","url":"https://api.github.com/users/user-cont","html_url":"https://github.com/user-cont","followers_url":"https://api.github.com/users/user-cont/followers","following_url":"https://api.github.com/users/user-cont/following{/other_user}","gists_url":"https://api.github.com/users/user-cont/gists{/gist_id}","starred_url":"https://api.github.com/users/user-cont/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/user-cont/subscriptions","organizations_url":"https://api.github.com/users/user-cont/orgs","repos_url":"https://api.github.com/users/user-cont/repos","events_url":"https://api.github.com/users/user-cont/events{/privacy}","received_events_url":"https://api.github.com/users/user-cont/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/user-cont/colin","description":"Tool to check generic rules/best-practices for containers/images/dockerfiles.","fork":false,"url":"https://api.github.com/repos/user-cont/colin","forks_url":"https://api.github.com/repos/user-cont/colin/forks","keys_url":"https://api.github.com/repos/user-cont/colin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/user-cont/colin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/user-cont/colin/teams","hooks_url":"https://api.github.com/repos/user-cont/colin/hooks","issue_events_url":"https://api.github.com/repos/user-cont/colin/issues/events{/number}","events_url":"https://api.github.com/repos/user-cont/colin/events","assignees_url":"https://api.github.com/repos/user-cont/colin/assignees{/user}","branches_url":"https://api.github.com/repos/user-cont/colin/branches{/branch}","tags_url":"https://api.github.com/repos/user-cont/colin/tags","blobs_url":"https://api.github.com/repos/user-cont/colin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/user-cont/colin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/user-cont/colin/git/refs{/sha}","trees_url":"https://api.github.com/repos/user-cont/colin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/user-cont/colin/statuses/{sha}","languages_url":"https://api.github.com/repos/user-cont/colin/languages","stargazers_url":"https://api.github.com/repos/user-cont/colin/stargazers","contributors_url":"https://api.github.com/repos/user-cont/colin/contributors","subscribers_url":"https://api.github.com/repos/user-cont/colin/subscribers","subscription_url":"https://api.github.com/repos/user-cont/colin/subscription","commits_url":"https://api.github.com/repos/user-cont/colin/commits{/sha}","git_commits_url":"https://api.github.com/repos/user-cont/colin/git/commits{/sha}","comments_url":"https://api.github.com/repos/user-cont/colin/comments{/number}","issue_comment_url":"https://api.github.com/repos/user-cont/colin/issues/comments{/number}","contents_url":"https://api.github.com/repos/user-cont/colin/contents/{+path}","compare_url":"https://api.github.com/repos/user-cont/colin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/user-cont/colin/merges","archive_url":"https://api.github.com/repos/user-cont/colin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/user-cont/colin/downloads","issues_url":"https://api.github.com/repos/user-cont/colin/issues{/number}","pulls_url":"https://api.github.com/repos/user-cont/colin/pulls{/number}","milestones_url":"https://api.github.com/repos/user-cont/colin/milestones{/number}","notifications_url":"https://api.github.com/repos/user-cont/colin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/user-cont/colin/labels{/name}","releases_url":"https://api.github.com/repos/user-cont/colin/releases{/id}","deployments_url":"https://api.github.com/repos/user-cont/colin/deployments","created_at":"2018-03-08T08:15:35Z","updated_at":"2018-06-22T12:31:31Z","pushed_at":"2018-06-27T13:51:54Z","git_url":"git://github.com/user-cont/colin.git","ssh_url":"git@github.com:user-cont/colin.git","clone_url":"https://github.com/user-cont/colin.git","svn_url":"https://github.com/user-cont/colin","homepage":null,"size":5719,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":22,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":7,"open_issues":22,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/user-cont/colin/pulls/141"},"html":{"href":"https://github.com/user-cont/colin/pull/141"},"issue":{"href":"https://api.github.com/repos/user-cont/colin/issues/141"},"comments":{"href":"https://api.github.com/repos/user-cont/colin/issues/141/comments"},"review_comments":{"href":"https://api.github.com/repos/user-cont/colin/pulls/141/comments"},"review_comment":{"href":"https://api.github.com/repos/user-cont/colin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/user-cont/colin/pulls/141/commits"},"statuses":{"href":"https://api.github.com/repos/user-cont/colin/statuses/b1c9241c46b5ababe303ec7f5a295b70b1a0d889"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"codacy-bot"}}