Skip to content

Commit 02148a4

Browse files
authored
manual: add Git License Metrics chapter to premium manual (#9114)
1 parent c10a3ee commit 02148a4

6 files changed

Lines changed: 68 additions & 0 deletions

File tree

‎.github/workflows/buildman.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
./buildman.sh
3838
chown -R '"$(id -u):$(id -g)"' .'
3939
cp man/*.pdf man/*.html man/manual.css output/
40+
cp -r man/images output/
4041
4142
- uses: actions/upload-artifact@v7
4243
with:
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
@@ -1701,3 +1701,57 @@ If you have `cppcheck-premium-loc` files in your project folders, those should b
17011701
If such files are generated during analysis, then review your scripts to check why those files are generated.
17021702

17031703
:::
1704+
1705+
::: {.content-visible when-profile="premium"}
1706+
1707+
# Git License Metrics
1708+
1709+
## Installing the tool
1710+
1711+
The tool is installed together with Cppcheck Premium. The installation folder contains a file
1712+
`git-license-metrics` that you can execute.
1713+
1714+
## Clone your repositories
1715+
1716+
If you don't have your source code locally, you need to clone your repositories.
1717+
1718+
Full clone:
1719+
1720+
git clone URL
1721+
1722+
If a "full clone" is too large you can clone like this. The file data is not cloned then, which
1723+
means that the "lines of code" can't be calculated:
1724+
1725+
git clone --no-checkout --filter=blob:none URL
1726+
1727+
## Usage on Windows
1728+
1729+
Start the tool:
1730+
1731+
![Git License Metrics start window](images/git-license-metrics-start.png)
1732+
1733+
Click on "Select repository" and select the folder that contains your project code. The folder
1734+
you choose should contain the `.git` folder.
1735+
1736+
![Selecting the repository folder](images/git-license-metrics-select.png)
1737+
1738+
When you click on the "Select Folder" button the report will be shown. Here is an example
1739+
report for the simplecpp repo (open source preprocessor project):
1740+
1741+
![Git License Metrics report](images/git-license-metrics-report.png)
1742+
1743+
## Usage on Linux
1744+
1745+
On Linux, `git-license-metrics` is a command line tool. Point it to the root of the repository,
1746+
copy the `[summary]` portion of the output, and send it to cppcheck sales:
1747+
1748+
$ ./git-license-metrics ../cppcheck
1749+
Path: ../cppcheck
1750+
[summary]
1751+
unique authors (last year): 65
1752+
ids:
1753+
* 9761353d7534333
1754+
* 766f7b48652cc16
1755+
>ae601cbc6b23b02
1756+
1757+
:::

0 commit comments

Comments
 (0)