]> gitweb.factorcode.org Git - factor.git/blob - extra/lint/vocabs/vocabs-docs.factor
Use canonical way to get HEAD SHA1
[factor.git] / extra / lint / vocabs / vocabs-docs.factor
1 ! Copyright (C) 2022 CapitalEx
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: assocs hashtables help.markup help.syntax io kernel
4 sequences strings ;
5 IN: lint.vocabs
6
7 HELP: find-unused
8 { $values
9     { "name" "a vocab name string" }
10     { "seq" sequence }
11 }
12 { $description 
13     "Finds unusued imports in the given vocab name. Returing the result as a " { $link sequence } "." 
14
15 { $examples
16     { $example "USING: lint.vocabs prettyprint ;"
17         "\"lint.vocabs\" find-unused ."
18         "{ }"
19     }
20 } ;
21
22 HELP: find-unused-in-file
23 { $values
24     { "path" "a pathname string" }
25     { "seq" sequence }
26 }
27 { $description 
28     "Finds unused imports in the given file. Returing the result as a " { $link sequence } "." 
29
30 { $examples
31     { $example "USING: lint.vocabs prettyprint ;"
32         "\"vocab:lint/vocabs/vocabs.factor\" find-unused-in-file ."
33         "{ }"
34     }
35 } ;
36
37 HELP: find-unused-in-string
38 { $values
39     { "string" string }
40     { "seq" sequence }
41 }
42 { $description 
43     "Finds unused imports in the given " { $link string } ". Returing the result as a " { $link sequence } "."
44 } ;
45
46 HELP: find-unused.
47 { $values
48     { "name" "a vocab name string" }
49 }
50 { $description 
51     "Finds unused imports in given vocab and outputs it to the current " { $link output-stream } "." 
52 }
53 { $examples
54     { $example "USING: lint.vocabs ;"
55         "\"lint.vocabs\" find-unused."
56         "No unused vocabs found in lint.vocabs."
57     }
58 } ;
59
60
61 ARTICLE: "lint.vocabs" "The Unused Vocabulary Linter"
62 "The " { $vocab-link "lint.vocabs" } " vocabulary implements a set of words designed to find unused imports. "
63 "It attempts to ignore USE: and USING: that are a part of a string, postponed with either POSTPONE: or \\, and "
64 "contained inside a " { $link "regexp" } "."
65 $nl
66 "It can sometimes be easy to lose track of what vocabularies you've imported while iterating over ideas. So to "
67 "find any vocabularies you feel are unused, you can run:"
68 $nl
69 { $example 
70     "USING: lint.vocabs ;"
71     "\"lint.vocabs\" find-unused."
72     "No unused vocabs found in lint.vocabs."
73 }
74 ;
75
76 ABOUT: "lint.vocabs"