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

Mention that formatting can be skipped per line using [cairofmt::skip] #1628

Open
0xNeshi opened this issue Oct 3, 2024 · 0 comments
Open

Comments

@0xNeshi
Copy link

0xNeshi commented Oct 3, 2024

Problem

Nowhere is it mentioned that specific lines can be marked with #[cairofmt::skip] to skip formatting them when running scarb fmt. This is a very useful feature that should be included in the docs (I had to dig through the Cairo language repo to find (the issue](starkware-libs/cairo#4159)).

Proposed Solution

Update "Formatting" page to include a mention of this feature:
https://docs.swmansion.com/scarb/docs/guides/formatting.html

Notes

This is a very useful thing to know, especially when needing to custom format arrays for clarity, e.g. to represent some table like:

    #[cairofmt::skip]
    let table = array![
        "oxo",
        "xox",
        "oxo",
    ];

This feature was implemented with starkware-libs/cairo#4159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

No branches or pull requests

1 participant