Skip to content

[Feature Request] Skip individual expressionΒ #544

@akriegman

Description

@akriegman

It would be nice if there was a way to skip a single expression. It gets a bit cumbersome to write #! format: off and #! format: on before and after everything I want skipped. It would be cool if we could do #=! format: skip =# and the next expression would get skipped. For example:

# Here the entire begin block gets skipped
a = #=! format: skip =# begin
  silly   =
    formatting
      end

# Here the second vector gets formatted normally
b = #=! format: skip =# [1,2,3,4] + [5, 6, 7, 8]

Not sure what the ideal syntax would be. Maybe #= format: skip =# would be better, but the ! would be more consistent with the existing syntax. It might be nice if we have the option to make it more compact too, like #=format:skip=#.

I'm taking inspiration here from rustfmt. It lets you skip a subexpression like this with #[rustfmt::skip], but only if you turn on a special feature in the nightly compiler, lol.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions