Skip to content

Commit aee1e3a

Browse files
danmarclaude
andcommitted
manual: add Git License Metrics chapter to premium manual
Add a premium-only chapter describing the git-license-metrics tool, with screenshots of the Windows GUI. In the PDF, keep figures where they are placed in the text, and widen the number columns in the table of contents so that numbers such as "20" and "A.100" do not run into the titles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 6a4fedd commit aee1e3a

5 files changed

Lines changed: 67 additions & 0 deletions

File tree

12.7 KB
Loading
36.4 KB
Loading
7.05 KB
Loading

‎man/manual-style.tex‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22
\usepackage{fancyvrb,newverbs,xcolor}
33
\usepackage{xcolor}
44

5+
% Keep figures where they are placed in the text
6+
\usepackage{float}
7+
\floatplacement{figure}{H}
8+
9+
% Wider number columns in the table of contents so that numbers such as
10+
% "20" and "A.318" do not run into the titles
11+
\usepackage{etoolbox}
12+
\makeatletter
13+
\patchcmd{\l@chapter}{\setlength\@tempdima{1.5em}}{\setlength\@tempdima{2.2em}}{}{}
14+
\renewcommand*\l@section{\@dottedtocline{1}{2.2em}{3.9em}}
15+
\renewcommand*\l@subsection{\@dottedtocline{2}{6.1em}{4.1em}}
16+
\makeatother
17+
518
\titleformat{\chapter}[display]
619
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
720
\titlespacing*{\chapter}{0pt}{-20pt}{20pt}

‎man/manual.md‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,3 +1616,57 @@ If you have `cppcheck-premium-loc` files in your project folders, those should b
16161616
If such files are generated during analysis, then review your scripts to check why those files are generated.
16171617

16181618
:::
1619+
1620+
::: {.content-visible when-profile="premium"}
1621+
1622+
# Git License Metrics
1623+
1624+
## Installing the tool
1625+
1626+
The tool is installed together with Cppcheck Premium. The installation folder contains a file
1627+
`git-license-metrics` that you can execute.
1628+
1629+
## Clone your repositories
1630+
1631+
If you don't have your source code locally, you need to clone your repositories.
1632+
1633+
Full clone:
1634+
1635+
git clone URL
1636+
1637+
If a "full clone" is too large you can clone like this. The file data is not cloned then, which
1638+
means that the "lines of code" can't be calculated:
1639+
1640+
git clone --bare --filter=blob:none URL
1641+
1642+
## Usage on Windows
1643+
1644+
Start the tool:
1645+
1646+
![Git License Metrics start window](images/git-license-metrics-start.png)
1647+
1648+
Click on "Select repository" and select the folder that contains your project code. The folder
1649+
you choose should contain the `.git` folder.
1650+
1651+
![Selecting the repository folder](images/git-license-metrics-select.png)
1652+
1653+
When you click on the "Select Folder" button the report will be shown. Here is an example
1654+
report for the simplecpp repo (open source preprocessor project):
1655+
1656+
![Git License Metrics report](images/git-license-metrics-report.png)
1657+
1658+
## Usage on Linux
1659+
1660+
On Linux, `git-license-metrics` is a command line tool. Point it to the root of the repository,
1661+
copy the `[summary]` portion of the output, and send it to cppcheck sales:
1662+
1663+
$ ./git-license-metrics ../cppcheck
1664+
Path: ../cppcheck
1665+
[summary]
1666+
unique authors (last year): 65
1667+
ids:
1668+
* 9761353d7534333
1669+
* 766f7b48652cc16
1670+
>ae601cbc6b23b02
1671+
1672+
:::

0 commit comments

Comments
 (0)