diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 51ca7dded..52af69b34 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -17,11 +17,11 @@ Some tooling is present as bash scripts in `bin/`. A lot more is present in `rust-tooling/`, which should be preferred for anything non-trivial. -There is also a [`justfile`](https://github.com/casey/just) +There is also a [`mise`](https://mise.jdx.dev/) configuration with a couple useful commands to interact with the repo. Feel free to extend it. -If you want to run CI tests locally, `just test` will get you quite far. +If you want to run CI tests locally, `mise run test` will get you quite far. ## Excluding tests and adding custom ones @@ -41,7 +41,7 @@ Please familiarize yourself with the [Exercism documentation about practice exer [Exercism documentation about practice exercises]: https://exercism.org/docs/building/tracks/practice-exercises -Run `just add-exercise` and you'll be prompted for the minimal +Run `mise run add-exercise` and you'll be prompted for the minimal information required to generate the exercise stub for you. After that, jump in the generated exercise and fill in any placeholders you find. This includes most notably: @@ -88,7 +88,7 @@ This includes their test suite and user-facing documentation. Before proposing changes here, check if they should be made in `problem-specifications` instead. -Run `just update-exercise` to update an exercise. +Run `mise run update-exercise` to update an exercise. This outsources most work to `configlet sync --update` and runs the test generator again. diff --git a/justfile b/justfile deleted file mode 100644 index fe7bfcf38..000000000 --- a/justfile +++ /dev/null @@ -1,30 +0,0 @@ -_default: - just --list --unsorted - -# configlet (downloads if necessary) -@configlet *args="": - [ -f ./bin/configlet ] || ./bin/fetch-configlet - ./bin/configlet {{ args }} - -# generate a new uuid straight to your clipboard -uuid: - just configlet uuid | tr -d '[:space:]' | wl-copy - -# simulate CI locally (WIP) -test: - just configlet lint - ./bin/lint_markdown.sh - shellcheck bin/*.sh - ./bin/check_exercises.sh - CLIPPY=true ./bin/check_exercises.sh - cd rust-tooling && cargo test - ./bin/format_exercises.sh ; git diff --exit-code - -symlink-problem-specifications: - @ [ -L problem-specifications ] || ./bin/symlink_problem_specifications.sh - -add-exercise *args="": symlink-problem-specifications - cd rust-tooling/generate; cargo run --quiet --release -- add {{ args }} - -update-exercise *args="": symlink-problem-specifications - cd rust-tooling/generate; cargo run --quiet --release -- update {{ args }} diff --git a/mise.toml b/mise.toml new file mode 100644 index 000000000..0bb095597 --- /dev/null +++ b/mise.toml @@ -0,0 +1,34 @@ +[tasks.test] +description = "simulate CI locally (WIP)" +run = [ + "mise run configlet lint", + "bin/lint_markdown.sh", + "shellcheck bin/*.sh", + "bin/check_exercises.sh", + "CLIPPY=true bin/check_exercises.sh", + "cd rust-tooling && cargo test", + "bin/format_exercises.sh ; git diff --exit-code", +] + +[tasks.add-exercise] +depends = "symlink-problem-specifications" +run = "cd rust-tooling/generate; cargo run --quiet --release -- add" + +[tasks.update-exercise] +depends = "symlink-problem-specifications" +run = "cd rust-tooling/generate; cargo run --quiet --release -- update" + +[tasks.configlet] +depends = "fetch-configlet" +quiet = true +run = "bin/configlet" + +[tasks.fetch-configlet] +hide = true +silent = true +run = "[ -f bin/configlet ] || bin/fetch-configlet" + +[tasks.symlink-problem-specifications] +hide = true +silent = true +run = "[ -L problem-specifications ] || bin/symlink_problem_specifications.sh" diff --git a/rust-tooling/generate/src/main.rs b/rust-tooling/generate/src/main.rs index 7dc98abe4..984223e3b 100644 --- a/rust-tooling/generate/src/main.rs +++ b/rust-tooling/generate/src/main.rs @@ -71,8 +71,9 @@ fn update_exercise(args: UpdateArgs) -> Result<()> { } fn make_configlet_generate_what_it_can(slug: &str) -> Result<()> { - let status = std::process::Command::new("just") + let status = std::process::Command::new("mise") .args([ + "run", "configlet", "sync", "--update",