Skip to content

Releases

v2.12 -- Security Update

Choose a tag to compare

@AlDanial AlDanial released this 13 Nov 05:14

This is a security release to address vulnerabilities in the handling of archive files (zip, tar, rpm, whl, gem, etc). A maliciously crafted archive file counted with cloc versions before this release can allow a remote code execution (RCE) attack.

All users are encouraged to update to this (or newer, when available) version.

New Languages and File Types:

  • AL (Business Central)
  • CUE
  • KDL
  • RON
  • Salam
  • Sema
  • Windows INF
  • Wren

Updates:

  • Add ability to count contents of .gem files.
  • New switch --total to show total column counts
  • Make --exclude-lang case insensitive to make it consistent with --include-lang
  • Recognize comment markers in single quoted QML strings
  • Add .scp as an extension for SQL stored procedures
  • Add .inc as an extension for Assembly

Bug fixes:

  • Secure handling of system calls to expand archive files.
  • Prevent regex timeouts in Swift.
  • Lower memory requirements when handling large XML/HTML and binary files.
  • Fix double-open on Windows when handling long paths.
  • Ensure an archive file is not a directory before attempting to extract it.

v2.10

Choose a tag to compare

@AlDanial AlDanial released this 04 Jul 19:26

New Languages and File Types:

  • beluga
  • C3
  • CodeQL
  • DAML
  • Quxlang
  • Rhai
  • Slang

Updates:

  • Skip contents of .venv directories.
  • Update wscript implementation (this is a filename, not an extension).
  • Updated BibTeX entry in the README.
  • Add support for --by-percent with --fmt formatting styles.
  • Support process substitution as input to --sum-reports (Unix-like operating systems only).

Bug fixes:

  • Fix handling of nested archive files (ie, a zip file inside a zip file).

v2.08

Choose a tag to compare

@AlDanial AlDanial released this 25 Jan 01:07

New Languages and File Types:

  • Activiti Business Process
  • Aria
  • AXAML
  • Bicep
  • BitBake
  • Clarity
  • Haskell Boot
  • Hibernate
  • JSP Tag Library Definition
  • Jasper Report XML/Template
  • Justfile
  • Liquibase
  • Magik
  • VSCode Workspace
  • Yarn

Updates:

  • Support input through process substitution on Unix-like operating systems (example: cloc <(git diff HEAD~1 HEAD --name-only) )
  • Improve Perl filter for POD (plain old documentation) handling.
  • --quiet now suppresses all informational output including error messages unless new switch --show-errors is also given.
  • Add .cts extension for TypeScript.
  • Renamed "VB for Applications" to "VBA"
  • Add .vbhtml extension for Visual Basic .NET
  • Renamed "Visual Basic Script" to "VBScript"
  • New switch --include-submodules (applies to --vcs=git) to include git submodule files in the count.
  • Revert back to manual build of Windows executable to avoid issues with symlinks seen with winget on executables created in Github Actions.

Bug fixes:

  • Handle empty files when using --git --diff.
  • Replace "Nothing to count." output with valid formatted output (JSON, etc) when no files are found to count.
  • Fix language definition parse errors with --read-lang-def, --force-lang-def (specifically, update matching regex to allow leading '.' as in .NET)

2.06

Choose a tag to compare

@AlDanial AlDanial released this 25 Jun 03:07

New Languages and File Types:

  • Cangjie
  • Elixir Script
  • Fortran 2003
  • Jsonnet
  • Nextflow
  • Nushell
  • Org Mode
  • Rego
  • UXML, USS (Unity)

