{"action":"created","issue":{"url":"https://api.github.com/repos/flycheck/flycheck/issues/961","repository_url":"https://api.github.com/repos/flycheck/flycheck","labels_url":"https://api.github.com/repos/flycheck/flycheck/issues/961/labels{/name}","comments_url":"https://api.github.com/repos/flycheck/flycheck/issues/961/comments","events_url":"https://api.github.com/repos/flycheck/flycheck/issues/961/events","html_url":"https://github.com/flycheck/flycheck/pull/961","id":153948968,"number":961,"title":"New syntax checker chaining system","user":{"login":"lunaryorn","id":224922,"avatar_url":"https://avatars.githubusercontent.com/u/224922?v=3","gravatar_id":"","url":"https://api.github.com/users/lunaryorn","html_url":"https://github.com/lunaryorn","followers_url":"https://api.github.com/users/lunaryorn/followers","following_url":"https://api.github.com/users/lunaryorn/following{/other_user}","gists_url":"https://api.github.com/users/lunaryorn/gists{/gist_id}","starred_url":"https://api.github.com/users/lunaryorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lunaryorn/subscriptions","organizations_url":"https://api.github.com/users/lunaryorn/orgs","repos_url":"https://api.github.com/users/lunaryorn/repos","events_url":"https://api.github.com/users/lunaryorn/events{/privacy}","received_events_url":"https://api.github.com/users/lunaryorn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/flycheck/flycheck/labels/A-core","name":"A-core","color":"fbca04"},{"url":"https://api.github.com/repos/flycheck/flycheck/labels/K-feature","name":"K-feature","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-05-10T08:20:53Z","updated_at":"2016-05-18T08:02:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/flycheck/flycheck/pulls/961","html_url":"https://github.com/flycheck/flycheck/pull/961","diff_url":"https://github.com/flycheck/flycheck/pull/961.diff","patch_url":"https://github.com/flycheck/flycheck/pull/961.patch"},"body":"See #836 for a motivation.  To summarize, the current system is cumbersome to maintain and hard to understand.  This in-progress PR intends to provide a new simpler system that addresses these shortcomings.\r\n\r\nI'm opening it early to collect feedback on the approach and the implementation.  Inviting @flycheck/core-developers, @flycheck/maintainers, @mgudemann and @purcell.\r\n\r\nConnects to #836.\r\n\r\n# Design\r\n\r\nInstead of `:next-checkers` we now have three properties to control when a checker is selected:\r\n\r\n- `:kind`: The kind of syntax checker, e.g. `syntax`, `type`, `lint`, `style`, `test`, which serves to order checker execution.\r\n- `:conflicts-with`: A list of syntax checkers this syntax checker conflicts with, i.e. may not be used together with.\r\n- `:maximum-level`: The maximum error level in the current buffer this syntax checker should still run at.\r\n\r\nI hope that the meaning of these properties is fairly obvious:  Flycheck runs all syntax checkers in order of their `:kind` (e.g. syntax checkers before type checkers, and so on).  To find all checkers it goes through `flycheck-checkers` and collects all checkers that support the current buffer, and then evicts conflicting checkers from first to last.\r\n\r\nFinally, after it has assembled the chain, it runs all syntax checkers one by one, and skips over any checker if the highest error level in the current buffer is greater (by priority) than the `:maximum-level`.\r\n\r\n# Pros\r\n\r\n- The new system is easier to extend.  You just need to declare a proper `:kind` and the new checker seamlessly plugs into existing ones.  There's no need for `flycheck-add-next-checker` anymore.\r\n- It's also easier to understand, because there's no ambiguity in the meaning anymore.  With `:next-checkers` it was never obvious whether Flycheck would try to run all or just the first.\r\n- It scales a lot better:  For large chains, e.g. Go, it's much less maintenance work, because adding a new checker doesn't imply updating `:next-checkers` of all other Go checkers anymore.\r\n\r\n# Cons\r\n\r\n- With the new system selecting individual checkers doesn't make much sense anymore, so `flycheck-select-checker` and related functionality is gone.  We'll recommend buffer-local bindings of `flycheck-checkers` as alternative, which is actually simpler, too.  But there'll not be an interactive command anymore.\r\n- **It's a breaking change.**  That'll bring some inconvenience to extension authors, but we'll update all official extensions.  Others are on their own anyway, and I'd rather break things once than try and maintain a stub for `:next-checkers` indefinitely.\r\n\r\n# Status\r\n\r\n- [x] Collect a syntax checker chain (in progress, only lacks tests)\r\n- [ ] Declare chains in all syntax checkers\r\n- [ ] Run a syntax checker chain\r\n- [ ] Remove old next-checkers functionality\r\n- [ ] Remove `flycheck-select-checker` and friends\r\n- [ ] Add support for buffer local bindings of `flycheck-checkers`\r\n- [ ] Document the new chaining\r\n\r\n# Todo after merging\r\n\r\n- [ ] Update official Flycheck extensions that use `:next-checkers`."},"comment":{"url":"https://api.github.com/repos/flycheck/flycheck/issues/comments/219954359","html_url":"https://github.com/flycheck/flycheck/pull/961#issuecomment-219954359","issue_url":"https://api.github.com/repos/flycheck/flycheck/issues/961","id":219954359,"user":{"login":"Simplify","id":496260,"avatar_url":"https://avatars.githubusercontent.com/u/496260?v=3","gravatar_id":"","url":"https://api.github.com/users/Simplify","html_url":"https://github.com/Simplify","followers_url":"https://api.github.com/users/Simplify/followers","following_url":"https://api.github.com/users/Simplify/following{/other_user}","gists_url":"https://api.github.com/users/Simplify/gists{/gist_id}","starred_url":"https://api.github.com/users/Simplify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Simplify/subscriptions","organizations_url":"https://api.github.com/users/Simplify/orgs","repos_url":"https://api.github.com/users/Simplify/repos","events_url":"https://api.github.com/users/Simplify/events{/privacy}","received_events_url":"https://api.github.com/users/Simplify/received_events","type":"User","site_admin":false},"created_at":"2016-05-18T08:02:16Z","updated_at":"2016-05-18T08:02:16Z","body":"After reading what `proselint` does, I'll also put it in `style`. But some [checks](http://proselint.com/checks/) from `spelling` or `security` have nothing to do with style. I guess we can just ignore those, otherwise we'll have same problem with majority of JavaScript linters.\r\nHowever, I still think that we need kind `other`. Take a look at the screenshot on [flycheck-css-colorguard](https://github.com/Simplify/flycheck-css-colorguard). I still have hard time to place this checker into any of declared kinds."}}