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

Add support for Bicep Linter #1898

Merged
merged 32 commits into from
Oct 2, 2022
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b527ed5
Add Bicep to ARM descriptor
omusavi Sep 20, 2022
975fb0e
Add test cases
omusavi Sep 20, 2022
827f15d
Update changelog
omusavi Sep 20, 2022
666eb0d
Add version regex
omusavi Sep 20, 2022
44e7a1c
Remove unnecessary class
omusavi Sep 21, 2022
b5a7974
Fix test extension
omusavi Sep 21, 2022
91020a8
generated changes
omusavi Sep 21, 2022
75ed178
Fix missing '\' in Dockerfile
omusavi Sep 22, 2022
8959404
Generated fixes
omusavi Sep 22, 2022
6a1cbc5
Merge branch 'main' into bicep-linter
omusavi Sep 22, 2022
9aa6b92
Simplify bicep tests
omusavi Sep 22, 2022
c83f946
Remove sudo from Dockerfile
omusavi Sep 22, 2022
f93c820
Add bicepconfig file to cspell ignore
omusavi Sep 22, 2022
bb6a0bc
Download file to bicep filename
omusavi Sep 22, 2022
c7b3aa1
Merge branch 'main' into bicep-linter
omusavi Sep 22, 2022
4d11c00
Update Bicep CLI command
omusavi Sep 22, 2022
3dd61cb
Quote version regex to avoid escapes and set extra args to array
omusavi Sep 22, 2022
76f455d
missing escape
omusavi Sep 22, 2022
0966221
Set file extensions at linter level
omusavi Sep 22, 2022
04470cc
Merge branch 'main' into bicep-linter
omusavi Sep 27, 2022
53f0e44
Move file_container_regex to ArmLinter block
omusavi Sep 27, 2022
2b340f6
Extract bicep linter into its own descriptor
omusavi Sep 28, 2022
63d941f
Generated files
omusavi Sep 28, 2022
c191ef2
Move test files and create a bicepconfig file
omusavi Sep 28, 2022
717da99
Merge branch 'main' into bicep-linter
omusavi Sep 28, 2022
f158435
Remove old test file and set cli_executable
omusavi Sep 28, 2022
0779704
Remove config_file_name as there is no configurable flag in the bicep…
omusavi Sep 28, 2022
d71593c
Add additional metadata
omusavi Sep 29, 2022
718dfdf
Missing regex field
omusavi Sep 29, 2022
45e4799
Simplify regex
omusavi Sep 29, 2022
331c5cd
Merge branch 'main' into bicep-linter
nvuillam Oct 2, 2022
60d3a62
Add more errors to bicep-bad
nvuillam Oct 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions megalinter/descriptors/bicep.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@ descriptor_flavors:
linters:
- cli_help_arg_name: --help
cli_executable: bicep
cli_lint_mode: file
cli_lint_errors_count: "\\.bicep\\(\\d+,\\d+\\) : Error "
Copy link
Member

Choose a reason for hiding this comment

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

the properties are cli_lint_errors_count and cli_lint_errors_regex :)

Copy link
Member

Choose a reason for hiding this comment

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

cli_lint_error_count can be

  • regex_sum ( sum all the numbers found by regex in logs)
  • regex_number (find a single number with regex in logs)
  • regex_count (count the number of times the regex is matched in the log)

cli_lint_extra_args:
- "build"
cli_lint_mode: file
cli_version_arg_name: --version
file_extensions:
- ".bicep"
linter_image_url: https://raw.githubusercontent.com/Azure/bicep/main/docs/images/BicepLogoImage.png
linter_name: bicep_linter
linter_text: |
By default, Bicep linter errors are set as warnings. To customize linter settings,
use a `bicepconfig.json` file. For more information, see the [documentation for the Bicep Linter](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-config-linter#customize-linter)
linter_repo: https://github.com/Azure/bicep
linter_rules_configuration_url: https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-config
linter_rules_inline_disable_url: https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/linter#silencing-false-positives
linter_rules_url: https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/linter#default-rules
linter_url: https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/linter
linter_rules_configuration_url: https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/linter#default-rules
version_extract_regex: "Bicep CLI version (\\d+)\\.(\\d+)\\.(\\d+)"
examples:
- |
Expand Down