Skip to content

Ability to skip formatting for specific sections of code #75

Open
@ewels

Description

@ewels

Automatic code formatters are amazing, but sometimes you find edge cases where they get in the way. In these situations, it's nice to have a get-out-of-jail-free-I-know-what-I'm-doing-leave-me-alone option.

Other code formatters such as Black and Prettier have this option.

My suggestion would be to follow Black and have the following options:

  • // fmt: skip - don't format just this line
  • // fmt: off - turn formatting off from here onwards (can be used to skip an entire file)
  • // fmt: on - turn formatting back on again after a // fmt: off for a code block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    formattingRelated to automatic code formatting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions