Skip to content

Commit c5fc014

Browse files
committed
add BCP238
1 parent 3f7d0cc commit c5fc014

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 are not 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 is not 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
@@ -689,6 +689,8 @@
689689
href: diagnostics/bcp166.md
690690
- name: BCP192
691691
href: diagnostics/bcp192.md
692+
- name: BCP238
693+
href: diagnostics/bcp238.md
692694
- name: BCP266
693695
href: diagnostics/bcp266.md
694696
- name: BCP288

0 commit comments

Comments
 (0)