o2sh / onefetch

Command-line Git information tool
https://onefetch.dev
MIT License
10.33k stars 277 forks source link

.cls file extension not recognized #1095

Open MaxBGreenberg opened 1 year ago

MaxBGreenberg commented 1 year ago

Summary 💡

When I try to run onefetch on a repository for a LaTeX document class, file extension .cls, it returns an error, Error: Could not find any source code in this repository. It appears that this file extension is not recognized.

Motivation 🔦

Working on some custom XeLaTeX document classes which I'm tracking with git.

spenserblack commented 1 year ago

Note: https://github.com/XAMPPRocky/tokei/blob/958e1d03ef57936b9565465b05babc222cb54e34/languages.json#L1570

spenserblack commented 1 year ago

I don't know if it will be possible for us to handle this out-of-the-box. Last I checked, tokei (our language analysis tool) is designed in a way that languages cannot share the same file extensions. See https://github.com/XAMPPRocky/tokei/issues/520 for example.

This will need to be resolved upstream with tokei (and tokei will need a new release to crates.io :sweat_smile:).

You might be able to argue your case by showing some data. For example, with a quick search, 25k TeX files use the .cls extension, and less than 7k VBA files use .cls as the extension. IMO if an extension can only belong to one language, it should at least be the most common language :laughing:

MaxBGreenberg commented 1 year ago

Having looked through their issues, it looks like they're working towards adding a feature where you can remap a file extension to the .tokeirc configuration file. Does .tokeirc affect the behaviour of onefetch?

spenserblack commented 1 year ago

Since .tokeignore is used without us needing to explicitly enable/use it, I assume that .tokeirc would similarly be read without us needing to do anything besides bump the tokei version.

spenserblack commented 1 year ago

Just stumbled on https://github.com/XAMPPRocky/tokei/issues/1014. Linking.

spenserblack commented 1 year ago

FYI #1152