Skip to content

Allow exclusion from Q# formatting #1315

Open
@DmitryVasilevsky

Description

@DmitryVasilevsky

I expect that automatic formatting of Q# files will be done on the scale of the entire repo - in CI, during publishing, etc. Typically, it means that there's an action that formats the entire codebase. However it isn't always desirable to autoformat everything. There may be very small number of exceptions. For example, if the author needs to express specific structure in the code, some esoteric aligning or even a test of a compiler of whitespace handling.

In this case it is desirable to specifically exclude portion of the code from auto-formatting. Something like "auto-format all my Q# files except this code fragment". The granularity could be a code block or something similar. The directive could be similar to #pragma(DoNotAutoformat).

The alternative could be "not do anything". This would require user to carefully exclude certain file from autoformat in scripts and while saving. Given that the author of the code is typically not the person who runs scripts and saves files, it may require a lot of careful manual handling.

(Result of a discussion here: #1303)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions