Skip to content

Rust implementation of "rescript format" #7603

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

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

Conversation

cknitt
Copy link
Member

@cknitt cknitt commented Jul 5, 2025

Do not forward the rescript format command to the legacy JS cli anymore, instead implement the functionality natively in Rust.

Mostly written by Gemini CLI. Would be good if someone with more Rust knowledge than me could review.

Copy link

pkg-pr-new bot commented Jul 5, 2025

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@7603

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@7603

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@7603

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@7603

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@7603

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@7603

commit: 9cbb429

Copy link
Collaborator

@nojaf nojaf left a comment

Choose a reason for hiding this comment

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

rewatch format --help

thread 'main' panicked at /Users/nojaf/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap_builder-4.5.31/src/builder/debug_asserts.rs:570:9:
Positional argument `[FOLDER]` *must* have `required(true)` or `last(true)` set because a prior positional argument (`[FILES]...`) has `num_args(1..)`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

There is something weird in the setup here, the help crashes.
Might be related to the files: Vec<string>, but I'm not sure.

@cknitt cknitt force-pushed the rescript-format-rust branch 8 times, most recently from 0e9bb0c to e276090 Compare July 16, 2025 19:36
@cknitt cknitt force-pushed the rescript-format-rust branch from e276090 to 1268640 Compare July 16, 2025 19:37
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