Skip to content

Releases: bkarak/jsloccount

jsloccount 2.1.0

Choose a tag to compare

@bkarak bkarak released this 11 Sep 11:58

Coverage grown to every language scc recognizes, and the first test suite.

Coverage

  • 458 file types, up from 192: all 366 languages listed by boyter/scc resolve
    to one of them, with comment markers and string quotes taken from its table
    rather than from memory
  • block comments spelled with one delimiter used twice are understood, which
    Smalltalk, CoffeeScript and Algol 68 need
  • PostScript is counted as text rather than treated as a binary blob, and
    .vhd reads as VHDL source rather than as a virtual disk image
  • Assembly and reStructuredText are recognized rather than left out

Tests

  • a test suite where there was none: around 9,300 checks over eight suites,
    run by "ant test", with no framework or dependency to fetch
  • every text type has a counting case of its own, every declared extension is
    checked against shadowing, and the command line, RFC 4180 escaping and the
    combined report are covered

Documentation

  • the README leads with what the tool does, and links the jar attached here
  • the supported-type list and the example output are generated from the tool,
    so neither can drift from it

Requires Java 21 or newer.

jsloccount 2.0.0

Choose a tag to compare

@bkarak bkarak released this 11 Sep 11:31

Modernized for Java 21, with the counting and reporting defects that
predated it fixed and coverage grown from 83 file types to 192.

Reports

  • the two CSV columns were crossed: -filestats.csv carried line counts
    under "File Count" and -sizestats.csv carried file counts under "Source
    Lines of Code"
  • fields are escaped per RFC 4180
  • binary resources no longer pad the size report with zeroes

Counting

  • multi-line block comments were counted as code beyond their opening line,
    and an inline /* */ counted its line as source twice
  • comment markers inside string literals opened comments, so a line holding
    "http://example.com" was reported as a comment
  • block comments nest where the language nests them: Rust, Swift, Scala,
    Kotlin, Dart, Haskell, OCaml, F#, Julia, and D's /+ +/
  • Fortran's marker matched nothing in any dialect; Haskell, Pascal and
    batch files were missing forms of theirs
  • Vim Script's " is read as a comment or a string by position and by
    whether it closes, rather than always as a comment
  • Lua long brackets are recognized at levels [[ through [===[

Interface

  • -o, -n, --stdout, -x, --include-hidden, -q, --list-languages, -h, -V
  • logging moved to standard error, so --stdout carries clean CSV
  • exit 0 on success, 1 for an unscannable directory, 2 for misuse

Coverage

  • 192 file types, text and binary, from 83
  • the most common unrecognized suffixes are reported after a scan

Documentation

  • the supported types are grouped into ten categories, derived from the enum
    so the list cannot drift, and printed the same way by --list-languages

Requires Java 21 or newer.