Skip to content

Commit

Permalink
fix: Small update to the Type-suffix check for UDTs (#4248)
Browse files Browse the repository at this point in the history
## Description

Changed the regex to also cover cases like
`_1.privateEndpointCustomDnsConfigType`

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.web.static-site](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.web.static-site.yml/badge.svg?branch=users%2Falsehr%2FudtRegexFix&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.web.static-site.yml)
(should not show warning) |
|
[![avm.res.network.dns-forwarding-ruleset](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.network.dns-forwarding-ruleset.yml/badge.svg?branch=users%2Falsehr%2FudtRegexFix&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.network.dns-forwarding-ruleset.yml)
(should show warning) |

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [x] Update to CI Environment or utilities (Non-module affecting
changes)
- [ ] Azure Verified Module updates:
- [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation
  • Loading branch information
AlexanderSehr authored Jan 21, 2025
1 parent 86ca03b commit 7e720fa
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,13 @@ Describe 'Module tests' -Tag 'Module' {

$incorrectTypes = [System.Collections.ArrayList]@()
foreach ($typeName in $templateFileContent.definitions.Keys) {
if ($typeName -cnotmatch '^[a-z].*Type$') {
if ($typeName -cnotmatch '^(.+\.)?[a-z].*Type$') {
# Passes
# - testType
# - _1.testType
# NOT passes
# - test
# - _1.TestType
$incorrectTypes += $typeName
}
}
Expand Down

0 comments on commit 7e720fa

Please sign in to comment.