alejandra icon indicating copy to clipboard operation
alejandra copied to clipboard

Excluding formatting of code lines or blocks selectively

Open johnalotoski opened this issue 2 years ago • 2 comments

Feature request:

  • Occasionally there is a section of code in a nix file which I'd like to purposely exclude from formatting for various reasons
  • In these cases, the option of excluding code formatting on a single line basis (ex: comment exclusion identifier) or code block basis (between exclusion demarcation identifiers) would be a nice feature to have.
  • In these cases, whole file basis exclusion is not granular enough

Thanks for this great formatter!

johnalotoski avatar May 24 '22 13:05 johnalotoski

from black a spec could be

# fmt: on
# fmt: off

or branded (:smile:):

# ale: on
# ale: off

blaggacao avatar Jun 01 '22 16:06 blaggacao

this would also provide a way temporarily work around bugs while they are being fixed

adrian-gierakowski avatar Aug 28 '22 14:08 adrian-gierakowski