<commit_before>.\" #
.\" # Copyright (c) 2014, Juniper Networks, Inc.
.\" # All rights reserved.
.\" # This SOFTWARE is licensed under the LICENSE provided in the
.\" # ../Copyright file. By downloading, installing, copying, or 
.\" # using the SOFTWARE, you agree to be bound by the terms of that
.\" # LICENSE.
.\" # <NAME>, July 2014
.\" 
.Dd July, 2014
.Dt LIBXO 3
.Os
.Sh NAME
.Nm xolint
.Nd detect errors in programs using xo_emit
.Sh SYNOPSIS
.Nm xolint
.Op Fl c
.Op Fl "C <flags>"
.Op Fl "d"
.Op Fl "D"
.Op Fl "I"
.Op Fl "p"
.Op Fl "V"
.Op Fl "X"
.Op Ar files...
.Sh DESCRIPTION
xolint is a tool for reporting common mistakes in format strings
in source code that invokes xo_emit().  It allows these errors
to be diagnosed at build time, rather than waiting until runtime.
.Pp
xolint takes the one or more C files as arguments, and reports
and errors, warning, or informational messages as needed.
.Bl -tag -width "C <flags>"
.It Fl c
Invoke 'cpp' against the input file
.It Fl "C <flags>"
Flags that are passed to 'cpp
.It Fl "d"
Enable debug output
.It Fl "D"
Generate documentation for all xolint messages
.It Fl "I"
Generate a table of xo_info_t structures.
.It Fl "p"
Print the offending lines after the error message is displayed
.It Fl "V"
Do not report errors, but instead print a complete list of
all field names, sorted alphabetically.  The output can help spot
inconsistencies and spelling errors.
.It Fl "X"
Extract samples from xolint, suitable for internal testing.
.El
.Pp
Output message contain the source filename and line number, the
class of the message, the message, and, if
.Fl p
is given, the
line that contains the error:
.Bd -literal -offset indent
    % xolint -t xolint.c
    xolint.c: 16: error: anchor format should be "%d"
    16         xo_emit("{[:/%s}");
.Ed
.Pp
.Sh ADDITIONAL DOCUMENTATION
.Pp
Complete documentation can be found on github:
.Bd -literal -offset indent
http://juniper.github.io/libxo/libxo-manual.html
.Ed
.Pp
libxo lives on github as:
.Bd -literal -offset indent
https://github.com/Juniper/libxo
.Ed
.Pp
The latest release of libxo is available at:
.Bd -literal -offset indent
https://github.com/Juniper/libxo/releases
.Ed
.Sh SEE ALSO
.Xr xo_emit 3
.Sh HISTORY
The
.Fa libxo
library was added in FreeBSD 10.1.
.Sh AUTHOR
<NAME><commit_msg>General cleanup of xolint.1.<commit_after>.\" #
.\" # Copyright (c) 2014, Juniper Networks, Inc.
.\" # All rights reserved.
.\" # This SOFTWARE is licensed under the LICENSE provided in the
.\" # ../Copyright file. By downloading, installing, copying, or 
.\" # using the SOFTWARE, you agree to be bound by the terms of that
.\" # LICENSE.
.\" # <NAME>, July 2014
.\" 
.Dd December 4, 2014
.Dt XOLINT 1
.Os
.Sh NAME
.Nm xolint
.Nd detect errors in programs using
.Xr xo_emit 3
.Sh SYNOPSIS
.Nm xolint
.Op Fl c
.Op Fl "C <flags>"
.Op Fl "d"
.Op Fl "D"
.Op Fl "I"
.Op Fl "p"
.Op Fl "V"
.Op Fl "X"
.Op Ar files...
.Sh DESCRIPTION
.Nm
is a tool for reporting common mistakes in format strings
in source code that invokes
.Xr xo_emit 3 .
It allows these errors
to be diagnosed at build time, rather than waiting until runtime.
.Pp
.Nm
takes one or more C files as arguments, and reports
error, warning, or informational messages as needed.
.Bl -tag -width "C <flags>"
.It Fl c
Invoke 'cpp' against the input file
.It Fl "C <flags>"
Flags that are passed to 'cpp'
.It Fl "d"
Enable debug output
.It Fl "D"
Generate documentation for all
.Nm
messages
.It Fl "I"
Generate a table of
.Dv xo_info_t
structures.
.It Fl "p"
Print the offending lines after the error message is displayed
.It Fl "V"
Do not report errors, but instead print a complete list of
all field names, sorted alphabetically.
The output can help spot
inconsistencies and spelling errors.
.It Fl "X"
Extract samples from
.Nm ,
suitable for internal testing.
.El
.Pp
The output message contains the source filename and line number, the
class of the message, the message, and, if
.Fl p
is given, the
line that contains the error:
.Bd -literal -offset indent
    % xolint -t xolint.c
    xolint.c: 16: error: anchor format should be "%d"
    16         xo_emit("{[:/%s}");
.Ed
.Sh ADDITIONAL DOCUMENTATION
Complete documentation can be found on github:
.Bd -literal -offset indent
http://juniper.github.io/libxo/libxo-manual.html
.Ed
.Pp
.Nm libxo
lives on github as:
.Bd -literal -offset indent
https://github.com/Juniper/libxo
.Ed
.Pp
The latest release of
.Nm libxo
is available at:
.Bd -literal -offset indent
https://github.com/Juniper/libxo/releases
.Ed
.Sh SEE ALSO
.Xr libxo 3 ,
.Xr xo_emit 3
.Sh HISTORY
The
.Nm libxo
library was added in
.Fx 10.1 .
.Sh AUTHOR
<NAME>
{'fraction_non_alphanumeric': 0.10172786177105832, 'fraction_numerical': 0.010151187904967603, 'mean_word_length': 3.3402061855670104, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7172081', 'n_tokens_mistral': 1671, 'n_tokens_neox': 1570, 'n_words': 734}