Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow exclusion from Q# formatting #1315

Open
DmitryVasilevsky opened this issue Mar 26, 2024 · 0 comments
Open

Allow exclusion from Q# formatting #1315

DmitryVasilevsky opened this issue Mar 26, 2024 · 0 comments
Labels
enhancement New feature or request needs triage

Comments

@DmitryVasilevsky
Copy link
Contributor

DmitryVasilevsky commented Mar 26, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage
Projects
None yet
Development

No branches or pull requests

1 participant