anuraghazra / github-readme-stats

:zap: Dynamically generated stats for your github readmes
https://github-readme-stats.vercel.app
MIT License
68.32k stars 22.39k forks source link

Add option to include forks #3109

Open spacey-sooty opened 1 year ago

spacey-sooty commented 1 year ago

Is your feature request related to a problem? Please describe.

I program in group robotics a lot using C++ and would like the C++ to show up on my most used languages as it a language I use a lot.

Describe the solution you'd like

There should be an option to enable showing forks with your most used languages.

Describe alternatives you've considered

No response

Additional context

No response

qwerty541 commented 1 year ago

@spacey-sooty Thanks for your feature request! I think that having an ability to include forks data into top languages card would be great since a lot of programmers works mostly in someone others repositories. In this way, the top languages card would show more accurate data about the use of languages. I see that we already have a draft pull request https://github.com/anuraghazra/github-readme-stats/pull/2611 with implementation of this feature.

@rickstaa What do you think about these feature? If you are up to approve it i can find a time to reanimate this pull request.

spacey-sooty commented 1 year ago

Yeah I 100% agree with that assesment I do a huge amount of group programming work which means lots of my code is in forks and I believe a lot of other programmers share that experience. Having that pull request finished would be great it looks like it perfectly adresses what I need. Thank you for your help and support!

rickstaa commented 1 year ago

@spacey-sooty Thanks for your feature request! I think that having an ability to include forks data into top languages card would be great since a lot of programmers works mostly in someone others repositories. In this way, the top languages card would show more accurate data about the use of languages. I see that we already have a draft pull request #2611 with implementation of this feature.

@rickstaa What do you think about these feature? If you are up to approve it i can find a time to reanimate this pull request.

@qwerty541 and @spacey-sooty At present, including forks in the language calculation is not feasible due to limitations in GraphQL. You can find more details in this discussion. Including forks and organization repositories would likely lead to less accurate language results.

To advocate for a resolution to these limitations, you can show your support by participating in the discussion on GitHub's Community Discussions platform at https://github.com/orgs/community/discussions/18230. Let's keep this issue open as a reference 👍🏻.

spacey-sooty commented 1 year ago

@rickstaa thank you for explaining that I hope that some of those issues can be adressed by github!

qwerty541 commented 1 year ago

@spacey-sooty Thanks for your feature request! I think that having an ability to include forks data into top languages card would be great since a lot of programmers works mostly in someone others repositories. In this way, the top languages card would show more accurate data about the use of languages. I see that we already have a draft pull request #2611 with implementation of this feature. @rickstaa What do you think about these feature? If you are up to approve it i can find a time to reanimate this pull request.

@qwerty541 and @spacey-sooty At present, including forks in the language calculation is not feasible due to limitations in GraphQL. You can find more details in this discussion. Including forks and organization repositories would likely lead to less accurate language results.

To advocate for a resolution to these limitations, you can show your support by participating in the discussion on GitHub's Community Discussions platform at https://github.com/orgs/community/discussions/18230. Let's keep this issue open as a reference 👍🏻.

@rickstaa What do you think about releasing this feature under environment variable to not increase load on public instance by fetching additional repositories data. Users will be allowed to use that only on their own instances.

Also i disagree that including forks and organizations repositories would lead to less accurate language results. For example in my own case, i contribute a lot in github-readme-stats project and use Javascript language a lot, but my languages card shows only 6% usage of it because i mostly do not use Javascript in my own repositories. Is that behavior correct? I do not think so. Perhaps in each specific case the situation can be different and this is a reason why that feature should be opt-in.

rickstaa commented 1 year ago

@rickstaa What do you think about releasing this feature under environment variable to not increase load on public instance by fetching additional repositories data. Users will be allowed to use that only on their own instances.

@qwerty541, I'm in favour of incorporating it as an environment variable and making it accessible within the GitHub action. However, it's crucial to emphasize that when including forks and organizations, the accuracy of the language data might be compromised.

@rickstaa, what are your thoughts on introducing this feature through an environment variable? This approach would prevent additional strain on the public instance by avoiding the need to fetch data from additional repositories. Users would be granted the privilege to use this feature exclusively on their own instances.

It's essential to remember that we currently lack a mechanism to pinpoint the exact code contributions made by individuals within a repository or fork. When we include forks, it aggregates all languages used in that repository, encompassing code written by various contributors. Consequently, this exacerbates the inaccuracies in our language detection results, which are already a challenge.

For repositories under your ownership, there's a higher likelihood that you authored the code. Regrettably, at present, there's no effective method to exclusively tally a user's contributions (refer to https://github.com/orgs/community/discussions/18230).