1 ! Copyright (C) 2019 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: assocs command-line help.lint io kernel namespaces
4 prettyprint sequences system vocabs ;
7 ! FIXME: help-lint sometimes lists monitors and event-streams as leaked.
8 ! event-stream is macosx-only so hack it into a string
9 CONSTANT: ignored-resources {
10 "linux-monitor" "macosx-monitor" "malloc-ptr"
11 "epoll-mx" "server-port" "openssl-context"
12 "cache-assoc" "input-port" "fd" "output-port" "stdin"
16 : filter-flaky-resources ( seq -- seq' )
17 [ drop unparse ignored-resources member? ] assoc-reject ;
19 ! Allow testing without calling exit
20 : zealot-help-lint ( exit? -- )
21 command-line get require-all
23 lint-failures get filter-flaky-resources
24 [ nip assoc-empty? [ "==== FAILING LINT" print :lint-failures flush ] unless ]
25 [ swap [ 0 1 ? (exit) ] [ drop ] if ] 2bi ;
27 : zealot-help-lint-main ( -- )
30 MAIN: zealot-help-lint-main