1 ! Copyright (C) 2022 CapitalEx
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: assocs hashtables help.markup help.syntax io kernel
9 { "name" "a vocab name string" }
13 "Finds unusued imports in the given vocab name. Returing the result as a " { $link sequence } "."
16 { $example "USING: lint.vocabs prettyprint ;"
17 "\"lint.vocabs\" find-unused ."
22 HELP: find-unused-in-file
24 { "path" "a pathname string" }
28 "Finds unused imports in the given file. Returing the result as a " { $link sequence } "."
31 { $example "USING: lint.vocabs prettyprint ;"
32 "\"resource:work/lint/vocabs/vocabs.factor\" find-unused-in-file ."
37 HELP: find-unused-in-string
43 "Finds unused imports in the given " { $link string } ". Returing the result as a " { $link sequence } "."
48 { "name" "a vocab name string" }
51 "Finds unused imports in given vocab and outputs it to the current " { $link output-stream } "."
54 { $example "USING: lint.vocabs ;"
55 "\"lint.vocabs\" find-unused."
56 "No unused vocabs found in lint.vocabs."
60 HELP: get-imported-words
63 { "hashtable" hashtable }
66 "Gets all words that have been imported with " { $link \ USE: } " and " { $link \ USING: } " in the given string."
75 "Gets all the vocabularies imported in the given string."
80 { "name" "a vocab name string" }
84 "Gets all the words used in a given vocabulary."
87 { $example "USING: lint.vocabs prettyprint ;"
88 "\"lint.vocabs\" get-words ."
94 \"find-unused-in-file\"
95 \"get-imported-words\"
96 \"find-unused-in-string\"
104 ARTICLE: "lint.vocabs" "The Unused Vocabulary Linter"
105 "The " { $vocab-link "lint.vocabs" } " vocabulary implements a set of words designed to find unused imports."
106 "It attempts to ignore USE: and USING: that are a part of a string, postponed with either POSTPONE: or \\, and"
107 "contained inside a " { $link "regexp" } "."
109 "It can sometimes be easy to lose track of what vocabularies you've imported while iterating over ideas. So to"
110 "find any vocabularies you feel are unused, you can run:"
113 "USING: lint.vocabs ;"
114 "\"lint.vocabs\" find-unused."
115 "No unused vocabs found in lint.vocabs."