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

Add Rust-code check to CI #1712

Open
palfrey opened this issue Apr 22, 2024 · 4 comments
Open

Add Rust-code check to CI #1712

palfrey opened this issue Apr 22, 2024 · 4 comments

Comments

@palfrey
Copy link
Collaborator

palfrey commented Apr 22, 2024

https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-repository-languages could be used to only allow projects that are at least N% Rust (with overrides for special cases)

@FQAlmeida
Copy link

Hi @palfrey, I was working on it and got to a point where it's working for Github repositories. But there are a few things I'd like to discuss:

  • What is the minimum percentage to add a repository?
    Most repositories have more than 90% Rust code in their codebase, but some don't have 70% or don't show the languages used, such as Servo. Depending on the percentage chosen, that's a lot of repositories to add to the override list (a second list has been created, so there's no overlapping of rules).

The image below shows the current distribution:
rust_codebase_percentage

  • What should the override rules be?
    In the case of Github stars, if the repository is in the Games or Emulator category, the star requirement drops to 40.
    It's still not clear to me how this could be done in the case of the percentage of code.

@palfrey
Copy link
Collaborator Author

palfrey commented Jun 2, 2024

At a gut level, I'd say 50%, mostly from a "if the project is Rust plus say JS for a frontend bit, that's ok" kinda thing. That looks like it drops ~1/8th of projects? Can you provide the list of what that would drop, just so I can sanity check and figure out if there's any obvious side cases which should be in the list but fail that?

It's still not clear to me how this could be done in the case of the percentage of code.

So https://github.com/rust-unofficial/awesome-rust/blob/main/src/main.rs#L28 is the code for overriding stars. The same thing could be done per-section if there's some areas that should have lower numbers. Could also add something like either of the sets in https://github.com/rust-unofficial/awesome-rust/blob/main/src/main.rs#L40 if it's individual repos that we just need to file under "it's fine, don't worry about this one" as well. We'll definitely need to do that for things like Gitlab, etc.

@FQAlmeida
Copy link

The list can be found at awesome-rust codebase rust percentage, the second tab has the entire list.

I got the chart wrong, this one is up to date.
awesome-rust-codebase-percentage

What should the override rules be?

Im talking about which rules should apply to https://github.com/FQAlmeida/awesome-rust/blob/3e97268655dac5ddd97979fa88386aa8ae026be1/src/main.rs#L45.

In https://github.com/FQAlmeida/awesome-rust/blob/3e97268655dac5ddd97979fa88386aa8ae026be1/src/main.rs#L90, I added all the failing repos for now.

We'll definitely need to do that for things like Gitlab, etc.

I didn't had a look at Gitlab's API, but, as long it have a similar endpoint, it should be simple.

I can open a PR if you would like.

@palfrey
Copy link
Collaborator Author

palfrey commented Oct 10, 2024

Hey, sorry for not replying to this sooner. I'm pro a PR, can have with Gitlab API as well if you really want, but it's usage is small enough that I'm fine without.

That list of overrides/failures is interesting. There's a bunch that I think either were Rust and have now been rewritten, or are from way back and just aren't Rust, and those we can drop. And then there's things like Ring that despite being a crate are almost 50% assembly, and a bunch of "this is actually Rust docs, but no/low Rust code" stuff and both of those we should keep.

Thanks for all your work here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants