Update the documentation to cover the new options and features:
- Add --kloc and --html options to dirs command options list
- Add new "HTML Reports" section explaining --html usage
- Note that files are sorted alphabetically and hidden when zero active
- Update all example outputs to reflect current behavior
Cover-letter:
codman: Assorted improvements and HTML output
This series adds various improvements to codman including:
- Hide files with zero active lines by default
- Sort files alphabetically and simplify output columns
- Better formatting with kLOC display and whole number percentages
- HTML report generation with collapsible hierarchical drill-down
END
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Provide a description of the purpose of codman and some examples of how
to use it.
Series-to: concept
Cover-letter:
codman: Add a new source-code analysis tool
Add a new tool called 'codman' (code manager) for analysing source code
usage in U-Boot builds. This tool determines which files and lines of
code are actually compiled based on the build configuration.
The tool provides three analysis methods:
- unifdef: Static preprocessor analysis (default)
- DWARF: Debug information from compiled code (-w)
- (experimental) LSP: Language server analysis using clangd (-l)
Codman supports:
- File-level analysis: which files are compiled vs unused
- Line-level analysis: which lines are active vs removed by preprocessor
- Kconfig-impact analysis with -a/--adjust option
- Various output formats: stats, directories, detail, summary
Since there is quite a lot of processing involved, Codman uses parallel
processing where possible.
This tool is admittedly not quite up to my normal code quality, but it
has been an interesting experiment in using Claude to create something
from scratch.
The unifdef part of the tool benefits from some patches I created for
that tool:
- O(1) algorithm for symbol lookup, instead of O(n) - faster!
- support for IS_ENABLED(), CONFIG_IS_ENABLED()
Please get in touch if you would like the patches.
This series also includes a minor improvement to buildman and a tidy-up
of the tout library to reduce code duplication.
END
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Series-links: 1:65