{"action":"created","comment":{"url":"https://api.github.com/repos/jimhester/lintr/pulls/comments/218503151","pull_request_review_id":156456061,"id":218503151,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODUwMzE1MQ==","diff_hunk":"@@ -68,13 +68,26 @@ filter_chunk_end_positions <- function(starts, ends) {\n   }\n \n   positions <- sort(c(starts = starts, ends = ends))\n-  code_start_indexes <- which(grepl(\"starts\", names(positions)))\n+  code_start_indexes <- grep(\"starts\", names(positions))\n   code_ends <- positions[1 + code_start_indexes]\n \n   stopifnot(all(grepl(\"ends\", names(code_ends))))\n   code_ends\n }\n \n+defines_knitr_engine <- function(line) {\n+  # \"scala|python|bash|...\"\n+  engine_choices <- paste(names(knitr::knit_engines$get()), collapse = \"|\")\n+\n+  # Looks for {some_engine}, {some_engine label, ...} or {some_engine, ...}\n+  bare_engine_pattern <- paste0(\"\\\\{(\", engine_choices, \")[, }]\")","path":"R/extract.R","position":null,"original_position":28,"commit_id":"8b4cdb2012eee7ef7f022952b054bf27e6d1d16b","original_commit_id":"8cf8e4749aac00d9a4396f2abf0f9402f8490bf5","user":{"login":"russHyde","id":7734886,"node_id":"MDQ6VXNlcjc3MzQ4ODY=","avatar_url":"https://avatars0.githubusercontent.com/u/7734886?v=4","gravatar_id":"","url":"https://api.github.com/users/russHyde","html_url":"https://github.com/russHyde","followers_url":"https://api.github.com/users/russHyde/followers","following_url":"https://api.github.com/users/russHyde/following{/other_user}","gists_url":"https://api.github.com/users/russHyde/gists{/gist_id}","starred_url":"https://api.github.com/users/russHyde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russHyde/subscriptions","organizations_url":"https://api.github.com/users/russHyde/orgs","repos_url":"https://api.github.com/users/russHyde/repos","events_url":"https://api.github.com/users/russHyde/events{/privacy}","received_events_url":"https://api.github.com/users/russHyde/received_events","type":"User","site_admin":false},"body":"No problem. I've modified that and pushed. Hadn't used `rex` before.","created_at":"2018-09-18T16:26:51Z","updated_at":"2018-09-18T16:26:51Z","html_url":"https://github.com/jimhester/lintr/pull/350#discussion_r218503151","pull_request_url":"https://api.github.com/repos/jimhester/lintr/pulls/350","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/jimhester/lintr/pulls/comments/218503151"},"html":{"href":"https://github.com/jimhester/lintr/pull/350#discussion_r218503151"},"pull_request":{"href":"https://api.github.com/repos/jimhester/lintr/pulls/350"}},"in_reply_to_id":218493457},"pull_request":{"url":"https://api.github.com/repos/jimhester/lintr/pulls/350","id":216355570,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2MzU1NTcw","html_url":"https://github.com/jimhester/lintr/pull/350","diff_url":"https://github.com/jimhester/lintr/pull/350.diff","patch_url":"https://github.com/jimhester/lintr/pull/350.patch","issue_url":"https://api.github.com/repos/jimhester/lintr/issues/350","number":350,"state":"open","locked":false,"title":"fixes #322: allows Rmd chunks using {lang} engine format","user":{"login":"russHyde","id":7734886,"node_id":"MDQ6VXNlcjc3MzQ4ODY=","avatar_url":"https://avatars0.githubusercontent.com/u/7734886?v=4","gravatar_id":"","url":"https://api.github.com/users/russHyde","html_url":"https://github.com/russHyde","followers_url":"https://api.github.com/users/russHyde/followers","following_url":"https://api.github.com/users/russHyde/following{/other_user}","gists_url":"https://api.github.com/users/russHyde/gists{/gist_id}","starred_url":"https://api.github.com/users/russHyde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russHyde/subscriptions","organizations_url":"https://api.github.com/users/russHyde/orgs","repos_url":"https://api.github.com/users/russHyde/repos","events_url":"https://api.github.com/users/russHyde/events{/privacy}","received_events_url":"https://api.github.com/users/russHyde/received_events","type":"User","site_admin":false},"body":"Rmarkdown format allows the use of code blocks in the following format\r\n\r\n~~~~\r\n```{some_engine}\r\n# not necessarily R syntax\r\nfoo = bar\r\n```\r\n~~~~\r\n\r\nThese blocks should be filtered out before linting the remaining R-code blocks.\r\n\r\nA couple of python blocks were added to test.Rmd: one with R-like syntax and one with syntax that can't be parsed as R.\r\n\r\nThe function `defines_knitr_engine` was extracted from `extract_r_source` and extended. This tests for the presence of {r engine = some_engine} and {some_engine} in the start line of a code chunk. The names of valid engines are obtained from `knitr::knit_engines`\r\n\r\nAn unrelated, cosmetic change to `filter_chunk_end_positions` was made (which(grepl(...)) --> grep(...)).","created_at":"2018-09-18T15:42:32Z","updated_at":"2018-09-18T16:26:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"894b9a6700540ebdf7b4044c02229cc59b23c54e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jimhester/lintr/pulls/350/commits","review_comments_url":"https://api.github.com/repos/jimhester/lintr/pulls/350/comments","review_comment_url":"https://api.github.com/repos/jimhester/lintr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jimhester/lintr/issues/350/comments","statuses_url":"https://api.github.com/repos/jimhester/lintr/statuses/8b4cdb2012eee7ef7f022952b054bf27e6d1d16b","head":{"label":"russHyde:engineless_chunks2","ref":"engineless_chunks2","sha":"8b4cdb2012eee7ef7f022952b054bf27e6d1d16b","user":{"login":"russHyde","id":7734886,"node_id":"MDQ6VXNlcjc3MzQ4ODY=","avatar_url":"https://avatars0.githubusercontent.com/u/7734886?v=4","gravatar_id":"","url":"https://api.github.com/users/russHyde","html_url":"https://github.com/russHyde","followers_url":"https://api.github.com/users/russHyde/followers","following_url":"https://api.github.com/users/russHyde/following{/other_user}","gists_url":"https://api.github.com/users/russHyde/gists{/gist_id}","starred_url":"https://api.github.com/users/russHyde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russHyde/subscriptions","organizations_url":"https://api.github.com/users/russHyde/orgs","repos_url":"https://api.github.com/users/russHyde/repos","events_url":"https://api.github.com/users/russHyde/events{/privacy}","received_events_url":"https://api.github.com/users/russHyde/received_events","type":"User","site_admin":false},"repo":{"id":149290158,"node_id":"MDEwOlJlcG9zaXRvcnkxNDkyOTAxNTg=","name":"lintr","full_name":"russHyde/lintr","private":false,"owner":{"login":"russHyde","id":7734886,"node_id":"MDQ6VXNlcjc3MzQ4ODY=","avatar_url":"https://avatars0.githubusercontent.com/u/7734886?v=4","gravatar_id":"","url":"https://api.github.com/users/russHyde","html_url":"https://github.com/russHyde","followers_url":"https://api.github.com/users/russHyde/followers","following_url":"https://api.github.com/users/russHyde/following{/other_user}","gists_url":"https://api.github.com/users/russHyde/gists{/gist_id}","starred_url":"https://api.github.com/users/russHyde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russHyde/subscriptions","organizations_url":"https://api.github.com/users/russHyde/orgs","repos_url":"https://api.github.com/users/russHyde/repos","events_url":"https://api.github.com/users/russHyde/events{/privacy}","received_events_url":"https://api.github.com/users/russHyde/received_events","type":"User","site_admin":false},"html_url":"https://github.com/russHyde/lintr","description":"Static Code Analysis for R","fork":true,"url":"https://api.github.com/repos/russHyde/lintr","forks_url":"https://api.github.com/repos/russHyde/lintr/forks","keys_url":"https://api.github.com/repos/russHyde/lintr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/russHyde/lintr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/russHyde/lintr/teams","hooks_url":"https://api.github.com/repos/russHyde/lintr/hooks","issue_events_url":"https://api.github.com/repos/russHyde/lintr/issues/events{/number}","events_url":"https://api.github.com/repos/russHyde/lintr/events","assignees_url":"https://api.github.com/repos/russHyde/lintr/assignees{/user}","branches_url":"https://api.github.com/repos/russHyde/lintr/branches{/branch}","tags_url":"https://api.github.com/repos/russHyde/lintr/tags","blobs_url":"https://api.github.com/repos/russHyde/lintr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/russHyde/lintr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/russHyde/lintr/git/refs{/sha}","trees_url":"https://api.github.com/repos/russHyde/lintr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/russHyde/lintr/statuses/{sha}","languages_url":"https://api.github.com/repos/russHyde/lintr/languages","stargazers_url":"https://api.github.com/repos/russHyde/lintr/stargazers","contributors_url":"https://api.github.com/repos/russHyde/lintr/contributors","subscribers_url":"https://api.github.com/repos/russHyde/lintr/subscribers","subscription_url":"https://api.github.com/repos/russHyde/lintr/subscription","commits_url":"https://api.github.com/repos/russHyde/lintr/commits{/sha}","git_commits_url":"https://api.github.com/repos/russHyde/lintr/git/commits{/sha}","comments_url":"https://api.github.com/repos/russHyde/lintr/comments{/number}","issue_comment_url":"https://api.github.com/repos/russHyde/lintr/issues/comments{/number}","contents_url":"https://api.github.com/repos/russHyde/lintr/contents/{+path}","compare_url":"https://api.github.com/repos/russHyde/lintr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/russHyde/lintr/merges","archive_url":"https://api.github.com/repos/russHyde/lintr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/russHyde/lintr/downloads","issues_url":"https://api.github.com/repos/russHyde/lintr/issues{/number}","pulls_url":"https://api.github.com/repos/russHyde/lintr/pulls{/number}","milestones_url":"https://api.github.com/repos/russHyde/lintr/milestones{/number}","notifications_url":"https://api.github.com/repos/russHyde/lintr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/russHyde/lintr/labels{/name}","releases_url":"https://api.github.com/repos/russHyde/lintr/releases{/id}","deployments_url":"https://api.github.com/repos/russHyde/lintr/deployments","created_at":"2018-09-18T13:10:12Z","updated_at":"2018-09-18T13:10:14Z","pushed_at":"2018-09-18T16:25:25Z","git_url":"git://github.com/russHyde/lintr.git","ssh_url":"git@github.com:russHyde/lintr.git","clone_url":"https://github.com/russHyde/lintr.git","svn_url":"https://github.com/russHyde/lintr","homepage":"","size":579,"stargazers_count":0,"watchers_count":0,"language":"R","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":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jimhester:master","ref":"master","sha":"754aa567d888e6af83c1c28536dbf1b645e4802c","user":{"login":"jimhester","id":205275,"node_id":"MDQ6VXNlcjIwNTI3NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/205275?v=4","gravatar_id":"","url":"https://api.github.com/users/jimhester","html_url":"https://github.com/jimhester","followers_url":"https://api.github.com/users/jimhester/followers","following_url":"https://api.github.com/users/jimhester/following{/other_user}","gists_url":"https://api.github.com/users/jimhester/gists{/gist_id}","starred_url":"https://api.github.com/users/jimhester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimhester/subscriptions","organizations_url":"https://api.github.com/users/jimhester/orgs","repos_url":"https://api.github.com/users/jimhester/repos","events_url":"https://api.github.com/users/jimhester/events{/privacy}","received_events_url":"https://api.github.com/users/jimhester/received_events","type":"User","site_admin":false},"repo":{"id":24548375,"node_id":"MDEwOlJlcG9zaXRvcnkyNDU0ODM3NQ==","name":"lintr","full_name":"jimhester/lintr","private":false,"owner":{"login":"jimhester","id":205275,"node_id":"MDQ6VXNlcjIwNTI3NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/205275?v=4","gravatar_id":"","url":"https://api.github.com/users/jimhester","html_url":"https://github.com/jimhester","followers_url":"https://api.github.com/users/jimhester/followers","following_url":"https://api.github.com/users/jimhester/following{/other_user}","gists_url":"https://api.github.com/users/jimhester/gists{/gist_id}","starred_url":"https://api.github.com/users/jimhester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimhester/subscriptions","organizations_url":"https://api.github.com/users/jimhester/orgs","repos_url":"https://api.github.com/users/jimhester/repos","events_url":"https://api.github.com/users/jimhester/events{/privacy}","received_events_url":"https://api.github.com/users/jimhester/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jimhester/lintr","description":"Static Code Analysis for R","fork":false,"url":"https://api.github.com/repos/jimhester/lintr","forks_url":"https://api.github.com/repos/jimhester/lintr/forks","keys_url":"https://api.github.com/repos/jimhester/lintr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jimhester/lintr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jimhester/lintr/teams","hooks_url":"https://api.github.com/repos/jimhester/lintr/hooks","issue_events_url":"https://api.github.com/repos/jimhester/lintr/issues/events{/number}","events_url":"https://api.github.com/repos/jimhester/lintr/events","assignees_url":"https://api.github.com/repos/jimhester/lintr/assignees{/user}","branches_url":"https://api.github.com/repos/jimhester/lintr/branches{/branch}","tags_url":"https://api.github.com/repos/jimhester/lintr/tags","blobs_url":"https://api.github.com/repos/jimhester/lintr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jimhester/lintr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jimhester/lintr/git/refs{/sha}","trees_url":"https://api.github.com/repos/jimhester/lintr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jimhester/lintr/statuses/{sha}","languages_url":"https://api.github.com/repos/jimhester/lintr/languages","stargazers_url":"https://api.github.com/repos/jimhester/lintr/stargazers","contributors_url":"https://api.github.com/repos/jimhester/lintr/contributors","subscribers_url":"https://api.github.com/repos/jimhester/lintr/subscribers","subscription_url":"https://api.github.com/repos/jimhester/lintr/subscription","commits_url":"https://api.github.com/repos/jimhester/lintr/commits{/sha}","git_commits_url":"https://api.github.com/repos/jimhester/lintr/git/commits{/sha}","comments_url":"https://api.github.com/repos/jimhester/lintr/comments{/number}","issue_comment_url":"https://api.github.com/repos/jimhester/lintr/issues/comments{/number}","contents_url":"https://api.github.com/repos/jimhester/lintr/contents/{+path}","compare_url":"https://api.github.com/repos/jimhester/lintr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jimhester/lintr/merges","archive_url":"https://api.github.com/repos/jimhester/lintr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jimhester/lintr/downloads","issues_url":"https://api.github.com/repos/jimhester/lintr/issues{/number}","pulls_url":"https://api.github.com/repos/jimhester/lintr/pulls{/number}","milestones_url":"https://api.github.com/repos/jimhester/lintr/milestones{/number}","notifications_url":"https://api.github.com/repos/jimhester/lintr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jimhester/lintr/labels{/name}","releases_url":"https://api.github.com/repos/jimhester/lintr/releases{/id}","deployments_url":"https://api.github.com/repos/jimhester/lintr/deployments","created_at":"2014-09-28T02:48:15Z","updated_at":"2018-09-18T13:04:02Z","pushed_at":"2018-09-18T16:25:26Z","git_url":"git://github.com/jimhester/lintr.git","ssh_url":"git@github.com:jimhester/lintr.git","clone_url":"https://github.com/jimhester/lintr.git","svn_url":"https://github.com/jimhester/lintr","homepage":"","size":597,"stargazers_count":485,"watchers_count":485,"language":"R","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":89,"mirror_url":null,"archived":false,"open_issues_count":130,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":89,"open_issues":130,"watchers":485,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jimhester/lintr/pulls/350"},"html":{"href":"https://github.com/jimhester/lintr/pull/350"},"issue":{"href":"https://api.github.com/repos/jimhester/lintr/issues/350"},"comments":{"href":"https://api.github.com/repos/jimhester/lintr/issues/350/comments"},"review_comments":{"href":"https://api.github.com/repos/jimhester/lintr/pulls/350/comments"},"review_comment":{"href":"https://api.github.com/repos/jimhester/lintr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jimhester/lintr/pulls/350/commits"},"statuses":{"href":"https://api.github.com/repos/jimhester/lintr/statuses/8b4cdb2012eee7ef7f022952b054bf27e6d1d16b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"russHyde"}}