Skip to content

Commit 5b9cdec

Browse files
committed
v1.98
1 parent 86318d1 commit 5b9cdec

File tree

5 files changed

+104
-73
lines changed

5 files changed

+104
-73
lines changed

README.md

+49-67
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* * *
66
cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.
77

8-
Latest release: v1.96 (Dec. 18, 2022)
8+
Latest release: v1.98 (Aug. 19, 2023)
99

1010
<a href="https://github.com/AlDanial/cloc/graphs/contributors" alt="Contributors">
1111
<img src="https://img.shields.io/github/contributors/AlDanial/cloc" /></a>
@@ -64,11 +64,9 @@ Step 3: Invoke cloc to count your source files, directories, archives,
6464
or git commits.
6565
The executable name differs depending on whether you use the
6666
development source version (`cloc`), source for a
67-
released version (`cloc-1.96.pl`) or a Windows executable
68-
(`cloc-1.96.1.exe`).
69-
(2023-01-10: a special
70-
[1.96.1 release](https://github.com/AlDanial/cloc/releases/tag/v1.96.1) of cloc was made to update the Windows executable to use the
71-
``Win32::LongPath`` module.)
67+
released version (`cloc-1.98.pl`) or a Windows executable
68+
(`cloc-1.98.exe`).
69+
7270
On this page, `cloc` is the generic term
7371
used to refer to any of these.
7472

@@ -385,38 +383,44 @@ and Digest::MD5 installed locally.
385383
<a name="building_exe"></a> []({{{1)
386384
# [Building a Windows Executable &#9650;](#___top "click to go to top of document")
387385

388-
The Windows downloads
389-
<tt>cloc-1.94.exe</tt>,
390-
<tt>cloc-1.92.exe</tt>,
391-
<tt>cloc-1.90.exe</tt> and
392-
<tt>cloc-1.88.exe</tt> were built on a 64 bit Windows 10 computer
393-
using
394-
[Strawberry Perl](http://strawberryperl.com/)
395-
5.30.2 and
396-
[PAR::Packer](http://search.cpan.org/~rschupp/PAR-Packer-1.050/lib/pp.pm)
397-
to build the `.exe`.
386+
#### Create your own executable
387+
The most robust option for creating a Windows executable of
388+
cloc is to use [ActiveState's Perl Development Kit](http://www.activestate.com/perl-dev-kit).
389+
It includes a utility, `perlapp`, which can build stand-alone
390+
Windows, Mac, and Linux binaries of Perl source code.
398391

399-
Release 1.86 was built on a 64 bit Windows 10 virtual machine
400-
downloaded from https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/;
401-
releases 1.74 through 1.84
402-
were was built on a 32 bit Windows 7 virtual machine
403-
using Strawberry Perl 5.26.1.1, while
404-
1.70 and 1.72 were built with Strawberry Perl 5.24.0.1
405-
on an Amazon Web Services t2.micro instance running Microsoft Windows Server 2008
406-
(32 bit for 1.70 and 1.72; 64 bit for 1.74).
407-
Release 1.66 was built on a 32 bit Windows 7 VirtualBox image.
408-
Windows executables of cloc versions 1.60 and earlier were built with
409-
[perl2exe](http://www.indigostar.com/perl2exe/) on a 32 bit Windows
410-
XP computer. A small modification was made to the cloc source code
411-
before passing it to perl2exe; lines 87 and 88 were uncommented:
392+
[perl2exe](http://www.indigostar.com/perl2exe/)
393+
will also do the trick. If you do have `perl2exe`, modify lines
394+
84-87 in the cloc source code for a minor code
395+
modification that is necessary to make a cloc Windows executable.
396+
397+
Otherwise, to build a Windows executable with `pp` from
398+
`PAR::Packer`, first install a Windows-based Perl distribution
399+
(for example Strawberry Perl or ActivePerl) following their
400+
instructions. Next, open a command prompt, aka a DOS window and install
401+
the PAR::Packer module. Finally, invoke the newly installed `pp`
402+
command with the cloc source code to create an `.exe` file:
412403

413404
<pre>
414-
<font color="gray">85</font> # Uncomment next two lines when building Windows executable with perl2exe
415-
<font color="gray">86</font> # or if running on a system that already has Regexp::Common.
416-
<font color="gray">87</font> <font color="red">#use Regexp::Common;</font>
417-
<font color="gray">88</font> <font color="red">#$HAVE_Rexexp_Common = 1;</font>
405+
C:> cpan -i Digest::MD5
406+
C:> cpan -i Regexp::Common
407+
C:> cpan -i Algorithm::Diff
408+
C:> cpan -i PAR::Packer
409+
C:> cpan -i Win32::LongPath
410+
C:> pp -M Win32::LongPath -M Encode::Unicode -M Digest::MD5 -c -x -o cloc-1.98.exe cloc-1.98.pl
418411
</pre>
419412

413+
A variation on the instructions above is if you installed the portable
414+
version of Strawberry Perl, you will need to run `portableshell.bat` first
415+
to properly set up your environment.
416+
417+
The Windows executable in the Releases section, <tt>cloc-1.98.exe</tt>,
418+
was built on a 64 bit Windows 10 computer using
419+
[Strawberry Perl](http://strawberryperl.com/)
420+
5.30.2 and
421+
[PAR::Packer](http://search.cpan.org/~rschupp/PAR-Packer-1.050/lib/pp.pm)
422+
to build the `.exe`.
423+
420424
#### Is the Windows executable safe to run? Does it have malware?
421425

422426
Ideally, no one would need the Windows executable because they
@@ -432,6 +436,9 @@ executable and also check sites such
432436
https://www.virustotal.com/ .
433437
The entries for recent versions are:
434438

439+
cloc-1.98.exe:
440+
https://www.virustotal.com/gui/file/88615d193ec8c06f7ceec3cc1d661088af997798d87ddff331d9e9f9128a6782?nocache=1
441+
435442
cloc-1.96.1.exe:
436443
https://www.virustotal.com/gui/file/00b1c9dbbfb920dabd374418e1b86d2c24b8cd2b8705aeb956dee910d0d75d45?nocache=1
437444

@@ -494,37 +501,6 @@ much larger than those built with perl2exe? My theory is that perl2exe
494501
uses smarter tree pruning logic
495502
than `PAR::Packer`, but that's pure speculation.
496503

497-
#### Create your own executable
498-
The most robust option for creating a Windows executable of
499-
cloc is to use [ActiveState's Perl Development Kit](http://www.activestate.com/perl-dev-kit).
500-
It includes a utility, `perlapp`, which can build stand-alone
501-
Windows, Mac, and Linux binaries of Perl source code.
502-
503-
[perl2exe](http://www.indigostar.com/perl2exe/)
504-
will also do the trick. If you do have `perl2exe`, modify lines
505-
84-87 in the cloc source code for a minor code
506-
modification that is necessary to make a cloc Windows executable.
507-
508-
Otherwise, to build a Windows executable with `pp` from
509-
`PAR::Packer`, first install a Windows-based Perl distribution
510-
(for example Strawberry Perl or ActivePerl) following their
511-
instructions. Next, open a command prompt, aka a DOS window and install
512-
the PAR::Packer module. Finally, invoke the newly installed `pp`
513-
command with the cloc source code to create an `.exe` file:
514-
515-
<pre>
516-
C:> cpan -i Digest::MD5
517-
C:> cpan -i Regexp::Common
518-
C:> cpan -i Algorithm::Diff
519-
C:> cpan -i PAR::Packer
520-
C:> cpan -i Win32::LongPath
521-
C:> pp -M Win32::LongPath -M Encode::Unicode -M Digest::MD5 -c -x -o cloc-1.96.exe cloc-1.96.pl
522-
</pre>
523-
524-
A variation on the instructions above is if you installed the portable
525-
version of Strawberry Perl, you will need to run `portableshell.bat` first
526-
to properly set up your environment.
527-
528504
[](1}}})
529505
<a name="Basic_Use"></a> []({{{1)
530506
# [Basic Use &#9650;](#___top "click to go to top of document")
@@ -1054,6 +1030,7 @@ ASP (asa, ashx, asp, axd)
10541030
ASP.NET (asax, ascx, asmx, aspx, master, sitemap, webinfo)
10551031
AspectJ (aj)
10561032
Assembly (a51, asm, nasm, S, s)
1033+
Asymptote (asy)
10571034
AutoHotkey (ahk, ahkl)
10581035
awk (auk, awk, gawk, mawk, nawk)
10591036
Bazel (BUILD)
@@ -1068,7 +1045,7 @@ C (c, cats, ec, idc, pgc)
10681045
C Shell (csh, tcsh)
10691046
C# (cs)
10701047
C# Designer (designer.cs)
1071-
C++ (C, c++, cc, CPP, cpp, cxx, h++, inl, ipp, pcc, tcc, tpp)
1048+
C++ (C, c++, c++m, cc, ccm, CPP, cpp, cppm, cxx, cxxm, h++, inl, ipp, ixx, pcc, tcc, tpp)
10721049
C/C++ Header (H, h, hh, hpp, hxx)
10731050
Cairo (cairo)
10741051
Cake Build Script (cake)
@@ -1082,9 +1059,11 @@ ClojureC (cljc)
10821059
ClojureScript (cljs)
10831060
CMake (cmake, cmake.in, CMakeLists.txt)
10841061
COBOL (CBL, cbl, ccp, COB, cob, cobol, cpy)
1062+
CoCoA 5 (c5, cocoa5, cocoa5server, cpkg5)
10851063
CoffeeScript (_coffee, cakefile, cjsx, coffee, iced)
10861064
ColdFusion (cfm, cfml)
10871065
ColdFusion CFScript (cfc)
1066+
Constraint Grammar (cg3, rlx)
10881067
Containerfile (Containerfile)
10891068
Coq (v)
10901069
Crystal (cr)
@@ -1149,6 +1128,7 @@ Groovy (gant, groovy, grt, gtpl, gvy, jenkinsfile)
11491128
Haml (haml, haml.deface)
11501129
Handlebars (handlebars, hbs)
11511130
Harbour (hb)
1131+
Hare (ha)
11521132
Haskell (hs, hsc, lhs)
11531133
Haxe (hx, hxsl)
11541134
HCL (hcl, nomad, tf, tfvars)
@@ -1161,9 +1141,10 @@ IDL (dlm, idl, pro)
11611141
Idris (idr)
11621142
Igor Pro (ipf)
11631143
Imba (imba)
1164-
INI (buildozer.spec, ini, lektorproject, prefs)
1144+
INI (buildozer.spec, editorconfig, ini, lektorproject, prefs)
11651145
InstallShield (ism)
11661146
IPL (ipl)
1147+
Jai (jai)
11671148
Java (java)
11681149
JavaScript (_js, bones, cjs, es6, jake, jakefile, js, jsb, jscad, jsfl, jsm, jss, mjs, njs, pac, sjs, ssjs, xsjs, xsjslib)
11691150
JavaServer Faces (jsf)
@@ -1212,6 +1193,7 @@ MXML (mxml)
12121193
NAnt script (build)
12131194
NASTRAN DMAP (dmap)
12141195
Nemerle (n)
1196+
NetLogo (nlogo, nls)
12151197
Nim (nim, nim.cfg, nimble, nimrod, nims)
12161198
Nix (nix)
12171199
Nunjucks (njk)
@@ -1317,6 +1299,7 @@ tspeg (jspeg, tspeg)
13171299
TTCN (ttcn, ttcn2, ttcn3, ttcnpp)
13181300
Twig (twig)
13191301
TypeScript (tsx, ts)
1302+
Typst (typ)
13201303
Umka (um)
13211304
Unity-Prefab (mat, prefab)
13221305
Vala (vala)
@@ -1330,7 +1313,6 @@ Visual Basic (BAS, bas, ctl, dsr, frm, FRX, frx, VBHTML, vbhtml, v
13301313
Visual Basic .NET (VB, vb, vbproj)
13311314
Visual Basic Script (VBS, vbs)
13321315
Visual Fox Pro (SCA, sca)
1333-
Visual Studio Module (ixx)
13341316
Visual Studio Solution (sln)
13351317
Visualforce Component (component)
13361318
Visualforce Page (page)

Unix/NEWS

+40
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
Release Notes for cloc version 1.98
2+
https://github.com/AlDanial/cloc
3+
Aug. 19, 2023
4+
5+
New Languages and File Types:
6+
o Asymptote
7+
o CoCoA 5
8+
o Constraint Grammar
9+
o Hare
10+
o Jai
11+
o Linker Script
12+
o NetLogo
13+
o Typst
14+
15+
Updates:
16+
o Added .editorconfig as an INI extension.
17+
o Added .cppm, .ixx, .ccm, .cxxm, .c++m as C++ extensions.
18+
o Improved handling of trailing slash with --match-d
19+
o --exclude-list-file with --git now works as expected.
20+
o --not-match-d, --not-match-f can now be repeated.
21+
o --quiet mode is now enabled when STDOUT is not a terminal.
22+
This makes for cleaner output when piping to other programs.
23+
o New switch --include-content=regex to only count files whose
24+
content matches the given regex.
25+
o New switch --only-count-files to only count files. Counts for
26+
blank, comment, and code lines will be zero.
27+
28+
Bug fixes:
29+
o --no-recurse on Windows
30+
o Improved exclusion of autogenerated files on Windows.
31+
o Improved handling of path separators with git in PowerShell.
32+
o Resolve nondeterministic --diff output.
33+
o --hide-rate supports all output file types
34+
o Fixed --diff-list-file with unknown listed file.
35+
o Fixed parsing of verbose option in the cloc configuration file.
36+
37+
NOTE: The next release of cloc will be 2.00. Despite the major version
38+
number bump, there will be no breaking changes.
39+
40+
============================================================================
141
Release Notes for cloc version 1.96
242
https://github.com/AlDanial/cloc
343
Dec. 18, 2022

Unix/cloc

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# <http://www.gnu.org/licenses/gpl.txt>.
3030
#
3131
# 1}}}
32-
my $VERSION = "1.97"; # odd number == beta; even number == stable
32+
my $VERSION = "1.98"; # odd number == beta; even number == stable
3333
my $URL = "github.com/AlDanial/cloc"; # 'https://' pushes header too wide
3434
require 5.10.0;
3535
# use modules {{{1
@@ -365,7 +365,8 @@ Usage: $script [options] <file(s)/dir(s)/git hash(es)> | <set 1> <set 2> | <repo
365365
--original-dir [Only effective in combination with
366366
--strip-comments] Write the stripped files
367367
to the same directory as the original files.
368-
--only-count-files Only count files by language.
368+
--only-count-files Only count files by language. Blank, comment, and
369+
code counts will be zero.
369370
--read-binary-files Process binary files in addition to text files.
370371
This is usually a bad idea and should only be
371372
attempted with text files that have embedded

Unix/cloc.1.pod

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright
22
#
3-
# Copyright (C) 2018-2022 Al Danial <al.danial@gmail.com>.
3+
# Copyright (C) 2018-2023 Al Danial <al.danial@gmail.com>.
44
# Copyright (C) 2010-2017 Jari Aalto <jari.aalto@cante.net>
55
#
66
# License
@@ -323,6 +323,11 @@ See also B<--autoconf>.
323323
Count files in the given directories without
324324
recursively descending below them.
325325

326+
=item B<--only-count-files>
327+
328+
Only count files by language. Blank, comment, and
329+
code counts will be zero.
330+
326331
=item B<--original-dir>
327332

328333
Only effective in combination with
@@ -553,6 +558,7 @@ Add B<--fullpath> to compare parent directories to
553558
the regex.
554559
Do not include file path separators at the beginning
555560
or end of the regex.
561+
This switch may be repeated.
556562

557563
=item B<--match-f=REGEX>
558564

@@ -569,6 +575,7 @@ in the regex instead of just the basename.
569575
Count all files except those whose basenames match the Perl regex.
570576
Add B<--fullpath> to include parent directories
571577
in the regex instead of just the basename.
578+
This switch may be repeated.
572579

573580
=item B<--skip-archive=REGEX>
574581

@@ -851,7 +858,7 @@ sloccount(1)
851858
=head1 AUTHORS
852859

853860
The cloc program was written by Al Danial <al.danial@gmail.com> and
854-
is Copyright (C) 2006-2022 <al.danial@gmail.com>.
861+
is Copyright (C) 2006-2023 <al.danial@gmail.com>.
855862

856863
The manual page was originally written by Jari Aalto <jari.aalto@cante.net>.
857864

cloc

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# <http://www.gnu.org/licenses/gpl.txt>.
3030
#
3131
# 1}}}
32-
my $VERSION = "1.97"; # odd number == beta; even number == stable
32+
my $VERSION = "1.98"; # odd number == beta; even number == stable
3333
my $URL = "github.com/AlDanial/cloc"; # 'https://' pushes header too wide
3434
require 5.10.0;
3535
# use modules {{{1
@@ -390,7 +390,8 @@ Usage: $script [options] <file(s)/dir(s)/git hash(es)> | <set 1> <set 2> | <repo
390390
--original-dir [Only effective in combination with
391391
--strip-comments] Write the stripped files
392392
to the same directory as the original files.
393-
--only-count-files Only count files by language.
393+
--only-count-files Only count files by language. Blank, comment, and
394+
code counts will be zero.
394395
--read-binary-files Process binary files in addition to text files.
395396
This is usually a bad idea and should only be
396397
attempted with text files that have embedded

0 commit comments

Comments
 (0)