{"action":"created","issue":{"url":"https://api.github.com/repos/masak/007/issues/14","labels_url":"https://api.github.com/repos/masak/007/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/masak/007/issues/14/comments","events_url":"https://api.github.com/repos/masak/007/issues/14/events","html_url":"https://github.com/masak/007/issues/14","id":57689839,"number":14,"title":"Provide a command-line tool for linting and refactoring 007 code","user":{"login":"masak","id":20627,"avatar_url":"https://avatars.githubusercontent.com/u/20627?v=3","gravatar_id":"","url":"https://api.github.com/users/masak","html_url":"https://github.com/masak","followers_url":"https://api.github.com/users/masak/followers","following_url":"https://api.github.com/users/masak/following{/other_user}","gists_url":"https://api.github.com/users/masak/gists{/gist_id}","starred_url":"https://api.github.com/users/masak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masak/subscriptions","organizations_url":"https://api.github.com/users/masak/orgs","repos_url":"https://api.github.com/users/masak/repos","events_url":"https://api.github.com/users/masak/events{/privacy}","received_events_url":"https://api.github.com/users/masak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-14T11:08:15Z","updated_at":"2015-10-19T13:20:53Z","closed_at":null,"body":"Call the command `spy`, to continue the 007 theme.\r\n\r\nIt would have two major parts: a linter, and a refactoring tool.\r\n\r\n## linter\r\n\r\nCalled with `spy --lint script.007`, the tool could detect various things that are smells rather than errors in a 007 program:\r\n\r\n* Variable, sub, or macro not used\r\n* Variable read from before being assigned to\r\n* Dead code (after `return` or `die`)\r\n* Conditionals that will always run or never run\r\n* `while` loops that will never run\r\n\r\n## refactoring tool\r\n\r\n* Extract/inline/rename variable/constant\r\n* Extract/inline/rename sub\r\n* Extract/inline/rename macro\r\n* Add/remove/reorder parameters\r\n* Introduce parameter (turn expression in sub into a parameter)\r\n\r\nBeing refactors, the actions that affect parameters should also make sure to do the \"corresponding\" things to arguments at all statically detectable call sites.\r\n\r\n## what's needed to get there\r\n\r\nThe compiler already generates a Qtree for consumption by the runtime. The thing that needs to be built on top of that is a layer of primitives for locating stuff in the Qtree, and to manipulate it. Also a greater awareness of the connection between Qtree and original source text is needed."},"comment":{"url":"https://api.github.com/repos/masak/007/issues/comments/149211379","html_url":"https://github.com/masak/007/issues/14#issuecomment-149211379","issue_url":"https://api.github.com/repos/masak/007/issues/14","id":149211379,"user":{"login":"masak","id":20627,"avatar_url":"https://avatars.githubusercontent.com/u/20627?v=3","gravatar_id":"","url":"https://api.github.com/users/masak","html_url":"https://github.com/masak","followers_url":"https://api.github.com/users/masak/followers","following_url":"https://api.github.com/users/masak/following{/other_user}","gists_url":"https://api.github.com/users/masak/gists{/gist_id}","starred_url":"https://api.github.com/users/masak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masak/subscriptions","organizations_url":"https://api.github.com/users/masak/orgs","repos_url":"https://api.github.com/users/masak/repos","events_url":"https://api.github.com/users/masak/events{/privacy}","received_events_url":"https://api.github.com/users/masak/received_events","type":"User","site_admin":false},"created_at":"2015-10-19T13:20:53Z","updated_at":"2015-10-19T13:20:53Z","body":"oh, and a\r\n\r\n## code tidy-fier\r\n\r\nLike [Perl::Tidy](https://metacpan.org/pod/distribution/Perl-Tidy/lib/Perl/Tidy.pod) or [gofmt](https://golang.org/cmd/gofmt/).\r\n\r\n    spy --tidy script.007"}}