Skip to content

Commit e214ea1

Browse files
authored
Merge pull request #295056 from mumian/0220-bcp-238
Add BCP 238
2 parents f02ce35 + 59ca618 commit e214ea1

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

articles/azure-resource-manager/bicep/bicep-core-diagnostics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ If you need more information about a particular diagnostic code, select the **Fe
237237
| <a id='BCP235' />BCP235 | Error | Specified JSONPath doesn't exist in the given file or is invalid. |
238238
| <a id='BCP236' />BCP236 | Error | Expected a new line or comma character at this location. |
239239
| <a id='BCP237' />BCP237 | Error | Expected a comma character at this location. |
240-
| <a id='BCP238' />BCP238 | Error | Unexpected new line character after a comma. |
240+
| <a id='BCP238' />[BCP238](./diagnostics/bcp238.md) | Error | Unexpected new line character after a comma. |
241241
| <a id='BCP239' />BCP239 | Error | Identifier "{name}" is a reserved Bicep symbol name and can't be used in this context. |
242242
| <a id='BCP240' />BCP240 | Error | The "parent" property only permits direct references to resources. Expressions aren't supported. |
243243
| <a id='BCP241' />BCP241 | Warning | The \<function-name> function is deprecated and will be removed in a future release of Bicep. Add a comment to https://github.com/Azure/bicep/issues/2017 if you believe this will impact your workflow. |
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: BCP238
3+
description: Unexpected new line character after a comma.
4+
ms.topic: reference
5+
ms.custom: devx-track-bicep
6+
ms.date: 02/12/2025
7+
---
8+
9+
# Bicep diagnostic code - BCP238
10+
11+
In Bicep, arrays or objects can be declared on a single line or across multiple lines. In single-line declarations, values are separated by commas (,), while in multi-line declarations, commas aren't used. You can combine single-line and multi-line styles, but each element must be separated by no more than one comma or one set of new lines. This diagnostic occurs when this rule isn't followed. For more information, see [Arrays](../data-types.md#arrays) or [Objects](../data-types.md#objects).
12+
13+
## Description
14+
15+
Unexpected new line character after a comma.
16+
17+
## Level
18+
19+
Error
20+
21+
## Solution
22+
23+
Remove Use a name of a value.
24+
25+
## Examples
26+
27+
The following example raises the diagnostic because a comma and a new line are used in between _'def'_ and _'ghi'_:
28+
29+
```bicep
30+
var mixedArray = ['abc', 'def',
31+
'ghi']
32+
```
33+
34+
You can fix the diagnostic by removing either the comma or the new line:
35+
36+
```bicep
37+
var mixedArray = ['abc', 'def'
38+
'ghi']
39+
```
40+
41+
```bicep
42+
var mixedArray = ['abc', 'def', 'ghi']
43+
```
44+
45+
## Next steps
46+
47+
For more information about Bicep diagnostics, see [Bicep core diagnostics](../bicep-core-diagnostics.md).

articles/azure-resource-manager/bicep/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,8 @@
697697
href: diagnostics/bcp170.md
698698
- name: BCP192
699699
href: diagnostics/bcp192.md
700+
- name: BCP238
701+
href: diagnostics/bcp238.md
700702
- name: BCP266
701703
href: diagnostics/bcp266.md
702704
- name: BCP288

0 commit comments

Comments
 (0)