Usage¶
Lins is a command-line tool—meaning that most of the time, the user will interface with it through a terminal session. Linting a text file involves invoking Lins with the path to one or several target files as input arguments.
$ lins my_file.txt
The input file has to be encoded in UTF-8 (of which ASCII is a subset) and not contain anything other than the target text. Files from other word processing applications often contain, apart from the text itself, additional data specific to that tool. These types of files are not supported.
Pattern Matching¶
Selecting target files based on a pattern is supported. However, the extent of
this support is OS-dependent. The *.ext notation is always supported. POSIX
systems use the glob call which enables wildcarding directories. For example,
$ lins **/*.txt
descends one level into every directory in the current working directory and
grabs every file with the .txt extension.
Command Line Interface¶
usage:
lins [OPTIONS] ARGUMENTS
arguments:
file [file [file ...]] Input file(s) to lint. To lint several files,
separate them by whitespace. If no files are
specified, piped input from stdin is assumed.
Pattern matching is supported but the extent of this
support is OS-dependent. The "*.ext" notation is
always supported. The glob call is used on POSIX
systems.
options:
-h, --help Print this help message and exit.
-v, --version Print the version information and exit.
--col=COL Specify the column index of the first character
in the input data. Default value: 1. See also the
'line' option.
--line=LINE Specify the line of the first character in the input
data. Default value: 1. See also the 'col' option.
--linter=LINTER Set the linter selection mode. Valid values are:
- 'auto': Choose linter based on file extensions.
- 'plain': Choose the plain text linter.
- 'latex': Choose the LaTeX linter.
The default value is 'auto'.
--list List available styles and current rule set.
--minimal Enable minimal output mode. All output except the
violation information is suppressed.
--no-cfg Don't look for a configuration file.
--no-color Don't color the output. Suppresses the ANSI escape
sequences on UNIX.
--no-default Don't use a default style (if defined in the
configuration file).
--rule=RULE Specify a rule set by name. The rule set will have
to be defined in the configuration file.
--rule-dir=RULE_DIR Specify a root directory to traverse in search of
rule files.
--severity=SEVERITY Set the severity threshold. Only violations reaching
this level are printed. For example, 'warning' would
print both errors and warnings but not suggestions.
Valid values are 'error', 'warning' and
'suggestion'.
--severity-exit Enable exit status depending on the highest severity
level of any rule violation.
- ELINTERROR: 3
- ELINTWARNING: 2
- ELINGSUGGESTION: 1
- ESUCCESS: 0
Without this option, only values 0, 3 and negative
values are possible. Warnings and suggestions will
exit with status 0.
--style=STYLE Specify which style to use for linting. Styles
are defined in the configuration file.
debug options:
--parser-output=FILENAME Write the output from the parser to the specified
file.