Skip to content

Count blank lines, code lines, and comment lines separately #9

@MatthewMckee4

Description

@MatthewMckee4

Summary

Extend line counting to distinguish between blank lines, comment lines, and code lines. This gives users a more detailed picture of their codebase composition.

Example

kount --detailed .
  Code  Blank  Comment  File
──────  ─────  ───────  ─────────────────
   120     20       12  src/walker.rs
    70     10        7  src/counter.rs
──────  ─────  ───────  ─────────────────
   190     30       19  total (2 files)

Considerations

  • Comment syntax varies by language — would need a comment definition table for common languages
  • Could start with a small set (Rust, Python, JS/TS, Go, C/C++, Java) and expand over time
  • --detailed flag enables this mode; default behavior remains total line count only

Acceptance criteria

  • --detailed flag enables blank/code/comment breakdown
  • Supports comment syntax for at least 5 common languages
  • Falls back to total lines only for unrecognized extensions
  • Works with all output formats (table, JSON, summary)

Metadata

Metadata

Assignees

No one assigned

    Labels

    countingRelated to line counting logicenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions