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.
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.