"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "README.md" between
cloc-1.84.tar.gz and cloc-1.86.tar.gz

About: cloc ("Count Lines of Code") counts blank, comment and physical lines of source code in many programming languages.

README.md  (cloc-1.84):README.md  (cloc-1.86)
<a name="___top"></a> <a name="___top"></a>
# cloc # cloc
*Count Lines of Code* *Count Lines of Code*
* * * * * *
cloc counts blank lines, comment lines, and physical lines of source code in man y programming languages. cloc counts blank lines, comment lines, and physical lines of source code in man y programming languages.
Latest release: v1.84 (September 22, 2019) Latest release: v1.86 (May 18, 2020)
cloc moved to GitHub in September 2015 after being hosted cloc moved to GitHub in September 2015 after being hosted
at http://cloc.sourceforge.net/ since August 2006, at http://cloc.sourceforge.net/ since August 2006.
* [Quick Start](#quick-start-) * [Quick Start](#quick-start-)
* [Overview](#overview-) * [Overview](#overview-)
* [Download](https://github.com/AlDanial/cloc/releases/latest) * [Download](https://github.com/AlDanial/cloc/releases/latest)
* [Install via package manager](#install-via-package-manager) * [Install via package manager](#install-via-package-manager)
* [Stable release](#stable-release) * [Stable release](#stable-release)
* [Development version](#development-version) * [Development version](#development-version)
* [License](#license-) * [License](#license-)
* [Why Use cloc?](#why-use-cloc-) * [Why Use cloc?](#why-use-cloc-)
* [Other Counters](#other-counters-) * [Other Counters](#other-counters-)
skipping to change at line 36 skipping to change at line 36
* [How it Works](#how-it-works-) * [How it Works](#how-it-works-)
* [Advanced Use](#advanced-use-) * [Advanced Use](#advanced-use-)
* [Remove Comments from Source Code](#remove-comments-from-source-code-) * [Remove Comments from Source Code](#remove-comments-from-source-code-)
* [Work with Compressed Archives](#work-with-compressed-archives-) * [Work with Compressed Archives](#work-with-compressed-archives-)
* [Differences](#differences-) * [Differences](#differences-)
* [Create Custom Language Definitions](#create-custom-language-definitions -) * [Create Custom Language Definitions](#create-custom-language-definitions -)
* [Combine Reports](#combine-reports-) * [Combine Reports](#combine-reports-)
* [SQL](#sql-) * [SQL](#sql-)
* [Custom Column Output](#custom-column-output-) * [Custom Column Output](#custom-column-output-)
* [Wrapping cloc in other scripts](#wrapping-cloc-in-other-scripts-) * [Wrapping cloc in other scripts](#wrapping-cloc-in-other-scripts-)
* [Count specific git branch](#count-specific-git-branch-) * [git and UTF8 pathnames](#git-and-UTF8-pathnames-)
* [Third Generation Language Scale Factors](#third-generation-language-sca le-factors-) * [Third Generation Language Scale Factors](#third-generation-language-sca le-factors-)
* [Complex regular subexpression recursion limit ](#complex-regular-subexpress ion-recursion-limit-) * [Complex regular subexpression recursion limit ](#complex-regular-subexpress ion-recursion-limit-)
* [Limitations](#limitations-) * [Limitations](#limitations-)
* [How to Request Support for Additional Languages](#how-to-request-support-fo * [Requesting Support for Additional Languages](#requesting-support-for-additi
r-additional-languages-) onal-languages-)
* [Features Currently in Development](#features-currently-in-development-) * [Reporting Problems](#reporting-problems-)
* [Acknowledgments](#acknowledgments-) * [Acknowledgments](#acknowledgments-)
* [Copyright](#copyright-) * [Copyright](#copyright-)
<a name="Quick_Start"></a> []({{{1) <a name="Quick_Start"></a> []({{{1)
# [Quick Start &#9650;](#___top "click to go to top of document") # [Quick Start &#9650;](#___top "click to go to top of document")
Step 1: Download cloc (several methods, see below). Step 1: Download cloc (several methods, see below) or run cloc's
[docker image](#Docker-). The Windows executable has no requirements.
The source version of cloc requires a Perl interpreter, and the
Docker version of cloc requires a Docker installation.
Step 2: Open a terminal (`cmd.exe` on Windows). Step 2: Open a terminal (`cmd.exe` on Windows).
Step 3: Invoke cloc to count your source files, directories, archives, Step 3: Invoke cloc to count your source files, directories, archives,
or git commits. or git commits.
The executable name differs depending on whether you use the The executable name differs depending on whether you use the
development source version (`cloc`), source for a development source version (`cloc`), source for a
released version (`cloc-1.82.pl`) or a Windows executable released version (`cloc-1.86.pl`) or a Windows executable
(`cloc-1.82.exe`). On this page, `cloc` is the generic term (`cloc-1.86.exe`). On this page, `cloc` is the generic term
used to refer to any of these. used to refer to any of these.
**a file** **a file**
<pre> <pre>
prompt> cloc hello.c prompt> cloc hello.c
1 text file. 1 text file.
1 unique file. 1 unique file.
0 files ignored. 0 files ignored.
https://github.com/AlDanial/cloc v 1.65 T=0.04 s (28.3 files/s, 340.0 lines/s) https://github.com/AlDanial/cloc v 1.65 T=0.04 s (28.3 files/s, 340.0 lines/s)
skipping to change at line 244 skipping to change at line 247
[SLOCCount](http://www.dwheeler.com/sloccount/), [SLOCCount](http://www.dwheeler.com/sloccount/),
Damian Conway and Abigail's Perl module Damian Conway and Abigail's Perl module
[Regexp::Common](http://search.cpan.org/%7Eabigail/Regexp-Common-2.120/lib/Regex p/Common.pm), [Regexp::Common](http://search.cpan.org/%7Eabigail/Regexp-Common-2.120/lib/Regex p/Common.pm),
Sean M. Burke's Perl module Sean M. Burke's Perl module
[Win32::Autoglob](http://search.cpan.org/%7Esburke/Win32-Autoglob-1.01/Autoglob. pm), [Win32::Autoglob](http://search.cpan.org/%7Esburke/Win32-Autoglob-1.01/Autoglob. pm),
and Tye McQueen's Perl module and Tye McQueen's Perl module
[Algorithm::Diff](http://search.cpan.org/%7Etyemq/Algorithm-Diff-1.1902/lib/Algo rithm/Diff.pm). [Algorithm::Diff](http://search.cpan.org/%7Etyemq/Algorithm-Diff-1.1902/lib/Algo rithm/Diff.pm).
Language scale factors were derived from Mayes Consulting, LLC web site Language scale factors were derived from Mayes Consulting, LLC web site
http://softwareestimator.com/IndustryData2.htm. http://softwareestimator.com/IndustryData2.htm.
[](1}}}) [](1}}})
<a name="apt-get"></a> []({{{1)
<a name="Docker"></a> []({{{1)
## Run via docker
```shell
docker run --rm -v $PWD:/tmp aldanial/cloc
```
## Install via package manager ## Install via package manager
Depending your operating system, one of these installation methods may work for Depending your operating system, one of these installation methods may
you: work for you (all but the last two entries for Windows require
a Perl interpreter):
npm install -g cloc # https://www.npmjs.com/package/cloc npm install -g cloc # https://www.npmjs.com/package/cloc
sudo apt install cloc # Debian, Ubuntu sudo apt install cloc # Debian, Ubuntu
sudo yum install cloc # Red Hat, Fedora sudo yum install cloc # Red Hat, Fedora
sudo dnf install cloc # Fedora 22 or later sudo dnf install cloc # Fedora 22 or later
sudo pacman -S cloc # Arch sudo pacman -S cloc # Arch
sudo emerge -av dev-util/cloc # Gentoo https://packages.gentoo.org/ packages/dev-util/cloc sudo emerge -av dev-util/cloc # Gentoo https://packages.gentoo.org/ packages/dev-util/cloc
sudo apk add cloc # Alpine Linux sudo apk add cloc # Alpine Linux
sudo pkg install cloc # FreeBSD sudo pkg install cloc # FreeBSD
sudo port install cloc # Mac OS X with MacPorts sudo port install cloc # Mac OS X with MacPorts
skipping to change at line 355 skipping to change at line 365
This module does not work reliably on Windows so parallel processing This module does not work reliably on Windows so parallel processing
will only work on Unix-like operating systems. will only work on Unix-like operating systems.
The Windows binary is built on a computer that has both Regexp::Common The Windows binary is built on a computer that has both Regexp::Common
and Digest::MD5 installed locally. and Digest::MD5 installed locally.
[](1}}}) [](1}}})
<a name="building_exe"></a> []({{{1) <a name="building_exe"></a> []({{{1)
# [Building a Windows Executable &#9650;](#___top "click to go to top of documen t") # [Building a Windows Executable &#9650;](#___top "click to go to top of documen t")
The Windows downloads The Windows downloads
<tt>cloc-1.70.exe</tt> and <tt>cloc-1.86.exe</tt> was built on a 64 bit Windows 10 virtual machine
<tt>cloc-1.72.exe</tt> were downloaded from https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
built with [PAR::Packer](http://search.cpan.org/~rschupp/PAR-Packer-1.019/lib/pp using
.pm) [Strawberry Perl](http://strawberryperl.com/)
and Strawberry Perl 5.24.0.1 5.30.2 and
[PAR::Packer](http://search.cpan.org/~rschupp/PAR-Packer-1.019/lib/pp.pm)
to build the `.exe`.
Releases 1.74 through 1.84
were was built on a 32 bit Windows 7 virtual machine
using Strawberry Perl 5.26.1.1, while
1.70 and 1.72 were built with Strawberry Perl 5.24.0.1
on an Amazon Web Services t2.micro instance running Microsoft Windows Server 200 8 on an Amazon Web Services t2.micro instance running Microsoft Windows Server 200 8
(32 bit for 1.70 and 1.72; 64 bit for 1.74). (32 bit for 1.70 and 1.72; 64 bit for 1.74).
Releases 1.74 through 1.84 The <tt>cloc-1.66.exe</tt> executable was built
were was built on a 32 bit Windows 7 virtual machine (IE11.Win7.For.Windows.Virt on a 32 bit Windows 7 VirtualBox image.
ualBox.zip
pulled from https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/)
using Strawberry Perl 5.26.1.1.
The <tt>cloc-1.66.exe</tt> executable was built with [PAR::Packer](http://search
.cpan.org/~rschupp/PAR-Packer-1.019/lib/pp.pm)
on a 32 bit Windows 7 VirtualBox image
pulled from https://dev.windows.com/en-us/microsoft-edge/tools/vms/linux/
and running on an Ubuntu 15.10 host.
The virtual machine ran
[Strawberry Perl](http://strawberryperl.com/) version 5.22.1.
Windows executables of cloc versions Windows executables of cloc versions
1.60 and earlier were built with 1.60 and earlier were built with
[perl2exe](http://www.indigostar.com/perl2exe.htm) on a 32 bit Windows [perl2exe](http://www.indigostar.com/perl2exe.htm) on a 32 bit Windows
XP computer. A small modification was made to the cloc source code XP computer. A small modification was made to the cloc source code
before passing it to perl2exe; lines 87 and 88 were uncommented: before passing it to perl2exe; lines 87 and 88 were uncommented:
<pre> <pre>
<font color="gray">85</font> # Uncomment next two lines when building Windows e xecutable with perl2exe <font color="gray">85</font> # Uncomment next two lines when building Windows e xecutable with perl2exe
<font color="gray">86</font> # or if running on a system that already has Regex p::Common. <font color="gray">86</font> # or if running on a system that already has Regex p::Common.
<font color="gray">87</font> <font color="red">#use Regexp::Common;</font> <font color="gray">87</font> <font color="red">#use Regexp::Common;</font>
skipping to change at line 394 skipping to change at line 403
</pre> </pre>
#### Is the Windows executable safe to run? Does it have malware? #### Is the Windows executable safe to run? Does it have malware?
Ideally, no one would need the Windows executable because they Ideally, no one would need the Windows executable because they
have a Perl interpreter installed on their machines and can have a Perl interpreter installed on their machines and can
run the cloc source file. run the cloc source file.
On centrally-managed corporate Windows machines, however, this On centrally-managed corporate Windows machines, however, this
this may be difficult or impossible. this may be difficult or impossible.
The Windows executable distributed with cloc The Windows executable distributed with cloc is provided as
is provided as
a best-effort of a virus and malware-free `.exe`. a best-effort of a virus and malware-free `.exe`.
You are encouraged to run your own virus scanners against the You are encouraged to run your own virus scanners against the
executable and also check sites such executable and also check sites such
https://www.virustotal.com/ . https://www.virustotal.com/ .
The entries for recent versions are: The entries for recent versions are:
cloc-1.86.exe:
https://www.virustotal.com/gui/file/1b2e189df1834411b34534db446330d1c379b4bc008a
f3042ee9ade818c6a1c8/detection
cloc-1.84.exe: cloc-1.84.exe:
https://www.virustotal.com/gui/file/e73d490c1e4ae2f50ee174005614029b4fa2610dcb76 988714839d7be68479af/detection https://www.virustotal.com/gui/file/e73d490c1e4ae2f50ee174005614029b4fa2610dcb76 988714839d7be68479af/detection
cloc-1.82.exe: cloc-1.82.exe:
https://www.virustotal.com/#/file/2e5fb443fdefd776d7b6b136a25e5ee2048991e7350428 97dbd0bf92efb16563/detection https://www.virustotal.com/#/file/2e5fb443fdefd776d7b6b136a25e5ee2048991e7350428 97dbd0bf92efb16563/detection
cloc-1.80.exe: cloc-1.80.exe:
https://www.virustotal.com/#/file/9e547b01c946aa818ffad43b9ebaf05d3da08ed6ca876e f2b6847be3bf1cf8be/detection https://www.virustotal.com/#/file/9e547b01c946aa818ffad43b9ebaf05d3da08ed6ca876e f2b6847be3bf1cf8be/detection
cloc-1.78.exe: cloc-1.78.exe:
skipping to change at line 466 skipping to change at line 477
(for example Strawberry Perl or ActivePerl) following their (for example Strawberry Perl or ActivePerl) following their
instructions. Next, open a command prompt, aka a DOS window and install instructions. Next, open a command prompt, aka a DOS window and install
the PAR::Packer module. Finally, invoke the newly installed `pp` the PAR::Packer module. Finally, invoke the newly installed `pp`
command with the cloc source code to create an `.exe` file: command with the cloc source code to create an `.exe` file:
<pre> <pre>
C:> cpan -i Digest::MD5 C:> cpan -i Digest::MD5
C:> cpan -i Regexp::Common C:> cpan -i Regexp::Common
C:> cpan -i Algorithm::Diff C:> cpan -i Algorithm::Diff
C:> cpan -i PAR::Packer C:> cpan -i PAR::Packer
C:> pp -M Digest::MD5 -c -x -o cloc-1.84.exe cloc-1.84.pl C:> pp -M Digest::MD5 -c -x -o cloc-1.86.exe cloc-1.86.pl
</pre> </pre>
A variation on the instructions above is if you installed the portable A variation on the instructions above is if you installed the portable
version of Strawberry Perl, you will need to run `portableshell.bat` first version of Strawberry Perl, you will need to run `portableshell.bat` first
to properly set up your environment. to properly set up your environment.
[](1}}}) [](1}}})
<a name="Basic_Use"></a> []({{{1) <a name="Basic_Use"></a> []({{{1)
# [Basic Use &#9650;](#___top "click to go to top of document") # [Basic Use &#9650;](#___top "click to go to top of document")
skipping to change at line 882 skipping to change at line 893
X = 'c' -&gt; # lines of code X = 'c' -&gt; # lines of code
X = 'cm' -&gt; # lines of code + comments X = 'cm' -&gt; # lines of code + comments
X = 'cb' -&gt; # lines of code + blanks X = 'cb' -&gt; # lines of code + blanks
X = 'cmb' -&gt; # lines of code + comments + bla nks X = 'cmb' -&gt; # lines of code + comments + bla nks
For example, if using method 'c' and your code For example, if using method 'c' and your code
has twice as many lines of comments as lines has twice as many lines of comments as lines
of code, the value in the comment column will of code, the value in the comment column will
be 200%. The code column remains a line count. be 200%. The code column remains a line count.
--csv Write the results as comma separated values. --csv Write the results as comma separated values.
--csv-delimiter=&lt;C&gt; Use the character &lt;C&gt; as the delimiter for comma --csv-delimiter=&lt;C&gt; Use the character &lt;C&gt; as the delimiter for comma
separated files instead of ,. This switch forces separated files instead of ,. This switch forces - -csv to be on.
--file-encoding=&lt;E&gt; Write output files using the &lt;E&gt; encodi ng instead of --file-encoding=&lt;E&gt; Write output files using the &lt;E&gt; encodi ng instead of
the default ASCII (&lt;E&gt; = 'UTF-7'). Examples: 'UTF-16', the default ASCII (&lt;E&gt; = 'UTF-7'). Examples: 'UTF-16',
'euc-kr', 'iso-8859-16'. Known encodings can be 'euc-kr', 'iso-8859-16'. Known encodings can be
printed with printed with
perl -MEncode -e 'print join("\n", Encode-&gt;enc odings(":all")), "\n"' perl -MEncode -e 'print join("\n", Encode-&gt;enc odings(":all")), "\n"'
--hide-rate Do not show line and file processing rates in the --hide-rate Do not show line and file processing rates in the
output header. This makes output deterministic. output header. This makes output deterministic.
--json Write the results as JavaScript Object Notation --json Write the results as JavaScript Object Notation
(JSON) formatted output. (JSON) formatted output.
--md Write the results as Markdown-formatted text. --md Write the results as Markdown-formatted text.
skipping to change at line 949 skipping to change at line 960
Apex Trigger (trigger) Apex Trigger (trigger)
APL (apl, apla, aplc, aplf, apli, apln, aplo, dyalog, dya pp, mipage) APL (apl, apla, aplc, aplf, apli, apln, aplo, dyalog, dya pp, mipage)
Arduino Sketch (ino, pde) Arduino Sketch (ino, pde)
AsciiDoc (adoc, asciidoc) AsciiDoc (adoc, asciidoc)
ASP (asa, ashx, asp, axd) ASP (asa, ashx, asp, axd)
ASP.NET (asax, ascx, asmx, aspx, master, sitemap, webinfo) ASP.NET (asax, ascx, asmx, aspx, master, sitemap, webinfo)
AspectJ (aj) AspectJ (aj)
Assembly (a51, asm, nasm, S, s) Assembly (a51, asm, nasm, S, s)
AutoHotkey (ahk, ahkl) AutoHotkey (ahk, ahkl)
awk (auk, awk, gawk, mawk, nawk) awk (auk, awk, gawk, mawk, nawk)
Bazel (bazel, BUILD)
Blade (blade, blade.php) Blade (blade, blade.php)
Bourne Again Shell (bash) Bourne Again Shell (bash)
Bourne Shell (sh) Bourne Shell (sh)
BrightScript (brs) BrightScript (brs)
builder (xml.builder) builder (xml.builder)
C (c, cats, ec, idc, pgc) C (c, cats, ec, idc, pgc)
C Shell (csh, tcsh) C Shell (csh, tcsh)
C# (cs) C# (cs)
C++ (C, c++, cc, CPP, cpp, cxx, h++, inl, ipp, pcc, tcc, tpp) C++ (C, c++, cc, CPP, cpp, cxx, h++, inl, ipp, pcc, tcc, tpp)
C/C++ Header (H, h, hh, hpp, hxx) C/C++ Header (H, h, hh, hpp, hxx)
skipping to change at line 980 skipping to change at line 992
Coq (v) Coq (v)
Crystal (cr) Crystal (cr)
CSON (cson) CSON (cson)
CSS (css) CSS (css)
Cucumber (feature) Cucumber (feature)
CUDA (cu, cuh) CUDA (cu, cuh)
Cython (pxd, pxi, pyx) Cython (pxd, pxi, pyx)
D (d) D (d)
DAL (da) DAL (da)
Dart (dart) Dart (dart)
dhall (dhall)
DIET (dt) DIET (dt)
diff (diff, patch) diff (diff, patch)
DITA (dita) DITA (dita)
DOORS Extension Language (dxl) DOORS Extension Language (dxl)
DOS Batch (BAT, bat, BTM, btm, cmd, CMD) DOS Batch (BAT, bat, BTM, btm, CMD, cmd)
Drools (drl) Drools (drl)
DTD (dtd) DTD (dtd)
dtrace (d) dtrace (d)
ECPP (ecpp) ECPP (ecpp)
EEx (eex) EEx (eex)
EJS (ejs) EJS (ejs)
Elixir (ex, exs) Elixir (ex, exs)
Elm (elm) Elm (elm)
Embedded Crystal (ecr) Embedded Crystal (ecr)
ERB (ERB, erb) ERB (ERB, erb)
Erlang (app.src, emakefile, erl, hrl, rebar.config, rebar.co nfig.lock, rebar.lock, xrl, yrl) Erlang (app.src, emakefile, erl, hrl, rebar.config, rebar.co nfig.lock, rebar.lock, xrl, yrl)
Expect (exp) Expect (exp)
F# (fsi, fs, fs) F# (fsi, fs, fs)
F# Script (fsx) F# Script (fsx)
Fennel (fnl) Fennel (fnl)
Fish Shell (fish) Fish Shell (fish)
Focus (focexec) Focus (focexec)
Forth (4th, e4, f83, fb, forth, fpm, fr, frt, ft, fth, rx, fs, f, for) Forth (4th, e4, f83, fb, forth, fpm, fr, frt, ft, fth, rx, fs, f, for)
Fortran 77 (F, F77, f77, FOR, FTN, ftn, pfo, f, for) Fortran 77 (F, F77, f77, FOR, FTN, ftn, pfo, f, for)
Fortran 90 (f90, F90) Fortran 90 (F90, f90)
Fortran 95 (F95, f95) Fortran 95 (F95, f95)
Freemarker Template (ftl) Freemarker Template (ftl)
FXML (fxml) FXML (fxml)
GDScript (gd) GDScript (gd)
Gencat NLS (msg) Gencat NLS (msg)
Glade (glade, ui) Glade (glade, ui)
GLSL (comp, fp, frag, frg, fsh, fshader, geo, geom, glsl, glslv, gshader, tesc, tese, vert, vrx, vsh, vshader) GLSL (comp, fp, frag, frg, fsh, fshader, geo, geom, glsl, glslv, gshader, tesc, tese, vert, vrx, vsh, vshader)
Go (go) Go (go)
Gradle (gradle, gradle.kts) Gradle (gradle, gradle.kts)
Grails (gsp) Grails (gsp)
skipping to change at line 1057 skipping to change at line 1070
LESS (less) LESS (less)
lex (l, lex) lex (l, lex)
LFE (lfe) LFE (lfe)
liquid (liquid) liquid (liquid)
Lisp (asd, el, lisp, lsp, cl, jl) Lisp (asd, el, lisp, lsp, cl, jl)
Literate Idris (lidr) Literate Idris (lidr)
LiveLink OScript (oscript) LiveLink OScript (oscript)
Logtalk (lgt, logtalk) Logtalk (lgt, logtalk)
Lua (lua, nse, p8, pd_lua, rbxs, wlua) Lua (lua, nse, p8, pd_lua, rbxs, wlua)
m4 (ac, m4) m4 (ac, m4)
make (am, gnumakefile, Gnumakefile, Makefile, makefile, mk ) make (am, Gnumakefile, gnumakefile, Makefile, makefile, mk )
Mako (mako, mao) Mako (mako, mao)
Markdown (contents.lr, markdown, md, mdown, mdwn, mdx, mkd, mk dn, mkdown, ronn, workbook) Markdown (contents.lr, markdown, md, mdown, mdwn, mdx, mkd, mk dn, mkdown, ronn, workbook)
Mathematica (cdf, ma, mathematica, mt, nbp, wl, wlt, m) Mathematica (cdf, ma, mathematica, mt, nbp, wl, wlt, m)
MATLAB (m) MATLAB (m)
Maven (pom, pom.xml) Maven (pom, pom.xml)
Modula3 (i3, ig, m3, mg) Modula3 (i3, ig, m3, mg)
MSBuild script (csproj, vbproj, vcproj, wdproj, wixproj) MSBuild script (csproj, vbproj, vcproj, wdproj, wixproj)
MUMPS (mps, m) MUMPS (mps, m)
Mustache (mustache) Mustache (mustache)
MXML (mxml) MXML (mxml)
skipping to change at line 1083 skipping to change at line 1096
Objective C (m) Objective C (m)
Objective C++ (mm) Objective C++ (mm)
OCaml (eliom, eliomi, ml, ml4, mli, mll, mly) OCaml (eliom, eliomi, ml, ml4, mli, mll, mly)
OpenCL (cl) OpenCL (cl)
Oracle Forms (fmt) Oracle Forms (fmt)
Oracle PL/SQL (bod, fnc, prc, spc, trg) Oracle PL/SQL (bod, fnc, prc, spc, trg)
Oracle Reports (rex) Oracle Reports (rex)
Pascal (dfm, dpr, lpr, p, pas, pascal) Pascal (dfm, dpr, lpr, p, pas, pascal)
Pascal/Puppet (pp) Pascal/Puppet (pp)
Patran Command Language (pcl, ses) Patran Command Language (pcl, ses)
Perl (ack, al, cpanfile, makefile.pl, perl, ph, plh, plx, pm, pm6, psgi, rexfile, pl) Perl (ack, al, cpanfile, makefile.pl, perl, ph, plh, plx, pm, psgi, rexfile, pl, p6)
PHP (aw, ctp, phakefile, php, php3, php4, php5, php_cs, p hp_cs.dist, phps, phpt, phtml) PHP (aw, ctp, phakefile, php, php3, php4, php5, php_cs, p hp_cs.dist, phps, phpt, phtml)
PHP/Pascal (inc) PHP/Pascal (inc)
Pig Latin (pig) Pig Latin (pig)
PL/I (pl1) PL/I (pl1)
PL/M (lit, plm) PL/M (lit, plm)
PO File (po) PO File (po)
PowerBuilder (pbt, sra, srf, srm, srs, sru, srw) PowerBuilder (pbt, sra, srf, srm, srs, sru, srw)
PowerShell (ps1, psd1, psm1) PowerShell (ps1, psd1, psm1)
ProGuard (pro) ProGuard (pro)
Prolog (P, prolog, yap, pl, pro) Prolog (P, prolog, yap, pl, p6, pro)
Protocol Buffers (proto) Protocol Buffers (proto)
Pug (jade, pug) Pug (jade, pug)
PureScript (purs) PureScript (purs)
Python (buck, build.bazel, gclient, gyp, gypi, lmi, py, py3, pyde, pyi, pyp, pyt, pyw, sconscript, sconstruct, snakefile, tac, workspace, ws cript, wsgi, xpy) Python (buck, build.bazel, gclient, gyp, gypi, lmi, py, py3, pyde, pyi, pyp, pyt, pyw, sconscript, sconstruct, snakefile, tac, workspace, ws cript, wsgi, xpy)
QML (qbs, qml) QML (qbs, qml)
Qt (ui) Qt (ui)
Qt Linguist (ts) Qt Linguist (ts)
Qt Project (pro) Qt Project (pro)
R (expr-dist, r, R, rd, rprofile, rsx) R (expr-dist, R, r, rd, rprofile, rsx)
Racket (rkt, rktd, rktl, scrbl) Racket (rkt, rktd, rktl, scrbl)
Raku (pm6, raku, rakumod)
Raku/Prolog (P6, p6)
RAML (raml) RAML (raml)
RapydScript (pyj) RapydScript (pyj)
Razor (cshtml) Razor (cshtml, razor)
ReasonML (re, rei) ReasonML (re, rei)
reStructuredText (rest, rest.txt, rst, rst.txt) reStructuredText (rest, rest.txt, rst, rst.txt)
Rexx (pprx, rexx) Rexx (pprx, rexx)
Rmd (Rmd) Rmd (Rmd)
RobotFramework (robot, tsv) RobotFramework (robot)
Ruby (appraisals, berksfile, brewfile, builder, buildfile, capfile, dangerfile, deliverfile, eye, fastfile, gemfile, gemfile.lock, gemspec , god, guardfile, irbrc, jarfile, jbuilder, mavenfile, mspec, podfile, podspec, pryrc, puppetfile, rabl, rake, rb, rbuild, rbw, rbx, ru, snapfile, thor, thorfil e, vagrantfile, watchr) Ruby (appraisals, berksfile, brewfile, builder, buildfile, capfile, dangerfile, deliverfile, eye, fastfile, gemfile, gemfile.lock, gemspec , god, guardfile, irbrc, jarfile, jbuilder, mavenfile, mspec, podfile, podspec, pryrc, puppetfile, rabl, rake, rb, rbuild, rbw, rbx, ru, snapfile, thor, thorfil e, vagrantfile, watchr)
Ruby HTML (rhtml) Ruby HTML (rhtml)
Rust (rs, rs.in) Rust (rs, rs.in)
SaltStack (sls) SaltStack (sls)
SAS (sas) SAS (sas)
Sass (sass, scss) Sass (sass, scss)
Scala (kojo, sbt, scala) Scala (kojo, sbt, scala)
Scheme (sc, sch, scm, sld, sps, ss, sls) Scheme (sc, sch, scm, sld, sps, ss, sls)
sed (sed) sed (sed)
SKILL (il) SKILL (il)
SKILL++ (ils) SKILL++ (ils)
Slice (ice) Slice (ice)
Slim (slim) Slim (slim)
Smalltalk (st, cs) Smalltalk (st, cs)
Smarty (smarty, tpl) Smarty (smarty, tpl)
Softbridge Basic (sbl, SBL) Softbridge Basic (SBL, sbl)
Solidity (sol) Solidity (sol)
SparForte (sp) SparForte (sp)
Specman e (e) Specman e (e)
SQL (cql, mysql, psql, sql, SQL, tab, udf, viw) SQL (cql, mysql, psql, SQL, sql, tab, udf, viw)
SQL Data (data.sql) SQL Data (data.sql)
SQL Stored Procedure (spc.sql, spoc.sql, sproc.sql, udf.sql) SQL Stored Procedure (spc.sql, spoc.sql, sproc.sql, udf.sql)
Squirrel (nut)
Standard ML (fun, sig, sml) Standard ML (fun, sig, sml)
Starlark (bzl) Starlark (bzl)
Stata (ado, do, DO, doh, ihlp, mata, matah, sthlp) Stata (ado, DO, do, doh, ihlp, mata, matah, sthlp)
Stylus (styl) Stylus (styl)
SVG (svg, SVG) SugarSS (sss)
Svelte (svelte)
SVG (SVG, svg)
Swift (swift) Swift (swift)
SWIG (i) SWIG (i)
Tcl/Tk (itk, tcl, tk) Tcl/Tk (itk, tcl, tk)
Teamcenter met (met) Teamcenter met (met)
Teamcenter mth (mth) Teamcenter mth (mth)
TeX (aux, bbx, bib, bst, cbx, dtx, ins, lbx, ltx, mkii, m kiv, mkvi, sty, tex, cls) TeX (aux, bbx, bib, bst, cbx, dtx, ins, lbx, ltx, mkii, m kiv, mkvi, sty, tex, cls)
Thrift (thrift) Thrift (thrift)
TITAN Project File Information (tpd) TITAN Project File Information (tpd)
Titanium Style Sheet (tss) Titanium Style Sheet (tss)
TNSDL (cii, cin, in1, in2, in3, in4, inf, interface, rou, s dl, sdt, spd, ssc, sst)
TOML (toml) TOML (toml)
TTCN (ttcn, ttcn2, ttcn3, ttcnpp) TTCN (ttcn, ttcn2, ttcn3, ttcnpp)
Twig (twig) Twig (twig)
TypeScript (tsx, ts) TypeScript (tsx, ts)
Unity-Prefab (mat, prefab) Unity-Prefab (mat, prefab)
Vala (vala) Vala (vala)
Vala Header (vapi) Vala Header (vapi)
Velocity Template Language (vm) Velocity Template Language (vm)
Verilog-SystemVerilog (sv, svh, v) Verilog-SystemVerilog (sv, svh, v)
VHDL (VHD, vhd, vhdl, VHDL, vhf, vhi, vho, vhs, vht, vhw) VHDL (VHD, vhd, VHDL, vhdl, vhf, vhi, vho, vhs, vht, vhw)
vim script (vim) vim script (vim)
Visual Basic (bas, ctl, dsr, frm, frx, vb, VB, VBA, vba, vbhtml, v bs, VBS, cls) Visual Basic (bas, ctl, dsr, frm, frx, VB, vb, VBA, vba, vbhtml, V BS, vbs, cls)
Visual Fox Pro (SCA, sca) Visual Fox Pro (SCA, sca)
Visualforce Component (component) Visualforce Component (component)
Visualforce Page (page) Visualforce Page (page)
Vuejs Component (vue) Vuejs Component (vue)
WebAssembly (wast, wat) WebAssembly (wast, wat)
Windows Message File (mc) Windows Message File (mc)
Windows Module Definition (def) Windows Module Definition (def)
Windows Resource File (rc, rc2) Windows Resource File (rc, rc2)
WiX include (wxi) WiX include (wxi)
WiX source (wxs) WiX source (wxs)
WiX string localization (wxl) WiX string localization (wxl)
XAML (xaml) XAML (xaml)
xBase (prg, prw) xBase (prg, prw)
xBase Header (ch) xBase Header (ch)
XHTML (xhtml) XHTML (xhtml)
XMI (xmi, XMI) XMI (XMI, xmi)
XML (adml, admx, ant, app.config, axml, builds, ccproj, c cxml, classpath, clixml, cproject, cscfg, csdef, csl, ct, depproj, ditamap, dita val, dll.config, dotsettings, filters, fsproj, gmx, grxml, iml, ivy, jelly, jspr oj, kml, launch, mdpolicy, mjml, natvis, ndproj, nproj, nuget.config, nuspec, od d, osm, packages.config, pkgproj, plist, proj, project, props, ps1xml, psc1, pt, rdf, resx, rss, scxml, settings.stylecop, sfproj, shproj, srdf, storyboard, stt heme, sublime-snippet, targets, tmcommand, tml, tmlanguage, tmpreferences, tmsni ppet, tmtheme, urdf, ux, vcxproj, vsixmanifest, vssettings, vstemplate, vxml, we b.config, web.debug.config, web.release.config, wsf, x3d, xacro, xib, xlf, xliff , XML, xml, xml.dist, xproj, xspec, xul, zcml) XML (adml, admx, ant, app.config, axml, builds, ccproj, c cxml, classpath, clixml, cproject, cscfg, csdef, csl, ct, depproj, ditamap, dita val, dll.config, dotsettings, filters, fsproj, gmx, grxml, iml, ivy, jelly, jspr oj, kml, launch, mdpolicy, mjml, natvis, ndproj, nproj, nuget.config, nuspec, od d, osm, packages.config, pkgproj, plist, proj, project, props, ps1xml, psc1, pt, rdf, resx, rss, scxml, settings.stylecop, sfproj, shproj, srdf, storyboard, stt heme, sublime-snippet, targets, tmcommand, tml, tmlanguage, tmpreferences, tmsni ppet, tmtheme, urdf, ux, vcxproj, vsixmanifest, vssettings, vstemplate, vxml, we b.config, web.debug.config, web.release.config, wsf, x3d, xacro, xib, xlf, xliff , XML, xml, xml.dist, xproj, xspec, xul, zcml)
XQuery (xq, xql, xqm, xquery, xqy) XQuery (xq, xql, xqm, xquery, xqy)
XSD (xsd, XSD) XSD (XSD, xsd)
XSLT (XSL, xsl, xslt, XSLT) XSLT (XSL, xsl, XSLT, xslt)
Xtend (xtend) Xtend (xtend)
yacc (y, yacc) yacc (y, yacc)
YAML (clang-format, clang-tidy, gemrc, glide.lock, mir, re ek, rviz, sublime-syntax, syntax, yaml, yaml-tmlanguage, yml, yml.mysql) YAML (clang-format, clang-tidy, gemrc, glide.lock, mir, re ek, rviz, sublime-syntax, syntax, yaml, yaml-tmlanguage, yml, yml.mysql)
zsh (zsh) zsh (zsh)
</pre> </pre>
The above list can be customized by reading language definitions from a The above list can be customized by reading language definitions from a
file with the `--read-lang-def` or `--force-lang-def` options. file with the `--read-lang-def` or `--force-lang-def` options.
These file extensions map to multiple languages: These file extensions map to multiple languages:
skipping to change at line 2594 skipping to change at line 2613
make 5 127 173 464 764 make 5 127 173 464 764
Markdown 2 30 0 39 69 Markdown 2 30 0 39 69
</pre> </pre>
Other examples: Other examples:
* Count code from a specific branch of a web-hosted * Count code from a specific branch of a web-hosted
git repository and send the results as a .csv email attachment: git repository and send the results as a .csv email attachment:
https://github.com/dannyloweatx/checkmarx https://github.com/dannyloweatx/checkmarx
[](1}}}) [](1}}})
<a name="git_and_UTF8_pathnames"></a> []({{{1)
## [git and UTF8 pathnames &#9650;](#___top "click to go to top of document")
cloc's ``--git`` option may fail if you work with directory or
file names with UTF-8 characters (for example, see
<a href=https://github.com/AlDanial/cloc/issues/457>issue 457</a>).
The solution,
https://stackoverflow.com/questions/22827239/how-to-make-git-properly-display-ut
f-8-encoded-pathnames-in-the-console-window,
is to apply this git configuration command:
<pre>
git config --global core.quotepath off
</pre>
Your console's font will need to be capable of displaying
Unicode characters.
[](1}}})
<a name="scale_factors"></a> []({{{1) <a name="scale_factors"></a> []({{{1)
## [Third Generation Language Scale Factors &#9650;](#___top "click to go to to p of document") ## [Third Generation Language Scale Factors &#9650;](#___top "click to go to to p of document")
cloc versions before 1.50 by default computed, for the provided inputs, a cloc versions before 1.50 by default computed, for the provided inputs, a
rough estimate of how many lines of code would be needed to write the rough estimate of how many lines of code would be needed to write the
same code in a hypothetical third-generation computer language. same code in a hypothetical third-generation computer language.
To produce this output one must now use the `--3` switch. To produce this output one must now use the `--3` switch.
Scale factors were derived from the 2006 version of language gearing ratios Scale factors were derived from the 2006 version of language gearing ratios
listed at Mayes Consulting web site, listed at Mayes Consulting web site,
skipping to change at line 2687 skipping to change at line 2724
for (i = 0; i < 100; i++) { for (i = 0; i < 100; i++) {
a += i; a += i;
} }
printf(" "); printf(" ");
</pre> </pre>
and therefore return a count of five lines of code. and therefore return a count of five lines of code.
See the See the
[previous section](#complex-regular-subexpression-recursion-limit-) [previous section](#complex-regular-subexpression-recursion-limit-)
on drawbacks to using ``--strip-str-comments``. on drawbacks to using ``--strip-str-comments``.
</li> </li>
<li> Embedded languages are not recognized. For example, an HTML file containi ng <li> Embedded languages are not recognized. For example, an HTML file containin g
JavaScript will be counted entirely as HTML. JavaScript will be counted entirely as HTML.
</li> </li>
<li> Python docstrings can serve several purposes. They may <li> Python docstrings can serve several purposes. They may
contain documentation, contain documentation,
comment out blocks of code, or they can be regular strings (when comment out blocks of code, or they can be regular strings (when
they appear on the right hand side of an assignment or as a function argument). they appear on the right hand side of an assignment or as a function argument).
cloc is unable to infer the meaning of docstrings by context; by default cloc is unable to infer the meaning of docstrings by context; by default
cloc treats all docstrings as comments. The switch cloc treats all docstrings as comments. The switch
``--docstring-as--code`` ``--docstring-as--code``
treats all docstrings as code. treats all docstrings as code.
</li> </li>
<li> Language definition files read with <tt>--read-lang-def</tt> or
<tt>--force-lang-def</tt> must be plain ASCII text files.
</li>
<li> cloc treats compiler pragma's, for example <tt>#if</tt> / <tt>#endif</tt>,
as code
even if these are used to block lines of source from being compiled;
the blocked lines still contribute to the code count.
</li>
</ol> </ol>
[](1}}}) [](1}}})
<a name="AdditionalLanguages"></a> []({{{1) <a name="AdditionalLanguages"></a> []({{{1)
# [How to Request Support for Additional Languages &#9650;](#___top "click to go to top of document") # [Requesting Support for Additional Languages &#9650;](#___top "click to go t o top of document")
If cloc does not recognize a language you are interested in counting, If cloc does not recognize a language you are interested in counting,
create a [GitHub issue](https://github.com/AlDanial/cloc/issues) create a [GitHub issue](https://github.com/AlDanial/cloc/issues)
requesting support for your language. Include this information: requesting support for your language. Include this information:
<ol> <ol>
<li> File extensions associated with the language. If the language does <li> File extensions associated with the language. If the language does
not rely on file extensions and instead works with fixed file names or not rely on file extensions and instead works with fixed file names or
with `#!` style program invocations, explain what those are.</li> with `#!` style program invocations, explain what those are.</li>
<li> A description of how comments are defined.</li> <li> A description of how comments are defined.</li>
<li> Links to sample code.</li> <li> Links to sample code.</li>
</ol> </ol>
[](1}}}) [](1}}})
<a name="in_progress"></a> []({{{1) <a name="reporting_problems"></a> []({{{1)
## [Features Currently in Development &#9650;](#___top "click to go to top of d # [Reporting Problems &#9650;](#___top "click to go to top of document")
ocument")
Here, in no particular order and with no promise of future delivery, are If you encounter a problem with cloc, first check to see if
features and capabilities currently in development: you're running with the latest version of the tool:
<pre>
cloc --version
</pre>
If the version is older than the most recent release
at https://github.com/AlDanial/cloc/releases, download the
latest version and see if it solves your problem.
If the problem happens with the latest release, submit
a new issue at https://github.com/AlDanial/cloc/issues *only*
if you can supply enough information for anyone reading the
issue report to reproduce the problem.
That means providing
<ol> <ol>
<li> produce reStructuredText output with `--rst`</li> <li> the operating system you're running on</li>
<li> count code (e.g. Javascript) embedded in HTML files </li> <li> the cloc command with all options</li>
<li> the code you are counting (URL to a public git repo or zip file or
tar file, et cetera)</li>
</ol> </ol>
The last item is generally problematic. If the code base is
proprietary or amounts to more than a few dozen kilobytes,
you'll need to try to reconstruct similar inputs or demonstrate
the problem with an existing public code base.
Pull requests for these features will receive extra consideration. Problem reports that cannot be reproduced will be ignored and
eventually closed.
[](1}}}) [](1}}})
<a name="Acknowledgments"></a> []({{{1) <a name="Acknowledgments"></a> []({{{1)
# [Acknowledgments &#9650;](#___top "click to go to top of document") # [Acknowledgments &#9650;](#___top "click to go to top of document")
Wolfram Rösler provided most of the code examples in the test suite. [Wolfram Rösler](https://github.com/wolframroesler) provided most of the code ex amples in the test suite.
These examples come from his [Hello World collection](http://helloworldcollectio n.de/). These examples come from his [Hello World collection](http://helloworldcollectio n.de/).
Ismet Kursunoglu found errors with the MUMPS counter and provided Ismet Kursunoglu found errors with the MUMPS counter and provided
access to a computer with a large body of MUMPS code to test cloc. access to a computer with a large body of MUMPS code to test cloc.
Tod Huggins gave helpful suggestions for the Visual Basic filters. Tod Huggins gave helpful suggestions for the Visual Basic filters.
Anton Demichev found a flaw with the JSP counter in cloc v0.76 Anton Demichev found a flaw with the JSP counter in cloc v0.76
and wrote the XML output generator for the `--xml` option. and wrote the XML output generator for the `--xml` option.
 End of changes. 45 change blocks. 
62 lines changed or deleted 123 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)