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

Truncates list of (supported) languages in my repo #863

Closed
1 task done
BartMassey opened this issue Nov 16, 2022 · 2 comments
Closed
1 task done

Truncates list of (supported) languages in my repo #863

BartMassey opened this issue Nov 16, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@BartMassey
Copy link

Duplicates

  • I have searched the existing issues

Current behavior 😯

Running onefetch 2.13.2 in the root directory for http://github.com/BartMassey/ttt-bench yields the following:

              ___       ___        ___   Bart Massey ~ git version 2.38.1
             ####      ####       ####   --------------------------------
            ####      ####       ####    Project: ttt-bench (1 tag)
      _____####______####___    ####     HEAD: 3a52440 (master, origin/master, refs/replace/e902c81a301ad953da92a42eec03e82eb432f795)
     #######################   ####      Version: v1.0
    #######################   ####       Created: 10 years ago
        ####      ####       ####        Languages:                           
       ####      ####       ####                    ● Shell (20.1 %) ● Objective-C (15.9 %) 
  ____####______####____   ####                     ● Haskell (14.3 %) ● Erlang (8.8 %) 
 #######################  ####                      ● Go (7.4 %) ● PHP (6.8 %) 
#######################  ___                        ● Other (26.8 %) 
   ####      ####       ####             Authors: 74% Bart Massey 90
  ####      ####       ####                       20% Bart Massey 24
 ####      ####       ####                        7% Matthew Slocum 8
                                         Last change: 4 months ago
                                         Repo: ssh://github.com/BartMassey/ttt-bench
                                         Commits: 122
                                         Lines of code: 1446
                                         Size: 76.55 KiB (94 files)
                                         License: MIT

Some easy languages, like Python, are missing from the description.

A fuller description of the repo's content's is given by tokei.

===============================================================================
 Language            Files        Lines         Code     Comments       Blanks
===============================================================================
 C                       3          136           76           49           11
 Cabal                   3          219           45          105           69
 COBOL                   4          170          134           10           26
 Erlang                  5          223          127           54           42
 Go                      3          156          107           38           11
 Haskell                12          381          207          117           57
 Java                    3          144           80           49           15
 JavaScript              3          140           76           58            6
 Makefile                2           43           21           10           12
 Markdown                1          199            0          149           50
 Objective-C             6          248          230            0           18
 PHP                     3          158           98           48           12
 Python                  3          110           63           38            9
 Shell                  21          433          290           91           52
 Plain Text              1           17            0           17            0
 TOML                    1           19           16            0            3
-------------------------------------------------------------------------------
 Rust                    4          137           92           36            9

I don't know if the language list is just being sorted and truncated, or if something else is up. Would be nice to have all the supported programming languages listed, at least as a command-line option.

In addition, both tokei and onefetch misidentify GNU Octave code as Objective-C. tokei has other misidentifications that are irrelevant here.

Expected behavior 🤔

Languages are listed correctly and completely.

Steps to reproduce 🕹

  1. Clone http://github.com/BartMassey/ttt-bench
  2. Run onefetch there.
@BartMassey BartMassey added the bug Something isn't working label Nov 16, 2022
@spenserblack
Copy link
Collaborator

Yes, we only show the top 6 languages at most, with the rest being collected in "other".

if self.languages_with_percentage.len() > 6 {

I suppose we could make this a CLI arg to increase/decrease the limit. IMO there should always be some upper limit. For example, if the full language list was shown, then running onefetch in the github/linguist repo would print so many languages that you probably wouldn't be able to see anything else without scrolling 😆

Additionally, if you were expecting languages like TOML or Markdown to be shown, you'll need to use the -T/--type option.

@spenserblack spenserblack added enhancement New feature or request good first issue Good for newcomers and removed bug Something isn't working labels Nov 17, 2022
@o2sh o2sh self-assigned this Nov 19, 2022
@o2sh
Copy link
Owner

o2sh commented Nov 19, 2022

As requested, 8159b34 adds a new CLI flag:

--number-of-languages <NUM>
    Maximum NUM of languages to be shown

    [default: 6]

How to use:

image

@o2sh o2sh closed this as completed Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants