{"action":"created","issue":{"url":"https://api.github.com/repos/realm/SwiftLint/issues/1050","repository_url":"https://api.github.com/repos/realm/SwiftLint","labels_url":"https://api.github.com/repos/realm/SwiftLint/issues/1050/labels{/name}","comments_url":"https://api.github.com/repos/realm/SwiftLint/issues/1050/comments","events_url":"https://api.github.com/repos/realm/SwiftLint/issues/1050/events","html_url":"https://github.com/realm/SwiftLint/pull/1050","id":197466854,"number":1050,"title":"Add `educated_sorting` rule","user":{"login":"JamieEdge","id":1623997,"avatar_url":"https://avatars.githubusercontent.com/u/1623997?v=3","gravatar_id":"","url":"https://api.github.com/users/JamieEdge","html_url":"https://github.com/JamieEdge","followers_url":"https://api.github.com/users/JamieEdge/followers","following_url":"https://api.github.com/users/JamieEdge/following{/other_user}","gists_url":"https://api.github.com/users/JamieEdge/gists{/gist_id}","starred_url":"https://api.github.com/users/JamieEdge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JamieEdge/subscriptions","organizations_url":"https://api.github.com/users/JamieEdge/orgs","repos_url":"https://api.github.com/users/JamieEdge/repos","events_url":"https://api.github.com/users/JamieEdge/events{/privacy}","received_events_url":"https://api.github.com/users/JamieEdge/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-24T15:09:27Z","updated_at":"2016-12-24T19:25:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/realm/SwiftLint/pulls/1050","html_url":"https://github.com/realm/SwiftLint/pull/1050","diff_url":"https://github.com/realm/SwiftLint/pull/1050.diff","patch_url":"https://github.com/realm/SwiftLint/pull/1050.patch"},"body":"This branch adds the `educated_sorting` rule for arrays. It doesn't support auto-correction (yet) as this needs a bit more work on it to preserve original formatting and be efficient. It is opt-in due to the amount of issues that it could flag on an existing codebase.\r\n\r\nAs the PR also fixes all violations, I kept the actual changes in a parent branch, so you can see a cleaner diff: https://github.com/realm/SwiftLint/compare/master...JamieEdge:educated-sorting-rule\r\n\r\nConfiguration options:\r\n* threshold: The amount that the array already needs to be sorted before it can cause a violation. Defaults to 0.25 (25%).\r\n* min_items: The minimum number of items in the array before it can cause a violation. Defaults to `3`.\r\n* case_sensitive: Determines if case should be considered when sorting array items. Defaults to `true`."},"comment":{"url":"https://api.github.com/repos/realm/SwiftLint/issues/comments/269097215","html_url":"https://github.com/realm/SwiftLint/pull/1050#issuecomment-269097215","issue_url":"https://api.github.com/repos/realm/SwiftLint/issues/1050","id":269097215,"user":{"login":"JamieEdge","id":1623997,"avatar_url":"https://avatars.githubusercontent.com/u/1623997?v=3","gravatar_id":"","url":"https://api.github.com/users/JamieEdge","html_url":"https://github.com/JamieEdge","followers_url":"https://api.github.com/users/JamieEdge/followers","following_url":"https://api.github.com/users/JamieEdge/following{/other_user}","gists_url":"https://api.github.com/users/JamieEdge/gists{/gist_id}","starred_url":"https://api.github.com/users/JamieEdge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JamieEdge/subscriptions","organizations_url":"https://api.github.com/users/JamieEdge/orgs","repos_url":"https://api.github.com/users/JamieEdge/repos","events_url":"https://api.github.com/users/JamieEdge/events{/privacy}","received_events_url":"https://api.github.com/users/JamieEdge/received_events","type":"User","site_admin":false},"created_at":"2016-12-24T19:25:03Z","updated_at":"2016-12-24T19:25:03Z","body":"Sure, so if I adjust the rule to 8+ items and a 80%+ 'sortedness' would that be ideal? I did originally use higher values but for testing lowered the values as I couldn't sort my 4 item arrays (and just wasn't sure where to put the values back to)."}}
{"actor":{"display_login":"JamieEdge"}}