onefetch icon indicating copy to clipboard operation
onefetch copied to clipboard

.cls file extension not recognized

Open MaxBGreenberg opened this issue 1 year ago • 6 comments

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.

MaxBGreenberg avatar Jun 25 '23 04:06 MaxBGreenberg

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

spenserblack avatar Jun 25 '23 15:06 spenserblack

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:

spenserblack avatar Jun 26 '23 16:06 spenserblack

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?

MaxBGreenberg avatar Jun 29 '23 16:06 MaxBGreenberg

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 avatar Jun 29 '23 17:06 spenserblack

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

spenserblack avatar Jul 12 '23 18:07 spenserblack

FYI #1152

spenserblack avatar Aug 29 '23 19:08 spenserblack