Updates:

  • First attempt at using Github Actions to package a release including making a Windows executable that works with symlinks as used by winget
  • Add column headers for --show-lang and --show-ext output
  • Remove -> separator in --show-ext output
  • Remove leading blank space for --fmt output written to STDOUT
  • New switch --files-from as a synonym for --vcs
  • New switch --ksep/--thousands-delimiter to show a separator (default is a comma) between thousands in output counts
  • Change sequence of Python language filters so that docstrings are handled before #
  • Jenkinsfile now recognized as Groovy
  • Improve Windows/Unix path conflicts when using --git --diff in git-bash terminal
  • New switch --percent as a shortcut to `--by-percent t' to show percentage of totals in blank, comment, code columns
  • Add backtick and C++ style comment support for Svelte
  • Write results in multiple formats if multiple output format switches are given (for example --json --yaml --xml)

Bug fixes:

  • Remove file irregular"file2.md from the test suite as filenames with embedded double quotes are illegal in Windows and cause git pull problems (among other issues). This file is created dynamically during testing on non-Windows operating systems.
  • On Windows use zip format instead of tar for the 'git archive' command used when running with --git --diff
  • Remove duplicate "percent" entry in options handling
  • Support --exclude-lang in --diff mode
  • Fix --exclude-lang option when used in diff mode and when all files are additions or deletions
  • On Windows, remove temporary SCALAR(0x..) files created when using --fmt
  • Handle --by-file for JSON and YAML outputs with single and double quotes in file names

Update 2025-06-29: updated Windows executable to work better with Microsoft winget package manager

v2.04

Choose a tag to compare

@AlDanial AlDanial released this 31 Jan 16:21

New Languages and File Types:

  • Blueprint
  • Cadence
  • Civet
  • MoonBit
  • Pek
  • Pkl
  • SurrealQL

Updates:

  • Follow file renames when pairing files for --git --diff.
  • Arch Linux now has an AUR package for cloc.
  • New switch --ignore-regex to exclude files whose content matches a regex.
  • New switch --unique to identify unique files found.
  • Descriptive message at the end of a run if timeouts were encountered.
  • Slight performance improvement for --help by installing temporary modules later.

Bug fixes:

  • Better handling of Vuejs.
  • Better handling of Oracle PL/SQL.
  • Better error message on failure to count .src.rpm files if external tools are not installed.
  • Identify non-Glade .ui files as 'XML (Qt/GTK)' instead of 'Qt'.
  • Apply file filter rules with --no-recurse.

v2.02

Choose a tag to compare

@AlDanial AlDanial released this 02 Aug 22:51

New Languages and File Types:

  • Arturo
  • Glimmer JavaScript
  • Glimmer TypeScript
  • Luau
  • Modelica
  • Mojo
  • Nickel
  • Pawn
  • Processing
  • Templ
  • Yang

Updates:

  • Support SQL output with --diff
  • Support counting in git repository directories not owned by the user.
  • Eliminate the need to write temporary files when using --fmt.
  • Restore Dockerfile CI by fixing CPAN module setup that somehow stopped installing Parallel::ForkManager.
  • Improve handling of C comments in Go strings.

Bug fixes:

  • Improve --fmt output column alignments.
  • Handle --no-match when combined with --fullpath and --vcs.

Update 2024-08-25: Added a second Windows executable, cloc-2.02-winget.exe, which includes PR #850 to resolve the symlink problem described in #849. winget in particular uses symlinks when it installs applications.

v2.00

Choose a tag to compare

@AlDanial AlDanial released this 17 Feb 20:51

Note: There are no breaking changes between the 1.xx versions and this 2.00 release.

New Languages and File Types:

  • AnsProlog
  • AppleScript
  • ArkTs
  • Astro
  • Dafny
  • PlusCal
  • Prisma Schema
  • PRQL
  • Slint
  • Snakemake
  • TLA+
  • vyper

Updates:

  • Five new output formats with the new --fmt switch. Includes the often- requested addition of language name with --by-file counts.
  • *.o.d files are ignored
  • Added .j2 as a Jinja Template extension.
  • Added .mts as a TypeScript extension.
  • Added .iuml, .pu. .plantuml, .wsd as as PlantUML extensions.
  • Support Java block comments.
  • More consistent and accurate results from --diff.
  • Disambiguate .inc files among PHP, Pascal, and Fortran.
  • Ignore .gitattribute files.
  • Improved support for --exclude-list-file.
  • Fix JSON output generator which inserted a superfluous comma.
  • Recognize autogenerated C# SpecFlow files and ignore them with --no-autogen.
  • Support --list-file with --git-diff-*.
  • SQL output: add foreign key 'id' to table t referencing 'id' in the metadata table. The key value is Unix epoch seconds when cloc was invoked.
  • Support // comments in ReasonML.
  • Support directories in exclusion list files; all files below the named directories are excluded.
  • Support --exclude-file-list with --git --diff.
  • New switch, --strip-code, which attempts to only leave comments in the output file.

Bug fixes:

  • More accurate counts of XML with block comments.
  • More accurate counts of Java with block comments and comment markers within strings.
  • Fix improper handling of --match-d and --not-match-d.

v1.98

Choose a tag to compare

@AlDanial AlDanial released this 19 Aug 20:13

New Languages: Asymptote, CoCoA 5, Constraint Grammar, Hare, Jai, Linker Script, NetLogo, Typst

Updates:

  • Added .editorconfig as an INI extension.
  • Added .cppm, .ixx, .ccm, .cxxm, .c++m as C++ extensions.
  • Improved handling of trailing slash with --match-d
  • --exclude-list-file with --git now works as expected.
  • --not-match-d, --not-match-f can now be repeated.
  • --quiet mode is now enabled when STDOUT is not a terminal. This makes for cleaner output when piping to other programs.
  • New switch --include-content=regex to only count files whose content matches the given regex.
  • New switch --only-count-files to only count files. Counts for blank, comment, and code lines will be zero.

Bug fixes:

  • --no-recurse now works on Windows
  • Improved exclusion of autogenerated files on Windows.
  • Improved handling of path separators with git in PowerShell.
  • Resolve nondeterministic --diff output.
  • --hide-rate supports all output file types
  • Fixed --diff-list-file with unknown listed file.
  • Fixed parsing of verbose option in the cloc configuration file.

NOTE: The next release of cloc will be 2.00. Despite the major version number bump, there will be no breaking changes.

v1.96.1 (Windows executable only)

Choose a tag to compare

@AlDanial AlDanial released this 11 Jan 03:11

This release merely updates the Windows executable of cloc 1.96 to use the Win32::LongPath module per issue #704. The cloc source code itself is unchanged from 1.96. Here's the VirusTotal entry for this updated v1.96.1 executable.

If you use the source version of cloc, or if Win32::LongPath isn't important to you, use the regular 1.96 release bundle.

v1.96

Choose a tag to compare

@AlDanial AlDanial released this 19 Dec 00:48

Update 2023-01-10 for Windows users: minor release 1.96.1 has an updated executable that works better for Windows file paths longer than 255 characters.


New Languages: Cairo, Carbon, Circom, Containerfile, HolyC, kvlang, Nunjucks, OpenSCAD, P4, Pest, Pony, TEAL, WGSL

Updates: New switch --diff-list-files to run diff given two list files; handle comments embedded in OCaml strings; write empty JSON and XML structures if the inputs yield zero counts; support for long paths on Windows; better support for building and running Docker image on Windows; better output file names when running with --count-and-diff and --out; resolve internal file handle conflict when running --diff with --sdir or --categorized.