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

[Request]: rustfmt #4934

Closed
7 tasks done
punowo opened this issue Jul 8, 2023 · 9 comments
Closed
7 tasks done

[Request]: rustfmt #4934

punowo opened this issue Jul 8, 2023 · 9 comments
Labels
package-request requesting new package

Comments

@punowo
Copy link

punowo commented Jul 8, 2023

Prerequisites

  • I have searched all issues/PRs to ensure it has not already been reported or fixed.

Criteria

  • Non-GUI tool
  • Reasonably well-known and widely used (e.g. if it's a GitHub project, it should have at least 500 stars and/or 150 forks)
  • English interface (or at least English documentation)
  • Latest stable version
  • Full version (i.e. not a trial version)
  • Fairly standard install (e.g. uses a version-specific download URL, no elaborate pre/post install scripts)

Name

rustfmt

Description

A tool for formatting Rust code according to style guidelines.

Homepage

https://rust-lang.github.io/rustfmt/?version=v1.6.0&search=

Download Link(s)

https://github.com/rust-lang/rustfmt/releases/tag/v1.6.0

Some Indication of Popularity/Repute

5.2K stars, this is the most used formatting tool for Rust.

@punowo punowo added the package-request requesting new package label Jul 8, 2023
@punowo
Copy link
Author

punowo commented Jul 8, 2023

I'm not sure of this statement but I feel like other packaged rust "distributions" already include rustfmt and clippy.

@rashil2000
Copy link
Member

I'm not sure of this statement but I feel like other packaged rust "distributions" already include rustfmt and clippy.

Yes, they do.

But we can still have the tool as a standalone package. Can you raise a PR for it?

@punowo
Copy link
Author

punowo commented Sep 3, 2023

I'm going to give it a try after I look at the contributing guide.

@punowo
Copy link
Author

punowo commented Sep 4, 2023

@rashil2000 Sorry, is there a guide or something ? I found https://github.com/ScoopInstaller/.github/blob/main/.github/CONTRIBUTING.md but I'm unsure how to go about it. Do I clone the whole repository and then add it as a custom local bucket to my scoop install, then make changes, commit to my fork and create the pull request ?

@rashil2000
Copy link
Member

rashil2000 commented Sep 4, 2023

You can just create a JSON file, write stuff into it, and test installation using scoop install <path-to-json-file>.

If everything goes fine, fork the repo and upload the JSON file into the "bucket" folder. Then create a PR.

@punowo
Copy link
Author

punowo commented Sep 7, 2023

I took a look at this and I'm encountering two problems.

  1. The name of the directory inside the archive depends on the version of rustfmt. So from github I can get rustfmt_windows-x86_64-msvc_v1.6.0.zip which contains rustfmt_windows-x86_64-msvc_v$1.6.0 which in turn contains the rustfmt binary and I'm not sure how to cd into that directory inside the scoop json schema.
  2. The rustfmt github repository only offers downloads for x86_64.

@rashil2000
Copy link
Member

  1. The name of the directory inside the archive depends on the version of rustfmt. So from github I can get rustfmt_windows-x86_64-msvc_v1.6.0.zip which contains rustfmt_windows-x86_64-msvc_v$1.6.0 which in turn contains the rustfmt binary and I'm not sure how to cd into that directory inside the scoop json schema.

There's a field called extract_dir in the JSON schema, you can use that to cd inside. See https://github.com/ScoopInstaller/Main/blob/master/bucket/z3.json for example.

  1. The rustfmt github repository only offers downloads for x86_64.

That's fine, we can include only that.

@punowo
Copy link
Author

punowo commented Sep 9, 2023

Thank you. I found the extract_dir but $version didn't work inside it's value so I thought maybe I was doing something wrong but now I see from your example how it's supposed to be done. It only works inside autoupdate

@punowo
Copy link
Author

punowo commented Sep 9, 2023

The rustfmt binary has the rust toolchain as a runtime dependency and installation from outside of rustup is on life-support from the looks of it so I don't see the use case of going ahead with this on scoop.
rust-lang/rustfmt#5906
rust-lang/rustfmt#5805 (comment)
Thank you for the help.

@punowo punowo closed this as completed Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package-request requesting new package
Projects
None yet
Development

No branches or pull requests

2 participants