{"action":"created","issue":{"url":"https://api.github.com/repos/palantir/tslint/issues/620","labels_url":"https://api.github.com/repos/palantir/tslint/issues/620/labels{/name}","comments_url":"https://api.github.com/repos/palantir/tslint/issues/620/comments","events_url":"https://api.github.com/repos/palantir/tslint/issues/620/events","html_url":"https://github.com/palantir/tslint/issues/620","id":103738123,"number":620,"title":"Simplify Testing System for Rules","user":{"login":"JKillian","id":1400151,"avatar_url":"https://avatars.githubusercontent.com/u/1400151?v=3","gravatar_id":"","url":"https://api.github.com/users/JKillian","html_url":"https://github.com/JKillian","followers_url":"https://api.github.com/users/JKillian/followers","following_url":"https://api.github.com/users/JKillian/following{/other_user}","gists_url":"https://api.github.com/users/JKillian/gists{/gist_id}","starred_url":"https://api.github.com/users/JKillian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JKillian/subscriptions","organizations_url":"https://api.github.com/users/JKillian/orgs","repos_url":"https://api.github.com/users/JKillian/repos","events_url":"https://api.github.com/users/JKillian/events{/privacy}","received_events_url":"https://api.github.com/users/JKillian/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/palantir/tslint/labels/P2","name":"P2","color":"bbbbbb"},{"url":"https://api.github.com/repos/palantir/tslint/labels/Status:%20In%20Discussion","name":"Status: In Discussion","color":"eb6420"},{"url":"https://api.github.com/repos/palantir/tslint/labels/Type:%20Enhancement","name":"Type: Enhancement","color":"2588C4"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-28T15:20:12Z","updated_at":"2015-08-28T15:24:19Z","closed_at":null,"body":"Finding numerical positions of failures is tedious and inflexible (if the test file changes, all the failures move.) Instead, we could use some sort of marking system:\r\n\r\n```typescript\r\n/*fail:0*/var/*endfail:0*/ foo;\r\n\r\nfunction tmp(t: any) {\r\n    /*fail:1*/var/*endfail:1*/ x = 3;\r\n}\r\n\r\n/*fail:2*/var/*endfail:2*/ i,\r\n    j;\r\n\r\n/*fail:3*/var/*endfail:3*/ [a, b] = [1, 2];\r\n\r\ndeclare var tmp2: any;\r\n\r\nlet bar;\r\nconst qux;\r\n\r\nlet k,\r\n    l;\r\n\r\nmodule quz {\r\n    export var i;\r\n}\r\n\r\nlet [x, y] = [1, 2];\r\n```\r\n\r\nAdmittedly this makes the test files slightly harder to read, but overall it seems like a much easier and maintainable system. (This issue is about coming up with a better system in general, it doesn't have to follow the example above)"},"comment":{"url":"https://api.github.com/repos/palantir/tslint/issues/comments/135805626","html_url":"https://github.com/palantir/tslint/issues/620#issuecomment-135805626","issue_url":"https://api.github.com/repos/palantir/tslint/issues/620","id":135805626,"user":{"login":"ashwinr","id":362990,"avatar_url":"https://avatars.githubusercontent.com/u/362990?v=3","gravatar_id":"","url":"https://api.github.com/users/ashwinr","html_url":"https://github.com/ashwinr","followers_url":"https://api.github.com/users/ashwinr/followers","following_url":"https://api.github.com/users/ashwinr/following{/other_user}","gists_url":"https://api.github.com/users/ashwinr/gists{/gist_id}","starred_url":"https://api.github.com/users/ashwinr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashwinr/subscriptions","organizations_url":"https://api.github.com/users/ashwinr/orgs","repos_url":"https://api.github.com/users/ashwinr/repos","events_url":"https://api.github.com/users/ashwinr/events{/privacy}","received_events_url":"https://api.github.com/users/ashwinr/received_events","type":"User","site_admin":false},"created_at":"2015-08-28T15:24:19Z","updated_at":"2015-08-28T15:24:19Z","body":"I strongly disagree -- this is an unnecessary complication and makes the test files unreadable, sprinkled with magical markers. I would rather allow reading code off a string buffer and not mandate making a separate test file for each test."}}