github-stats icon indicating copy to clipboard operation
github-stats copied to clipboard

EXCLUDE_LANG not excluding Jupyter Notebooks

Open anafvana opened this issue 2 years ago • 1 comments

Hey,

First of all, thanks for this great project!

I may have found a bug, though (or may just be failing to find the right way to do this and need help): I can't exclude Jupyter Notebooks in EXCLUDE_LANG.

I've tried excluding ".ipynb" and "Jupyter Notebooks", but neither worked.

I tested with other languages and they work just fine.

Is this something I am doing wrong, or is it a bug?

Thank you!

anafvana avatar Jul 10 '22 13:07 anafvana

Hi.

I believe the name of the secret is wrong. ☠️ Please try EXCLUDED_LANGS instead of EXCLUDE_LANG.

Attacktive avatar Aug 03 '22 02:08 Attacktive

Hi @anafvana,

Something similar happened to me. I wanted to skip the SVG language and it didn't work. The solution was to delete the old repository and create a new one. Indicating two or more languages worked.

Try: Settings > Secrets > Actions > Repository secrets

Name:

EXCLUDED_LANGS

Value:

tex,svg

danielcshn avatar Aug 09 '22 00:08 danielcshn

I believe the name of the secret is wrong. ☠️ Please try EXCLUDED_LANGS instead of EXCLUDE_LANG.

Oooops! That was me writing it wrong for the issue. 😬 So sorry! I'll correct my original post.

I did try what @danielcshn said, though, and made sure to type EXCLUDED_LANGS, but it still doesn't work for Jupyter Notebooks.

It is excluding other filetypes/languages just fine, though, so I suspect it's something specifically about ipynb

anafvana avatar Aug 12 '22 23:08 anafvana

I just got it working with Jupyter Notebook and jupyter notebook; the case doesn't seem to matter but without s.

Attacktive avatar Aug 14 '22 16:08 Attacktive

Hi all, thanks for the good discussion and problem-solving effort!

To provide some context for this issue: the names come directly from the GitHub API. I can't be 100% sure, but I believe that all of the possible names from the API are listed in their linguist repo languages.yml file (the link goes directly to the Jupyter Notebook entry in that file).

In github_stats.py here, we first compute the set of excluded languages (all normalized by lowercasing everything):

https://github.com/jstrieb/github-stats/blob/cb64ffd2fe87d7218e8abe936364d6d4f1013817/github_stats.py#L307

Then, we skip over languages in the exclude list when building up the output.

https://github.com/jstrieb/github-stats/blob/cb64ffd2fe87d7218e8abe936364d6d4f1013817/github_stats.py#L350-L354

Long story short, to exclude a language, use the exact name from the linguist/languages.yml and note that casing doesn't matter.

jstrieb avatar Aug 15 '22 04:08 jstrieb

Thank you so much to both of you for the help and clarifications! I got it to work with @Attacktive 's suggestion, and the list @jstrieb provided is a great resource!

anafvana avatar Aug 29 '22 00:08 anafvana