summaryrefslogtreecommitdiffstats
path: root/development/kodespel/kodespel.1
blob: 6f58b9cde32d8f212a598f409645c3ba0c15a2bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "KODESPEL" 1 "2023-01-16" "0.1.1+20220227_e0095c7" "SlackBuilds.org"
.SH NAME
kodespel \- spell-checker for source code
.\" RST source for kodespel(1) man page. Convert with:
.
.\" rst2man.py kodespel.rst > kodespel.1
.
.SH SYNOPSIS
.sp
kodespel [\fB\-d\fP \fIdictionary\fP] \fIfile\fP [\fIfile\fP ...]
.sp
kodespel \fB\-\-list\-dicts\fP
.SH DESCRIPTION
.sp
kodespel is a spellchecker for source code. kodespel\(aqs nifty trick
is that it knows how to split common programming identifiers like
\(aqgetAllStuff\(aq or \(aqDoThingsNow\(aq or \(aqnum_objects\(aq or \(aqHTTPResponse\(aq into
words, feed those to \fBispell\fP(1), and interpret ispell\(aqs output.
.sp
Basic usage is to run kodespel on one or more individual files
or directories:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
kodespel foo.py main.go README.md
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
kodespel uses a collection of dictionaries to spellcheck each file.
It always uses the \fBbase\fP dictionary, which is a set of words
common in source code across languages and platforms. Additionally,
there is a language\-specific dictionary for each language kodespel
knows about. Language\-specific dictionaries are automatically chosen
for you.
.sp
In this example, kodespell will spellcheck each file with:
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fBfoo.py\fP: dictionaries \fBbase\fP and \fBpython\fP
.IP \(bu 2
\fBmain.go\fP: dictionaries \fBbase\fP and \fBgo\fP
.IP \(bu 2
\fBREADME.md\fP: dictionary \fBbase\fP only (no language dictionary for Markdown)
.UNINDENT
.UNINDENT
.UNINDENT
.sp
If run on a directory, kodespel will recurse into that directory
and spellcheck every file that it recognizes:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
kodespel src/
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
will search for \fB*.py\fP, \fB*.c\fP, \fB*.h\fP, and any other
extension that kodespel has built\-in support for.
(Currently: Python, Perl, Go, C, C++, and Java).
Unsupported files are ignored, but if you pass those filenames
explicitly, they will be checked.
.INDENT 0.0
.INDENT 3.5
Note: the SlackBuilds.org package of \fBkodespel\fP includes a
\fBsbo\fP dictionary. It will only be used if you enable it
with \fB\-d sbo\fP\&.
.UNINDENT
.UNINDENT
.sp
kodespel ships with several other common dictionaries.
For example, if the program you are spellchecking uses
a lot of Unix system calls, you would add the \fBunix\fP dictionary:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
kodespel \-d unix foo.py main.go README.md
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The \fB\-d\fP option applies to every file being checked.
.sp
To see the list of all builtin dictionaries, run:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
kodespel \-\-list\-dicts
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Finally, you can create your own dictionaries,
and use as many of them as you like.
A dictionary is a plain text file with one word per line:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ cat myproject.dict
nargs
args
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
You can specify your personal dictionaries with \fB\-d\fP,
just like kodespel\(aqs builtin dictionaries:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
kodespel \-d unix \-d myproject.dict foo.py ...
.ft P
.fi
.UNINDENT
.UNINDENT
.SH OPTIONS
.INDENT 0.0
.TP
.B  \-h\fP,\fB  \-\-help
Show built\-in help and exit.
.TP
.B  \-a\fP,\fB  \-\-all
Report every single misspelling [default: \fB\-\-unique\fP].
.TP
.B  \-u\fP,\fB  \-\-unique
Report each misspelling only once [default].
.TP
.BI \-d \ dict\fR,\fB \ \-\-dictionary\fB= dict
Use this dictionary. \fIdict\fP may be a filename or a dictionary name. Use
multiple times to include multiple dictionaries.
.TP
.B  \-\-list\-dicts
List available dictionaries and exit.
.TP
.B  \-\-dump\-dict
Build custom dictionary (respecting \fB\-d\fP options).
.TP
.BI \-\-make\-dict\fB= dictfile
Write unknown words to \fIdictfile\fP\&.
.TP
.BI \-i \ string\fR,\fB \ \-\-ignore\fB= regex
Ignore any words matching \fIregex\fP\&.
.TP
.B  \-C\fP,\fB  \-\-compound
Allow compound words (e.g. \fBgetall\fP) [default].
.TP
.B  \-\-no\-compound
Do not allow compound words
.TP
.BI \-W \ N\fR,\fB \ \-\-wordlen\fB= N
Ignore words with <= \fIN\fP characters [default: 3].
.UNINDENT
.SH EXIT STATUS
.INDENT 0.0
.IP \(bu 2
\fB0\fP \- success; no misspellings found.
.IP \(bu 2
\fB1\fP \- at least one misspelling found \fIor\fP there was an error reading
one or more input file (including encoding errors for non\-UTF8 files).
.IP \(bu 2
\fB2\fP \- invalid command line option(s).
.UNINDENT
.SH FILES
.INDENT 0.0
.TP
.B \fB/usr/share/kodespel/\fP
The default dictionaries are stored here.
.UNINDENT
.SH LIMITATIONS
.sp
\fBkodespel\fP has no option to read from standard input. However, on Linux,
you can run \fBkodespel\fP \fB/dev/stdin\fP\&.
.sp
\fBkodespel\fP can only handle \fBUTF\-8\fP encoding (which includes 7\-bit \fBASCII\fP).
It will choke on files that use e.g. \fBISO\-8859\fP encoding.
.sp
\fBkodespel\fP writes its output to \fBstderr\fP, not \fBstdout\fP\&. This makes
it difficult to use it from a script. Try e.g:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
kodespel <args> 2>&1 | <command>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Also, if you get exit status 1, you can\(aqt tell if that\(aqs an actual error
or misspellings were found, without examining the actual output.
.SH COPYRIGHT
.sp
See the file /usr/doc/kodespel\-0.1.1+20220227_e0095c7/LICENSE.txt for license information.
.SH AUTHORS
.sp
kodespel was written by Greg Ward.
.sp
This man page written (mostly copied and adapted from README.md and
the \-\-help output) for the SlackBuilds.org project by B. Watson, and
is licensed under the WTFPL.
.SH SEE ALSO
.sp
The kodespel homepage: \fI\%https://pypi.org/project/kodespel/\fP
.sp
\fBcodespell\fP(1)
.\" Generated by docutils manpage writer.
.