Skip to content

Commit 5e06153

Browse files
authored
Merge pull request #13 from jcarpent/main
Add cloc
2 parents 5138af7 + 3aafc70 commit 5e06153

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,3 +411,50 @@ More information on the current configuration can be obtained via:
411411
ulimit -a
412412
```
413413
414+
## Counting number of lines of codes
415+
416+
It might be useful at some point to count the number of lines of code in a given project.
417+
[Cloc](https://github.com/AlDanial/cloc) is an open-source tool that counts blank lines, comment lines, and physical lines of source code in many programming languages.
418+
419+
In [Pinocchio](https://github.com/stack-of-tasks/pinocchio), counting the important lines of code can be done using:
420+
421+
```bash
422+
cloc unittest src include examples bindings
423+
```
424+
425+
which gives:
426+
```
427+
3149 text files.
428+
2299 unique files.
429+
970 files ignored.
430+
431+
github.com/AlDanial/cloc v 2.04 T=0.90 s (2543.7 files/s, 395546.2 lines/s)
432+
--------------------------------------------------------------------------------
433+
Language files blank comment code
434+
--------------------------------------------------------------------------------
435+
C/C++ Header 672 20927 20408 107549
436+
C++ 423 15686 4418 61598
437+
XML 154 101 120 53449
438+
CMake 325 2595 4955 18197
439+
Python 214 4459 2277 15361
440+
make 13 2073 1463 4100
441+
INI 100 657 0 4047
442+
Markdown 71 976 40 2509
443+
Text 89 231 0 1444
444+
CSS 4 138 57 549
445+
YAML 10 48 10 519
446+
Bourne Shell 4 83 167 444
447+
SVG 1 1 1 382
448+
Jupyter Notebook 1 0 655 214
449+
JavaScript 196 196 3332 196
450+
TeX 5 0 0 167
451+
reStructuredText 8 102 83 147
452+
HTML 4 1 25 92
453+
Objective-C 1 11 16 92
454+
JSON 1 0 0 46
455+
Bourne Again Shell 2 14 12 45
456+
awk 1 0 0 10
457+
--------------------------------------------------------------------------------
458+
SUM: 2299 48299 38039 271157
459+
--------------------------------------------------------------------------------
460+
```

0 commit comments

Comments
 (0)