Skip to main content

Module cpp_style

Module cpp_style 

Source
Expand description

Lexical style-guide adherence analysis for C and C++ source files.

The analyser scans each file character-by-character and tallies observable style signals: indentation type/width, brace placement, pointer-declarator alignment, control-flow spacing, and line-length compliance. These raw counts are then scored against five well-known style guides (LLVM, Google, Mozilla, Microsoft, WebKit) to produce per-file adherence percentages.

All analysis is purely lexical — no AST is built — so results are approximate. The intent is to give a quick directional signal, not an exact conformance report.

Structs§

CppStyleAnalysis
Full lexical style analysis result for a single C/C++ file.
StyleGuideScore
Adherence percentage for one named style guide.

Enums§

BraceStyle
Detected opening-brace placement style.
IndentStyle
Detected leading-whitespace style.
PointerStyle
Detected pointer / reference declarator alignment.

Functions§

analyze_cpp_style
Analyse text for C/C++ coding-style signals and return a scored result.