-
Notifications
You must be signed in to change notification settings - Fork 747
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 lint command #10819
Bicep lint command #10819
Conversation
@microsoft-github-policy-service agree |
|
Options: | ||
--ignore-warnings Exit code will only consider errors. Warnings will be ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed this today - feedback:
- The behavior for
bicep lint
should be consistent withbicep build
by default - e.g. warnings should not cause a failure. So that would necessitate inverting the flag (e.g.--warn-as-error
instead), and also supporting this for thebicep build
command. - If it simplifies things, we can merge this PR without the implementation of
--warn-as-error
, and leave that to be implemented later.
@johan-lindqvist sorry for the long delay responding to this PR. This is great functionality to have. I've discussed this with the team and have shared the feedback in a comment. Since it's been open for such a long time, I'm happy for you to make the suggested changes yourself, but would also be happy to make them on your behalf - let me know which you'd prefer. |
No worries 😄, I won't have time to work on this for two weeks or so. I'm fine with either way, if you have time and want to finish it you're more than welcome to! Otherwise I will fix the feedback once I have some free time in a few weeks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Contributing a Pull Request If you haven't already, read the full [contribution guide](https://github.com/Azure/bicep/blob/main/CONTRIBUTING.md). The guide may have changed since the last time you read it, so please double-check. Once you are done and ready to submit your PR, run through the relevant checklist below. ## Contributing a feature * [x] 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 * [x] 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 Fixes #2811 Added new command `lint` that will return an error exit code when there are any warnings or errors when building the bicep files. The command has a flag `--ignore-warnings` to only react on errors, not sure if this is needed though since you could use the `build` command instead. I also added tests, copied and refactored from `build` command tests, I could use some feedback if the tests cover enough or there are some missing tests that should be added (that's why I didn't check the test checkbox above). ## Checklist/discussion points - [ ] Do we want the `--ignore-warnings` flag? Does it serve a purpose? - [ ] Are there any more tests needed? - [ ] #2811 describes different exit codes depending on warnings/errors, is this wanted? - [ ] Are there any additional flags that are needed for the command? ###### Microsoft Reviewers: [Open in CodeFlow](https://portal.fabricbot.ms/api/codeflow?pullrequest=https://github.com/Azure/bicep/pull/10819) --------- Co-authored-by: Anthony Martin <[email protected]>
Contributing a Pull Request
If you haven't already, read the full contribution guide. The guide may have changed since the last time you read it, so please double-check. Once you are done and ready to submit your PR, run through the relevant checklist below.
Contributing a feature
Fixes #2811
Added new command
lint
that will return an error exit code when there are any warnings or errors when building the bicep files. The command has a flag--ignore-warnings
to only react on errors, not sure if this is needed though since you could use thebuild
command instead.I also added tests, copied and refactored from
build
command tests, I could use some feedback if the tests cover enough or there are some missing tests that should be added (that's why I didn't check the test checkbox above).Checklist/discussion points
--ignore-warnings
flag? Does it serve a purpose?Microsoft Reviewers: Open in CodeFlow