-
Notifications
You must be signed in to change notification settings - Fork 70
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: scarb fmt
option to target a specific file.
#1534
Comments
Please I will love to work on this |
@ShantelPeters assigning you then :D Good luck! |
Thank you ser @maciektr i will get straight to work |
@maciektr is scarb fmt just a wrapper around cairo-format (like cairo-run) or is there a more complex logic to implement ? |
I'd say more complex. It's not a separate binary if that's what you mean, but Scarb built in. The implementation mainly lies here https://github.com/software-mansion/scarb/blob/main/scarb/src/ops/fmt.rs and is mainly based on |
Hi @ShantelPeters ! |
@maciektr I might take this later in the week unless you guys have some spare time ;p |
Finally took the time to implement this. Let me know how it is. |
Allows formatting a single file. Useful for integration with external tools. Closes #1534
Problem
Describe the Feature Request
Following starkware-libs/cairo#4134, for integration with external tools, cairo-format should have an option to take a specific file as a target, instead of formatting the entire package all at once.
For reference, with the old CairoZero cairo-format, we could do cairo-format ${target} which would format one specific file.
Forge (foundry) supports forge fmt ${target} --check as well. This works great for integration with lint aggregators.
Describe Preferred Solution
Add an optional target argument, referring to the file to format. The command scarb fmt ${target} -e stdout should be valid. If a target is specfied, the name of the file being formatted is not part of the stdout.
cairo-format actually supports this; but scarb fmt doesn't: see below
However it's not shown when doing
scarb fmt --help
Delegating this to the scarb team
Proposed Solution
Either modify scarb fmt to accept a specific file path OR expose cairo-format through scarb (like scarb cairo-run does)
Notes
No response
The text was updated successfully, but these errors were encountered: