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

Code Quality: Hide unnecessary languages from GitHub Linguist #1892

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Lamparter
Copy link
Contributor

@Lamparter Lamparter commented Jan 29, 2025

High score: 9 languages!
5 from main rounds, 4 from bonus round!

THWACK!!! CRITICAL HIT!!
High score: 5 languages hit
Bonus round! 4 points for a total of 9 points! Well done, play again!
@Lamparter
Copy link
Contributor Author

@slozier high score! Looks like the game gave me a bonus round as well.

@slozier
Copy link
Contributor

slozier commented Jan 29, 2025

I guess this is the sort of list I was trying to avoid. 😀

How many of these are caused by the stdlib lib folder? Wondering if marking that folder as linguist-vendored would be a better approach.

@Lamparter
Copy link
Contributor Author

How many of these are caused by the stdlib lib folder? Wondering if marking that folder as linguist-vendored would be a better approach.

Only batchfile is used in the stdlib, though it is also used in the tests..

Comment on lines +55 to +58
*.1 linguist-detectable=false
*.2 linguist-detectable=false
*.3 linguist-detectable=false
*.4 linguist-detectable=false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just the stupid design of Linguist - it detects all files with a numbered extension as being Roff.
When IronPython is bumped to later versions of Python it will need to be changed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but 1, 2 and 3 are coming from the standard library so excluding it would eliminate those (as well as the pck that we filtered before). I can live with having ps1, cmd, bat and c being picked up by Linguist as we actually some of those in the codebase. That only leaves 4 which would need to be filtered out. So how about something simple like:

src/core/IronPython.StdLib/lib/** linguist-vendored
eng/package/deb/* -linguist-detectable
*.html linguist-documentation

This would probably also end up giving better stats about the code we "own" (yes we do tweak the standard lib, but the changes are very limited).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/eng/package/deb also causes issues with this.
I think the recommendation I made in the comment below is the best solution.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I excluded eng/package/deb in my code snippet...

@Lamparter
Copy link
Contributor Author

@slozier another approach to this would to just do:

* linguist-detectable=false
*.cs linguist-detectable
*.py linguist-detectable

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

Successfully merging this pull request may close these issues.

2 participants