Initialize git flag to false
Fix indentation in multi_comment()
Fix line and column numbers of identifiers
This program scans C source code and emits an annotation graph for git.sr.ht's code annotations feature.
This supports C11 syntax and a handful of GNU C extensions. If your software
uses -std=gnu*
, it will likely not be parsed successfully. You will
undoubtably run into some GNU extensions anyway, please report them
here
annotatec [-gdD] [-C <cpp...>] files... >annotations.json
This will print annotations to stdout and progress to stderr. For information about uploading these annotations to git.sr.ht, see the git.sr.ht docs.
The -C
flag allows you to specify a custom C preprocessor command to
use, where you will need to supply it with a list of include directories,
macros, and so on, which matches those used in your source tree, as well as the
C standard to target. For example:
annotatec -C "cpp -std=c11 -Iinclude $(pkg-config --cflags libgit2)"
You also will almost certainly want to specify the -g
flag, which will
translate file paths into git blob IDs.
To generate annotations for all C files in your git repo suitable for sending to git.sr.ht:
find . -name "*.c" | xargs \
annotatec -gC "cpp -std=c11 -Iinclude $(pkg-config --cflags libgit2)" \
> annotations.json
Submit bugs to ~sircmpwn/annotate.
Send support requests to sr.ht-discuss.
Send patches via email to
sr.ht-dev with git config format.subjectPrefix 'PATCH annotatec'
.