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

Badge: Filtering by C++/C++ Header lines not working #268

Closed
CramBL opened this issue Nov 26, 2023 · 1 comment
Closed

Badge: Filtering by C++/C++ Header lines not working #268

CramBL opened this issue Nov 26, 2023 · 1 comment

Comments

@CramBL
Copy link

CramBL commented Nov 26, 2023

Hi, counting C++ lines of code seems to be broken (for generating badges).

I use the popular fmtlib as the first example, which used .h for C++ header files (not supported in your languages.json) and uses .cc for C++ source files which IS supported in languages.json.

Second example is identical but uses glaze as the repo, which uses .hpp and .cpp for header and source files.

1. Example fmtlib (.h/.cc)

At first it appears to work:
![](https://tokei.rs/b1/github/fmtlib/fmt?type=Cpp,CppHeader)

But it doesn't, it appears that Cpp and CppHeader is not recognized so instead it falls back on detecting any languages.

When adding Cmake to the list:
![](https://tokei.rs/b1/github/fmtlib/fmt?type=Cpp,CppHeader,Cmake)

Now it's only 1.2k lines which is how many lines of Cmake there are in the repo.

Adding Go instead of Cmake puts the LoC at 0 as Go is recognized but there's no Go code in fmtlib.
![](https://tokei.rs/b1/github/fmtlib/fmt?type=Cpp,CppHeader,Go)

2. Example glaze (.hpp/.cpp)

Just ?type=Cpp,CppHeader
![](https://tokei.rs/b1/github/stephenberry/glaze?type=Cpp,CppHeader)

When adding Cmake to the list:
![](https://tokei.rs/b1/github/stephenberry/glaze?type=Cpp,CppHeader,Cmake)

Adding Go instead of Cmake
![](https://tokei.rs/b1/github/stephenberry/glaze?type=Cpp,CppHeader,Go)

@CramBL
Copy link
Author

CramBL commented Nov 26, 2023

Ok NVM I figured it out. Sorry for the noise.

I should encode the + in C++ as %2b and the spaces in C++ Header as %20 and then it works.

e.g.

![](https://tokei.rs/b1/github/stephenberry/glaze?type=Cpp,CppHeader)

Should be

![](https://tokei.rs/b1/github/stephenberry/glaze?type=C%2b%2b,C%2b%2b%20Header)

@CramBL CramBL closed this as completed Nov 26, 2023
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

No branches or pull requests

1 participant