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

feat: Script to check for outdated tree-sitter grammars #12310

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

NikitaRevenco
Copy link
Contributor

@NikitaRevenco NikitaRevenco commented Dec 20, 2024

This is a new script for xtask which will check if each grammar is outdated or not. For github links it also provides a link to a diff.

retrieves a remote's latest commit with git ls-remote and compares it against the commit that we have.

Usage:

cargo xtask grammar-check

Screenshot:

image

@David-Else
Copy link
Contributor

How about if you are pinning to a release tag rather than using the latest commit?

@NikitaRevenco
Copy link
Contributor Author

How about if you are pinning to a release tag rather than using the latest commit?

From what I can see, helix itself doesn't use release tags to fetch grammars but just uses commit hashes

@NikitaRevenco
Copy link
Contributor Author

NikitaRevenco commented Dec 25, 2024

How about if you are pinning to a release tag rather than using the latest commit?

Also I want to mention about implementation of this script

The easiest data we can get for a remote repository is the latest couple of commits with git ls-remote

I tried looking for any git command which gives a bit more info but they dont seem to exist

In this PR i am obtaining the latest commit for each of the remotes

Anything more complex would be a lot more difficult and computationally expensive because we would either have to

  • clone each repository on local machine
  • make request to GitHub's API which is going to get into rate limiting very, very fast with no API key.l

There's like 200 repos to fetch

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