{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/comments/171005173","pull_request_review_id":99782661,"id":171005173,"diff_hunk":"@@ -48,8 +48,7 @@ create_config! {\n     tab_spaces: usize, 4, true, \"Number of spaces per tab\";\n     newline_style: NewlineStyle, NewlineStyle::Unix, true, \"Unix or Windows line endings\";\n     indent_style: IndentStyle, IndentStyle::Block, false, \"How do we indent expressions or items.\";\n-    use_small_heuristics: bool, true, false, \"Whether to use different formatting for items and\\\n-        expressions if they satisfy a heuristic notion of 'small'.\";\n+    use_small_heuristics: LineWidth, LineWidth::Medium, false, \"The general width of lines.\";","path":"rustfmt-config/src/lib.rs","position":6,"original_position":6,"commit_id":"01b41f41a0811b25330d623b22c2e934f2e9662f","original_commit_id":"5c22f95f3b71f66bd253f5f276cb9aeb5a64dfcd","user":{"login":"radix","id":227068,"avatar_url":"https://avatars1.githubusercontent.com/u/227068?v=4","gravatar_id":"","url":"https://api.github.com/users/radix","html_url":"https://github.com/radix","followers_url":"https://api.github.com/users/radix/followers","following_url":"https://api.github.com/users/radix/following{/other_user}","gists_url":"https://api.github.com/users/radix/gists{/gist_id}","starred_url":"https://api.github.com/users/radix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radix/subscriptions","organizations_url":"https://api.github.com/users/radix/orgs","repos_url":"https://api.github.com/users/radix/repos","events_url":"https://api.github.com/users/radix/events{/privacy}","received_events_url":"https://api.github.com/users/radix/received_events","type":"User","site_admin":false},"body":"This is still the biggest thing holding me back from finishing up this PR. The line length heuristics are confusing. I don't think \"more horizontal\" vs \"more vertical\" even really describes the options.\r\n\r\n#### `use_small_heuristics: true`: (default)\r\n\r\n- function calls: 60%\r\n- struct literals: 18%\r\n- struct variants: 35%\r\n- arrays: 60%\r\n- chains: 60%\r\n- if/else: 50%\r\n\r\n#### `use_small_heuristics: false`\r\n\r\n- function calls: 100%\r\n- struct literals: 0%\r\n- struct variants: 0%\r\n- arrays: 100%\r\n- chains: 100%\r\n- if/else: 0%\r\n\r\nThis means that enabling heuristics leads to code being sometimes more vertical and sometimes less vertical. This makes it really hard for me to describe what `use_small_heuristics: false` does in plain English, which also makes it hard to come up with a non-boolean name for what it does :(","created_at":"2018-02-27T17:37:30Z","updated_at":"2018-02-27T17:37:30Z","html_url":"https://github.com/rust-lang-nursery/rustfmt/pull/2447#discussion_r171005173","pull_request_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/2447","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/comments/171005173"},"html":{"href":"https://github.com/rust-lang-nursery/rustfmt/pull/2447#discussion_r171005173"},"pull_request":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/2447"}},"in_reply_to_id":170149112},"pull_request":{"url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/2447","id":169439832,"html_url":"https://github.com/rust-lang-nursery/rustfmt/pull/2447","diff_url":"https://github.com/rust-lang-nursery/rustfmt/pull/2447.diff","patch_url":"https://github.com/rust-lang-nursery/rustfmt/pull/2447.patch","issue_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/issues/2447","number":2447,"state":"open","locked":false,"title":"WIP: Add an option for maximizing lines","user":{"login":"radix","id":227068,"avatar_url":"https://avatars1.githubusercontent.com/u/227068?v=4","gravatar_id":"","url":"https://api.github.com/users/radix","html_url":"https://github.com/radix","followers_url":"https://api.github.com/users/radix/followers","following_url":"https://api.github.com/users/radix/following{/other_user}","gists_url":"https://api.github.com/users/radix/gists{/gist_id}","starred_url":"https://api.github.com/users/radix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radix/subscriptions","organizations_url":"https://api.github.com/users/radix/orgs","repos_url":"https://api.github.com/users/radix/repos","events_url":"https://api.github.com/users/radix/events{/privacy}","received_events_url":"https://api.github.com/users/radix/received_events","type":"User","site_admin":false},"body":"#Fixes #2437 \r\n\r\nThis makes `use_small_heuristics` into a tri-state option with an explicit enum.\r\n\r\n- `Minimum` -- equivalent to old `use_small_heuristics: false`\r\n- `Medium` -- equivalent to old `use_small_heuristics: true` (default)\r\n- `Maximum` -- new behavior: set width heuristics equal to max_width.\r\n\r\n\r\nTODO:\r\n- [x] Update existing tests\r\n- [x] document the new behavior (a better description would be greatly appreciated)\r\n- [x] Add new tests (just a copy of chains.rs for now, should I do something more specific?)\r\n- [ ] `use_small_heuristics` obviously isn't a good name for this any more\r\n- [ ] determine if this is even what other people want\r\n\r\nFeedback appreciated!","created_at":"2018-02-15T17:44:50Z","updated_at":"2018-02-27T17:37:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17a22a2fc698b57371a42910537c623ca9c00a9d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/2447/commits","review_comments_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/2447/comments","review_comment_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/issues/2447/comments","statuses_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/statuses/01b41f41a0811b25330d623b22c2e934f2e9662f","head":{"label":"radix:maximize-lines","ref":"maximize-lines","sha":"01b41f41a0811b25330d623b22c2e934f2e9662f","user":{"login":"radix","id":227068,"avatar_url":"https://avatars1.githubusercontent.com/u/227068?v=4","gravatar_id":"","url":"https://api.github.com/users/radix","html_url":"https://github.com/radix","followers_url":"https://api.github.com/users/radix/followers","following_url":"https://api.github.com/users/radix/following{/other_user}","gists_url":"https://api.github.com/users/radix/gists{/gist_id}","starred_url":"https://api.github.com/users/radix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radix/subscriptions","organizations_url":"https://api.github.com/users/radix/orgs","repos_url":"https://api.github.com/users/radix/repos","events_url":"https://api.github.com/users/radix/events{/privacy}","received_events_url":"https://api.github.com/users/radix/received_events","type":"User","site_admin":false},"repo":{"id":121660050,"name":"rustfmt","full_name":"radix/rustfmt","owner":{"login":"radix","id":227068,"avatar_url":"https://avatars1.githubusercontent.com/u/227068?v=4","gravatar_id":"","url":"https://api.github.com/users/radix","html_url":"https://github.com/radix","followers_url":"https://api.github.com/users/radix/followers","following_url":"https://api.github.com/users/radix/following{/other_user}","gists_url":"https://api.github.com/users/radix/gists{/gist_id}","starred_url":"https://api.github.com/users/radix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radix/subscriptions","organizations_url":"https://api.github.com/users/radix/orgs","repos_url":"https://api.github.com/users/radix/repos","events_url":"https://api.github.com/users/radix/events{/privacy}","received_events_url":"https://api.github.com/users/radix/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/radix/rustfmt","description":"Format Rust code","fork":true,"url":"https://api.github.com/repos/radix/rustfmt","forks_url":"https://api.github.com/repos/radix/rustfmt/forks","keys_url":"https://api.github.com/repos/radix/rustfmt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/radix/rustfmt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/radix/rustfmt/teams","hooks_url":"https://api.github.com/repos/radix/rustfmt/hooks","issue_events_url":"https://api.github.com/repos/radix/rustfmt/issues/events{/number}","events_url":"https://api.github.com/repos/radix/rustfmt/events","assignees_url":"https://api.github.com/repos/radix/rustfmt/assignees{/user}","branches_url":"https://api.github.com/repos/radix/rustfmt/branches{/branch}","tags_url":"https://api.github.com/repos/radix/rustfmt/tags","blobs_url":"https://api.github.com/repos/radix/rustfmt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/radix/rustfmt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/radix/rustfmt/git/refs{/sha}","trees_url":"https://api.github.com/repos/radix/rustfmt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/radix/rustfmt/statuses/{sha}","languages_url":"https://api.github.com/repos/radix/rustfmt/languages","stargazers_url":"https://api.github.com/repos/radix/rustfmt/stargazers","contributors_url":"https://api.github.com/repos/radix/rustfmt/contributors","subscribers_url":"https://api.github.com/repos/radix/rustfmt/subscribers","subscription_url":"https://api.github.com/repos/radix/rustfmt/subscription","commits_url":"https://api.github.com/repos/radix/rustfmt/commits{/sha}","git_commits_url":"https://api.github.com/repos/radix/rustfmt/git/commits{/sha}","comments_url":"https://api.github.com/repos/radix/rustfmt/comments{/number}","issue_comment_url":"https://api.github.com/repos/radix/rustfmt/issues/comments{/number}","contents_url":"https://api.github.com/repos/radix/rustfmt/contents/{+path}","compare_url":"https://api.github.com/repos/radix/rustfmt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/radix/rustfmt/merges","archive_url":"https://api.github.com/repos/radix/rustfmt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/radix/rustfmt/downloads","issues_url":"https://api.github.com/repos/radix/rustfmt/issues{/number}","pulls_url":"https://api.github.com/repos/radix/rustfmt/pulls{/number}","milestones_url":"https://api.github.com/repos/radix/rustfmt/milestones{/number}","notifications_url":"https://api.github.com/repos/radix/rustfmt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/radix/rustfmt/labels{/name}","releases_url":"https://api.github.com/repos/radix/rustfmt/releases{/id}","deployments_url":"https://api.github.com/repos/radix/rustfmt/deployments","created_at":"2018-02-15T17:39:02Z","updated_at":"2018-02-15T17:39:04Z","pushed_at":"2018-02-17T03:52:26Z","git_url":"git://github.com/radix/rustfmt.git","ssh_url":"git@github.com:radix/rustfmt.git","clone_url":"https://github.com/radix/rustfmt.git","svn_url":"https://github.com/radix/rustfmt","homepage":null,"size":6527,"stargazers_count":0,"watchers_count":0,"language":"Rust","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang-nursery:master","ref":"master","sha":"091ed2f0a4a6a79c7280280d140e1d76c31b2012","user":{"login":"rust-lang-nursery","id":14631425,"avatar_url":"https://avatars1.githubusercontent.com/u/14631425?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang-nursery","html_url":"https://github.com/rust-lang-nursery","followers_url":"https://api.github.com/users/rust-lang-nursery/followers","following_url":"https://api.github.com/users/rust-lang-nursery/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang-nursery/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang-nursery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang-nursery/subscriptions","organizations_url":"https://api.github.com/users/rust-lang-nursery/orgs","repos_url":"https://api.github.com/users/rust-lang-nursery/repos","events_url":"https://api.github.com/users/rust-lang-nursery/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang-nursery/received_events","type":"Organization","site_admin":false},"repo":{"id":31830551,"name":"rustfmt","full_name":"rust-lang-nursery/rustfmt","owner":{"login":"rust-lang-nursery","id":14631425,"avatar_url":"https://avatars1.githubusercontent.com/u/14631425?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang-nursery","html_url":"https://github.com/rust-lang-nursery","followers_url":"https://api.github.com/users/rust-lang-nursery/followers","following_url":"https://api.github.com/users/rust-lang-nursery/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang-nursery/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang-nursery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang-nursery/subscriptions","organizations_url":"https://api.github.com/users/rust-lang-nursery/orgs","repos_url":"https://api.github.com/users/rust-lang-nursery/repos","events_url":"https://api.github.com/users/rust-lang-nursery/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang-nursery/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang-nursery/rustfmt","description":"Format Rust code","fork":false,"url":"https://api.github.com/repos/rust-lang-nursery/rustfmt","forks_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/forks","keys_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/teams","hooks_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/hooks","issue_events_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/events","assignees_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/tags","blobs_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/languages","stargazers_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/stargazers","contributors_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/contributors","subscribers_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/subscribers","subscription_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/subscription","commits_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/merges","archive_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/downloads","issues_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/deployments","created_at":"2015-03-07T22:51:56Z","updated_at":"2018-02-27T03:00:38Z","pushed_at":"2018-02-27T14:01:49Z","git_url":"git://github.com/rust-lang-nursery/rustfmt.git","ssh_url":"git@github.com:rust-lang-nursery/rustfmt.git","clone_url":"https://github.com/rust-lang-nursery/rustfmt.git","svn_url":"https://github.com/rust-lang-nursery/rustfmt","homepage":null,"size":6650,"stargazers_count":1490,"watchers_count":1490,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":291,"mirror_url":null,"archived":false,"open_issues_count":151,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":291,"open_issues":151,"watchers":1490,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/2447"},"html":{"href":"https://github.com/rust-lang-nursery/rustfmt/pull/2447"},"issue":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/issues/2447"},"comments":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/issues/2447/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/2447/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/2447/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/statuses/01b41f41a0811b25330d623b22c2e934f2e9662f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"radix"}}