Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --no-hborder #476

Merged
merged 2 commits into from
Jun 10, 2024
Merged

Add --no-hborder #476

merged 2 commits into from
Jun 10, 2024

Conversation

arp242
Copy link
Contributor

@arp242 arp242 commented Jun 7, 2024

This removes the horizontal border lines, making for more compact output.

For example:

% scc --min-gen --no-complexity --no-cocomo --no-size
───────────────────────────────────────────────────────────────────────────────
Language                     Files       Lines     Blanks    Comments      Code
───────────────────────────────────────────────────────────────────────────────
Go                              10        1374        114         199      1061
License                          1          20          4           0        16
Markdown                         1          94         23           0        71
YAML                             1           1          0           0         1
───────────────────────────────────────────────────────────────────────────────
Total                           13        1489        141         199      1149
───────────────────────────────────────────────────────────────────────────────

% scc --min-gen --no-complexity --no-cocomo --no-size --no-hborder
Language                     Files       Lines     Blanks    Comments      Code
Go                              10        1374        114         199      1061
License                          1          20          4           0        16
Markdown                         1          94         23           0        71
YAML                             1           1          0           0         1
Total                           13        1489        141         199      1149

Removing those four lines makes a relatively large difference.

I named it "hborder" so that it won't be problematic with any potential future vertical borders. Maybe at some point an option for something like this will be added:

Language │ Files │  Lines │ Blanks │ Comments  │ Code
─────────┼───────┼────────┼────────┼───────────┼─────
Go       │    10 │   1374 │    114 │      199  │ 1061
License  │     1 │     20 │      4 │        0  │   16
Markdown │     1 │     94 │     23 │        0  │   71
YAML     │     1 │      1 │      0 │        0  │    1
─────────┼───────┼────────┼────────┼───────────┼─────
Total    │    13 │   1489 │    141 │      199  │ 1149

Or something along those lines.

This removes the horizontal border lines, making for more compact
output.

For example:

	% scc --min-gen --no-complexity --no-cocomo --no-size
	───────────────────────────────────────────────────────────────────────────────
	Language                     Files       Lines     Blanks    Comments      Code
	───────────────────────────────────────────────────────────────────────────────
	Go                              10        1374        114         199      1061
	License                          1          20          4           0        16
	Markdown                         1          94         23           0        71
	YAML                             1           1          0           0         1
	───────────────────────────────────────────────────────────────────────────────
	Total                           13        1489        141         199      1149
	───────────────────────────────────────────────────────────────────────────────

	% scc --min-gen --no-complexity --no-cocomo --no-size --no-hborder
	Language                     Files       Lines     Blanks    Comments      Code
	Go                              10        1374        114         199      1061
	License                          1          20          4           0        16
	Markdown                         1          94         23           0        71
	YAML                             1           1          0           0         1
	Total                           13        1489        141         199      1149

Removing those four lines makes a relatively large difference.

I named it "hborder" so that it won't be problematic with any potential
future vertical borders. Maybe at some point an option for something
like this will be added:

	Language │ Files │  Lines │ Blanks │ Comments  │ Code
	─────────┼───────┼────────┼────────┼───────────┼─────
	Go       │    10 │   1374 │    114 │      199  │ 1061
	License  │     1 │     20 │      4 │        0  │   16
	Markdown │     1 │     94 │     23 │        0  │   71
	YAML     │     1 │      1 │      0 │        0  │    1
	─────────┼───────┼────────┼────────┼───────────┼─────
	Total    │    13 │   1489 │    141 │      199  │ 1149

Or something along those lines.
@arp242
Copy link
Contributor Author

arp242 commented Jun 7, 2024

This also has a second somewhat related commit: it would always print an empty line at the end:

% scc
[..]
───────────────────────────────────────────────────────────────────────────────
Processed 40917 bytes, 0.041 megabytes (SI)
───────────────────────────────────────────────────────────────────────────────

%

I don't know if that's intentional? Seemed rather unexpected to me.

@boyter boyter merged commit b630cad into boyter:master Jun 10, 2024
4 of 5 checks passed
@boyter
Copy link
Owner

boyter commented Jun 10, 2024

I like this. Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: DONE
Development

Successfully merging this pull request may close these issues.

2 participants