diff --git a/man/images/git-license-metrics-report.png b/man/images/git-license-metrics-report.png new file mode 100644 index 00000000000..236f7958504 Binary files /dev/null and b/man/images/git-license-metrics-report.png differ diff --git a/man/images/git-license-metrics-select.png b/man/images/git-license-metrics-select.png new file mode 100644 index 00000000000..01a310a3053 Binary files /dev/null and b/man/images/git-license-metrics-select.png differ diff --git a/man/images/git-license-metrics-start.png b/man/images/git-license-metrics-start.png new file mode 100644 index 00000000000..57840e594df Binary files /dev/null and b/man/images/git-license-metrics-start.png differ diff --git a/man/manual-style.tex b/man/manual-style.tex index 72187c11be8..6d499992287 100644 --- a/man/manual-style.tex +++ b/man/manual-style.tex @@ -2,6 +2,19 @@ \usepackage{fancyvrb,newverbs,xcolor} \usepackage{xcolor} +% Keep figures where they are placed in the text +\usepackage{float} +\floatplacement{figure}{H} + +% Wider number columns in the table of contents so that numbers such as +% "20" and "A.318" do not run into the titles +\usepackage{etoolbox} +\makeatletter +\patchcmd{\l@chapter}{\setlength\@tempdima{1.5em}}{\setlength\@tempdima{2.2em}}{}{} +\renewcommand*\l@section{\@dottedtocline{1}{2.2em}{3.9em}} +\renewcommand*\l@subsection{\@dottedtocline{2}{6.1em}{4.1em}} +\makeatother + \titleformat{\chapter}[display] {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge} \titlespacing*{\chapter}{0pt}{-20pt}{20pt} diff --git a/man/manual.md b/man/manual.md index cf5d83487bb..ab3220d39f9 100644 --- a/man/manual.md +++ b/man/manual.md @@ -1616,3 +1616,57 @@ If you have `cppcheck-premium-loc` files in your project folders, those should b If such files are generated during analysis, then review your scripts to check why those files are generated. ::: + +::: {.content-visible when-profile="premium"} + +# Git License Metrics + +## Installing the tool + +The tool is installed together with Cppcheck Premium. The installation folder contains a file +`git-license-metrics` that you can execute. + +## Clone your repositories + +If you don't have your source code locally, you need to clone your repositories. + +Full clone: + + git clone URL + +If a "full clone" is too large you can clone like this. The file data is not cloned then, which +means that the "lines of code" can't be calculated: + + git clone --bare --filter=blob:none URL + +## Usage on Windows + +Start the tool: + +![Git License Metrics start window](images/git-license-metrics-start.png) + +Click on "Select repository" and select the folder that contains your project code. The folder +you choose should contain the `.git` folder. + +![Selecting the repository folder](images/git-license-metrics-select.png) + +When you click on the "Select Folder" button the report will be shown. Here is an example +report for the simplecpp repo (open source preprocessor project): + +![Git License Metrics report](images/git-license-metrics-report.png) + +## Usage on Linux + +On Linux, `git-license-metrics` is a command line tool. Point it to the root of the repository, +copy the `[summary]` portion of the output, and send it to cppcheck sales: + + $ ./git-license-metrics ../cppcheck + Path: ../cppcheck + [summary] + unique authors (last year): 65 + ids: + * 9761353d7534333 + * 766f7b48652cc16 + >ae601cbc6b23b02 + +:::