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

Replace Python script w/ Cargo script. #109

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alilleybrinker
Copy link
Owner

Fixes #102.

This replaces the Python script for updating data
for the tracked languages and regenerating the
README with a new Cargo script, which lets us use
Rust code instead of Python!

@alilleybrinker alilleybrinker added the type: enhancement Type: An enhancement to the project's code. label Dec 27, 2023
@alilleybrinker alilleybrinker self-assigned this Dec 27, 2023
@alilleybrinker
Copy link
Owner Author

Quick design thing. Related to this, I'm thinking of the following:

  • Turning languages.json into languages.toml, so it's more human-writeable.
  • Moving the stars-caching thing into a file under a .data folder called stars.toml that just maps languages to stars data, along with an updated_on timestamp at the top to say when the file was last updated.
  • Updating the README to include a regeneration timestamp at the top.

So the workflow as a contributor would be:

  1. Add a language to languages.toml
  2. Running ./update.rs -u to update cached data for any langs on GitHub.
  3. Running ./update.rs -g to generate a new README.md file.

@alilleybrinker alilleybrinker force-pushed the feat/cargo-script branch 2 times, most recently from 2b45125 to 511d83c Compare December 27, 2023 02:21
Fixes #102.

This replaces the Python script for updating data
for the tracked languages and regenerating the
README with a new Cargo script, which lets us use
Rust code instead of Python!
@alilleybrinker
Copy link
Owner Author

In terms of commands, I'd like to replace the existing commands and rename the script, so it becomes:
./langs [add/remove/edit/update].

  • add would add a new language, sync with external API if necessary, update caches, and update the README
  • remove would remove an existing language, clear its data from the cache, and update the README
  • edit would edit an existing language, clear its data from the caches, and update the README
  • update would sync with external APIs, update the caches, and update the README

@alilleybrinker
Copy link
Owner Author

Also probably just have one cache file. Maybe consider even making it SQLite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Type: An enhancement to the project's code.
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Replace Python script with Rust script
1 participant