-
Notifications
You must be signed in to change notification settings - Fork 730
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
bicep build produces arm templates with LF line endings on Windows #14383
Comments
How does this issue impact your workflow? This seems to be an unintentional change on our end |
Thanks for taking a look! This impacts our workflow because we check in ARM templates into our git repo and perform a bicep build as part of CI. We then check if there are any changes to the bicep output by utilizing "git status". So, not having control over the line endings results in errant diffs. It also is a bit weird if we try to normalize the line endings in our repo because these are explicitly generated with LF. |
@josoklas This was actually a by design change we made to make sure we produce consistent line endings across all platforms. Since this is a one-time change, it shouldn't affect your workflow in the future. We'll add tests to ensure Bicep produces consistent line endings going forward. |
Currently, Bicep generates inconsistent newlines depending on whether the template is built using the Build command (and with or without the `--stdout` flag) or through the VS Code extension. This PR updates the emission code to consistently use `\n` for newlines. This change should prevent issues like #14383 in the future. ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/14581)
Bicep version
This reproduces starting with bicep CLI version 0.25.3. The previous version 0.24.24 outputs CRLF endings.
Describe the bug
On Windows, starting with bicep 0.25.3 the arm templates output by "bicep build" have LF line endings. Previously the behavior was to use CRLF on Windows. Ideally this would be configurable.
To Reproduce
Create a file test.bicep with the following content:
Run
bicep build test.bicep
with both versions 0.24.24 and 0.25.3.The test.json produced by 0.24.24 will have CRLF line endings.
The test.json produced by 0.25.3 will have LF line endings.
Additional context
The text was updated successfully, but these errors were encountered: