{"action":"closed","number":6872,"pull_request":{"url":"https://api.github.com/repos/zulip/zulip/pulls/6872","id":144965668,"html_url":"https://github.com/zulip/zulip/pull/6872","diff_url":"https://github.com/zulip/zulip/pull/6872.diff","patch_url":"https://github.com/zulip/zulip/pull/6872.patch","issue_url":"https://api.github.com/repos/zulip/zulip/issues/6872","number":6872,"state":"closed","locked":false,"title":"Simplify \"code style\" guide where we could be using the linter instead.","user":{"login":"derAnfaenger","id":7950151,"avatar_url":"https://avatars2.githubusercontent.com/u/7950151?v=4","gravatar_id":"","url":"https://api.github.com/users/derAnfaenger","html_url":"https://github.com/derAnfaenger","followers_url":"https://api.github.com/users/derAnfaenger/followers","following_url":"https://api.github.com/users/derAnfaenger/following{/other_user}","gists_url":"https://api.github.com/users/derAnfaenger/gists{/gist_id}","starred_url":"https://api.github.com/users/derAnfaenger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derAnfaenger/subscriptions","organizations_url":"https://api.github.com/users/derAnfaenger/orgs","repos_url":"https://api.github.com/users/derAnfaenger/repos","events_url":"https://api.github.com/users/derAnfaenger/events{/privacy}","received_events_url":"https://api.github.com/users/derAnfaenger/received_events","type":"User","site_admin":false},"body":"This PR addresses every point in #6855, except three:\r\n\r\n> 1. Don't use the style= attribute in HTML. Instead, define logical classes and\r\nput your styles in external files such as zulip.css.\r\n\r\n  - I made the following linter rule:\r\n    ```python\r\n        {'pattern': 'style ?=',\r\n         'description': \"Don't use the `style=` attribute. Instead, define logical classes and\"\r\n                        \"put your styles in external files such as `zulip.css`.\",\r\n         'good_lines': ['#my-style {color: blue;}'],\r\n         'bad_lines': ['<p style=\"color: blue;\">Foo</p>', 'style = \"color: blue;\"']}\r\n    ```\r\n    It counted 74 occurrences of violations of this rule. Changing all these to classes seems like a bigger, \r\n    tedious task to do that is worth its own issue, should we decide to include this rule.\r\n\r\n---\r\n\r\n> 6. When selecting by id, don't use foo.pk when you mean foo.id.\r\n   This is easy to do with linting for [.]pk, we've got like a dozen violations we can fix.\r\n\r\n   - I don't really understand this case - `pk` is the primary key in Django, right? From what I've read \r\n     about this on SO, it appears to be more common to mistakenly use `id` instead of `pk`. Moreover, I \r\n     didn't see which of these ~dozen occurrences does in fact mistakenly use `pk`.\r\n\r\n---\r\n\r\n> (For this, I think a good strategy would be to ban shebang lines in .py files, and to add a lint section for files without an extension, and require that those shebang lines follow these rules).\r\n\r\n* I didn't see an easy way to make this work. Files with a python shebang get by default included in the \r\n  `py` file list by `lister`, so banning shebang lines in `.py`-only files doesn't seem possible. On the other \r\n  hand, moving all extensionless files to a new section doesn't make sense to me either, since this would \r\n  prevent all extensionless python files to be linted with python rules.","created_at":"2017-10-05T16:39:23Z","updated_at":"2017-10-06T20:20:06Z","closed_at":"2017-10-06T20:20:06Z","merged_at":null,"merge_commit_sha":"b406cdf084b251dc31b9525697f3851e7f544379","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/zulip/zulip/pulls/6872/commits","review_comments_url":"https://api.github.com/repos/zulip/zulip/pulls/6872/comments","review_comment_url":"https://api.github.com/repos/zulip/zulip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zulip/zulip/issues/6872/comments","statuses_url":"https://api.github.com/repos/zulip/zulip/statuses/3872e7aa17bb5ee138c1b831561a0c553e4ddc71","head":{"label":"derAnfaenger:52","ref":"52","sha":"3872e7aa17bb5ee138c1b831561a0c553e4ddc71","user":{"login":"derAnfaenger","id":7950151,"avatar_url":"https://avatars2.githubusercontent.com/u/7950151?v=4","gravatar_id":"","url":"https://api.github.com/users/derAnfaenger","html_url":"https://github.com/derAnfaenger","followers_url":"https://api.github.com/users/derAnfaenger/followers","following_url":"https://api.github.com/users/derAnfaenger/following{/other_user}","gists_url":"https://api.github.com/users/derAnfaenger/gists{/gist_id}","starred_url":"https://api.github.com/users/derAnfaenger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derAnfaenger/subscriptions","organizations_url":"https://api.github.com/users/derAnfaenger/orgs","repos_url":"https://api.github.com/users/derAnfaenger/repos","events_url":"https://api.github.com/users/derAnfaenger/events{/privacy}","received_events_url":"https://api.github.com/users/derAnfaenger/received_events","type":"User","site_admin":false},"repo":{"id":75082338,"name":"zulip","full_name":"derAnfaenger/zulip","owner":{"login":"derAnfaenger","id":7950151,"avatar_url":"https://avatars2.githubusercontent.com/u/7950151?v=4","gravatar_id":"","url":"https://api.github.com/users/derAnfaenger","html_url":"https://github.com/derAnfaenger","followers_url":"https://api.github.com/users/derAnfaenger/followers","following_url":"https://api.github.com/users/derAnfaenger/following{/other_user}","gists_url":"https://api.github.com/users/derAnfaenger/gists{/gist_id}","starred_url":"https://api.github.com/users/derAnfaenger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derAnfaenger/subscriptions","organizations_url":"https://api.github.com/users/derAnfaenger/orgs","repos_url":"https://api.github.com/users/derAnfaenger/repos","events_url":"https://api.github.com/users/derAnfaenger/events{/privacy}","received_events_url":"https://api.github.com/users/derAnfaenger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/derAnfaenger/zulip","description":"Zulip server - powerful open source group chat","fork":true,"url":"https://api.github.com/repos/derAnfaenger/zulip","forks_url":"https://api.github.com/repos/derAnfaenger/zulip/forks","keys_url":"https://api.github.com/repos/derAnfaenger/zulip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/derAnfaenger/zulip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/derAnfaenger/zulip/teams","hooks_url":"https://api.github.com/repos/derAnfaenger/zulip/hooks","issue_events_url":"https://api.github.com/repos/derAnfaenger/zulip/issues/events{/number}","events_url":"https://api.github.com/repos/derAnfaenger/zulip/events","assignees_url":"https://api.github.com/repos/derAnfaenger/zulip/assignees{/user}","branches_url":"https://api.github.com/repos/derAnfaenger/zulip/branches{/branch}","tags_url":"https://api.github.com/repos/derAnfaenger/zulip/tags","blobs_url":"https://api.github.com/repos/derAnfaenger/zulip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/derAnfaenger/zulip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/derAnfaenger/zulip/git/refs{/sha}","trees_url":"https://api.github.com/repos/derAnfaenger/zulip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/derAnfaenger/zulip/statuses/{sha}","languages_url":"https://api.github.com/repos/derAnfaenger/zulip/languages","stargazers_url":"https://api.github.com/repos/derAnfaenger/zulip/stargazers","contributors_url":"https://api.github.com/repos/derAnfaenger/zulip/contributors","subscribers_url":"https://api.github.com/repos/derAnfaenger/zulip/subscribers","subscription_url":"https://api.github.com/repos/derAnfaenger/zulip/subscription","commits_url":"https://api.github.com/repos/derAnfaenger/zulip/commits{/sha}","git_commits_url":"https://api.github.com/repos/derAnfaenger/zulip/git/commits{/sha}","comments_url":"https://api.github.com/repos/derAnfaenger/zulip/comments{/number}","issue_comment_url":"https://api.github.com/repos/derAnfaenger/zulip/issues/comments{/number}","contents_url":"https://api.github.com/repos/derAnfaenger/zulip/contents/{+path}","compare_url":"https://api.github.com/repos/derAnfaenger/zulip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/derAnfaenger/zulip/merges","archive_url":"https://api.github.com/repos/derAnfaenger/zulip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/derAnfaenger/zulip/downloads","issues_url":"https://api.github.com/repos/derAnfaenger/zulip/issues{/number}","pulls_url":"https://api.github.com/repos/derAnfaenger/zulip/pulls{/number}","milestones_url":"https://api.github.com/repos/derAnfaenger/zulip/milestones{/number}","notifications_url":"https://api.github.com/repos/derAnfaenger/zulip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/derAnfaenger/zulip/labels{/name}","releases_url":"https://api.github.com/repos/derAnfaenger/zulip/releases{/id}","deployments_url":"https://api.github.com/repos/derAnfaenger/zulip/deployments","created_at":"2016-11-29T13:06:39Z","updated_at":"2016-11-29T13:06:48Z","pushed_at":"2017-10-06T15:35:14Z","git_url":"git://github.com/derAnfaenger/zulip.git","ssh_url":"git@github.com:derAnfaenger/zulip.git","clone_url":"https://github.com/derAnfaenger/zulip.git","svn_url":"https://github.com/derAnfaenger/zulip","homepage":"","size":180134,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zulip:master","ref":"master","sha":"1a9adbbe70d3db7424ad180aa21e3c9275095ec3","user":{"login":"zulip","id":4921959,"avatar_url":"https://avatars2.githubusercontent.com/u/4921959?v=4","gravatar_id":"","url":"https://api.github.com/users/zulip","html_url":"https://github.com/zulip","followers_url":"https://api.github.com/users/zulip/followers","following_url":"https://api.github.com/users/zulip/following{/other_user}","gists_url":"https://api.github.com/users/zulip/gists{/gist_id}","starred_url":"https://api.github.com/users/zulip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zulip/subscriptions","organizations_url":"https://api.github.com/users/zulip/orgs","repos_url":"https://api.github.com/users/zulip/repos","events_url":"https://api.github.com/users/zulip/events{/privacy}","received_events_url":"https://api.github.com/users/zulip/received_events","type":"Organization","site_admin":false},"repo":{"id":43160685,"name":"zulip","full_name":"zulip/zulip","owner":{"login":"zulip","id":4921959,"avatar_url":"https://avatars2.githubusercontent.com/u/4921959?v=4","gravatar_id":"","url":"https://api.github.com/users/zulip","html_url":"https://github.com/zulip","followers_url":"https://api.github.com/users/zulip/followers","following_url":"https://api.github.com/users/zulip/following{/other_user}","gists_url":"https://api.github.com/users/zulip/gists{/gist_id}","starred_url":"https://api.github.com/users/zulip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zulip/subscriptions","organizations_url":"https://api.github.com/users/zulip/orgs","repos_url":"https://api.github.com/users/zulip/repos","events_url":"https://api.github.com/users/zulip/events{/privacy}","received_events_url":"https://api.github.com/users/zulip/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zulip/zulip","description":"Zulip server - powerful open source group chat","fork":false,"url":"https://api.github.com/repos/zulip/zulip","forks_url":"https://api.github.com/repos/zulip/zulip/forks","keys_url":"https://api.github.com/repos/zulip/zulip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zulip/zulip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zulip/zulip/teams","hooks_url":"https://api.github.com/repos/zulip/zulip/hooks","issue_events_url":"https://api.github.com/repos/zulip/zulip/issues/events{/number}","events_url":"https://api.github.com/repos/zulip/zulip/events","assignees_url":"https://api.github.com/repos/zulip/zulip/assignees{/user}","branches_url":"https://api.github.com/repos/zulip/zulip/branches{/branch}","tags_url":"https://api.github.com/repos/zulip/zulip/tags","blobs_url":"https://api.github.com/repos/zulip/zulip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zulip/zulip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zulip/zulip/git/refs{/sha}","trees_url":"https://api.github.com/repos/zulip/zulip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zulip/zulip/statuses/{sha}","languages_url":"https://api.github.com/repos/zulip/zulip/languages","stargazers_url":"https://api.github.com/repos/zulip/zulip/stargazers","contributors_url":"https://api.github.com/repos/zulip/zulip/contributors","subscribers_url":"https://api.github.com/repos/zulip/zulip/subscribers","subscription_url":"https://api.github.com/repos/zulip/zulip/subscription","commits_url":"https://api.github.com/repos/zulip/zulip/commits{/sha}","git_commits_url":"https://api.github.com/repos/zulip/zulip/git/commits{/sha}","comments_url":"https://api.github.com/repos/zulip/zulip/comments{/number}","issue_comment_url":"https://api.github.com/repos/zulip/zulip/issues/comments{/number}","contents_url":"https://api.github.com/repos/zulip/zulip/contents/{+path}","compare_url":"https://api.github.com/repos/zulip/zulip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zulip/zulip/merges","archive_url":"https://api.github.com/repos/zulip/zulip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zulip/zulip/downloads","issues_url":"https://api.github.com/repos/zulip/zulip/issues{/number}","pulls_url":"https://api.github.com/repos/zulip/zulip/pulls{/number}","milestones_url":"https://api.github.com/repos/zulip/zulip/milestones{/number}","notifications_url":"https://api.github.com/repos/zulip/zulip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zulip/zulip/labels{/name}","releases_url":"https://api.github.com/repos/zulip/zulip/releases{/id}","deployments_url":"https://api.github.com/repos/zulip/zulip/deployments","created_at":"2015-09-25T16:37:25Z","updated_at":"2017-10-06T18:09:08Z","pushed_at":"2017-10-06T20:18:42Z","git_url":"git://github.com/zulip/zulip.git","ssh_url":"git@github.com:zulip/zulip.git","clone_url":"https://github.com/zulip/zulip.git","svn_url":"https://github.com/zulip/zulip","homepage":"","size":180132,"stargazers_count":5297,"watchers_count":5297,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1595,"mirror_url":null,"open_issues_count":915,"forks":1595,"open_issues":915,"watchers":5297,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zulip/zulip/pulls/6872"},"html":{"href":"https://github.com/zulip/zulip/pull/6872"},"issue":{"href":"https://api.github.com/repos/zulip/zulip/issues/6872"},"comments":{"href":"https://api.github.com/repos/zulip/zulip/issues/6872/comments"},"review_comments":{"href":"https://api.github.com/repos/zulip/zulip/pulls/6872/comments"},"review_comment":{"href":"https://api.github.com/repos/zulip/zulip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zulip/zulip/pulls/6872/commits"},"statuses":{"href":"https://api.github.com/repos/zulip/zulip/statuses/3872e7aa17bb5ee138c1b831561a0c553e4ddc71"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":false,"rebaseable":false,"mergeable_state":"dirty","merged_by":null,"comments":6,"review_comments":0,"maintainer_can_modify":false,"commits":5,"additions":34,"deletions":36,"changed_files":9}}
{"actor":{"display_login":"timabbott"}}