Docent: Mantainability focused static analysis toolkit


Docent is static analysis toolkit (CLI mainly and library).

Initially, this was entirely focused and inspired by Rust’s missing docs lint, I thought that maybe I could extend it, so I found out about Go conventions, and so I added them.

More things happened I decided to add complexity checks (cyclomatic and cognitive), style checks (naming case consistency), size (currently function parameter count, but LoC will be eventually added), a custom formatter (directly similar in spirit by Gofumpt), and lastly a typesetting extra, which generates documentation in PDF thanks to Typst.

So, do I suggest you using it? At least the checks, for sure. Do they work reliably? More than 75% but not 100% I can assure at the moment correctly, I have yet to do correctness tests fully.

What about the formatter and typesetter? Both are experimental, typesetter still needs a better serialization process and much better default template design. As for the formatter, main ideas are covered but I need to test it out, of course with my own projects.

Either way, I invite you to test it, but keep in mind the state of what you try with what was previously said.

In short, this offers:

  • Documentation comment linter,
  • complexity checks,
  • style conventions,
  • size metrics,
  • code formatter,
  • and a Typst (PDF) documentation generator (technically you could also generate it to HTML, but that’s experimental on Typst side).

You are free to submit issues or contribute, or even ask anything, thank you.

Supported Zig versions

Latest stable.