Skip to content

Add --total option to append a Total column to reports - #984

Open
pascal-lc wants to merge 1 commit into
AlDanial:masterfrom
pascal-lc:add-total-option
Open

Add --total option to append a Total column to reports#984
pascal-lc wants to merge 1 commit into
AlDanial:masterfrom
pascal-lc:add-total-option

Conversation

@pascal-lc

Copy link
Copy Markdown

The standard report shows only blank, comment, and code counts per
language; there is no per-language total of all three. Add a --total
option that appends a Total column (blank + comment + code) to every
language/file row and to the SUM row.

  • Applies to the text, Markdown, CSV, XML, YAML, and JSON reports.
  • Works with --by-file, --by-file-by-lang, --by-percent (the Total
    column shows the raw line count), --3, and --sum-reports.
  • combine_results tolerates the extra column, so --sum-reports works
    with reports generated with --total while remaining backward
    compatible with reports without the column.
  • Ignored with --diff and --sql (documented in --help).
  • Regression tests added in Unix/t/01_opts.t; full suite passes
    (678 language tests + 285 option tests).

The standard report only shows per-language blank, comment, and code
counts.  Add a --total option that appends a Total column (blank +
comment + code) to each language/file row and to the SUM row, across
the text, Markdown, CSV, XML, YAML, and JSON reports.

combine_results tolerates the extra column so --sum-reports still
works with reports generated with --total, while remaining backward
compatible with reports without it.

Regression tests added in Unix/t/01_opts.t.
@AlDanial

Copy link
Copy Markdown
Owner

It will be ~ 2 weeks before I can look at this.

@AlDanial

Copy link
Copy Markdown
Owner

I tested your code but am wondering what --total does that isn't already implemented with --fmt 2, --fmt 4, and --fmt 5. I will grant you that --total is easier to understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants