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

Enforce .bicep extension on Bicep build command #6609

Merged
merged 1 commit into from
Apr 22, 2022

Conversation

jeskew
Copy link
Contributor

@jeskew jeskew commented Apr 21, 2022

Fixes #1369
Fixes #5091

This PR allows bicep build to exit early with a meaningful error message when a non-bicep file is provided as the command's entry point. It does so by enforcing that bicep files use the .bicep extension (per the discussions in #5091 and in #1369 (comment)) by adding a new AuxiliaryTextFile subtype of ISourceFile to use for any file that is not a JSON ARM template or file with the .bicep extension. This source file type has a corresponding empty semantic model.

This is a breaking change, and it might make sense to bundle this with other breaking changes in a release with a meaningful version number bump. I did have to modify a number of tests that were creating bicep files without the correct extension, and I suspect many users who are synthesizing bicep files and then invoking the compiler may need to do the same.

Contributing a feature

  • I have opened a new issue for the proposal, or commented on an existing one, and ensured that the Bicep maintainers are good with the design of the feature being implemented
  • I have included "Fixes #{issue_number}" in the PR description, so GitHub can link to the issue and close it when the PR is merged
  • I have appropriate test coverage of my new feature

@jeskew jeskew force-pushed the jeskew/enforce-bicep-extension branch from 9a16d21 to b63949a Compare April 22, 2022 15:43
Copy link
Contributor

@shenglol shenglol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@jeskew jeskew merged commit 5f1ce6e into main Apr 22, 2022
@jeskew jeskew deleted the jeskew/enforce-bicep-extension branch April 22, 2022 18:07
@jeskew jeskew changed the title Enforce .bicep extension on Bicep files Enforce .bicep extension on Bicep build command Apr 22, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants