Skip to content

Commit 5c5c80f

Browse files
Copilotgewarren
andcommitted
Address PR feedback: update dates, fix dev_langs, add periods to comments, simplify examples
Co-authored-by: gewarren <[email protected]>
1 parent 3286fa7 commit 5c5c80f

File tree

7 files changed

+28
-60
lines changed

7 files changed

+28
-60
lines changed

docs/fundamentals/code-analysis/style-rules/ide2000.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "IDE2000: Avoid multiple blank lines"
33
description: "Learn about code analysis rule IDE2000: Avoid multiple blank lines"
4-
ms.date: 01/31/2025
4+
ms.date: 08/19/2025
55
f1_keywords:
66
- IDE2000
77
helpviewer_keywords:
@@ -10,7 +10,6 @@ author: gewarren
1010
ms.author: gewarren
1111
dev_langs:
1212
- CSharp
13-
- VB
1413
ai-usage: ai-generated
1514
---
1615
# Avoid multiple blank lines (IDE2000)
@@ -21,7 +20,7 @@ ai-usage: ai-generated
2120
| **Title** | Avoid multiple blank lines |
2221
| **Category** | Style |
2322
| **Subcategory** | Language rules (new-line preferences) |
24-
| **Applicable languages** | C# and Visual Basic |
23+
| **Applicable languages** | C# |
2524

2625
## Overview
2726

@@ -39,13 +38,13 @@ public class Example
3938

4039
public void Method1()
4140
{
42-
// Code here
41+
// Code here.
4342
}
4443

4544

4645
public void Method2()
4746
{
48-
// Code here
47+
// Code here.
4948
}
5049
}
5150

@@ -55,12 +54,12 @@ public class Example
5554

5655
public void Method1()
5756
{
58-
// Code here
57+
// Code here.
5958
}
6059

6160
public void Method2()
6261
{
63-
// Code here
62+
// Code here.
6463
}
6564
}
6665
```

docs/fundamentals/code-analysis/style-rules/ide2001.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "IDE2001: Embedded statements must be on their own line"
33
description: "Learn about code analysis rule IDE2001: Embedded statements must be on their own line"
4-
ms.date: 01/31/2025
4+
ms.date: 08/19/2025
55
f1_keywords:
66
- IDE2001
77
helpviewer_keywords:
@@ -25,7 +25,7 @@ ai-usage: ai-generated
2525

2626
## Overview
2727

28-
This style rule enforces that embedded statements (statements that are part of control flow constructs like `if`, `while`, `for`, etc.) must be placed on their own line rather than on the same line as the control keyword.
28+
This style rule enforces that embedded statements (statements that are part of control flow constructs like `if`, `while`, and `for`) must be placed on their own line rather than on the same line as the control keyword.
2929

3030
[!INCLUDE [enabled-on-build-never](../includes/enabled-on-build-never.md)]
3131

docs/fundamentals/code-analysis/style-rules/ide2002.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "IDE2002: Consecutive braces must not have blank line between them"
33
description: "Learn about code analysis rule IDE2002: Consecutive braces must not have blank line between them"
4-
ms.date: 01/31/2025
4+
ms.date: 08/19/2025
55
f1_keywords:
66
- IDE2002
77
helpviewer_keywords:
@@ -46,7 +46,7 @@ public class Example
4646

4747
public void Method2()
4848
{
49-
// Another method
49+
// Another method.
5050
}
5151

5252
}
@@ -64,7 +64,7 @@ public class Example
6464

6565
public void Method2()
6666
{
67-
// Another method
67+
// Another method.
6868
}
6969
}
7070
```
@@ -80,7 +80,7 @@ Public Class Example
8080
End Sub
8181

8282
Public Sub Method2()
83-
' Another method
83+
' Another method.
8484
End Sub
8585

8686
End Class
@@ -94,7 +94,7 @@ Public Class Example
9494
End Sub
9595

9696
Public Sub Method2()
97-
' Another method
97+
' Another method.
9898
End Sub
9999
End Class
100100
```

docs/fundamentals/code-analysis/style-rules/ide2003.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "IDE2003: Blank line required between block and subsequent statement"
33
description: "Learn about code analysis rule IDE2003: Blank line required between block and subsequent statement"
4-
ms.date: 01/31/2025
4+
ms.date: 08/19/2025
55
f1_keywords:
66
- IDE2003
77
helpviewer_keywords:
@@ -68,7 +68,7 @@ public void Method()
6868
```
6969

7070
```vb
71-
' Violates IDE2003 - no blank line after block
71+
' Violates IDE2003 - no blank line after block.
7272
Public Sub Method()
7373
If condition Then
7474
DoSomething()
@@ -81,7 +81,7 @@ Public Sub Method()
8181
Return result
8282
End Sub
8383

84-
' Follows IDE2003 - blank lines after blocks
84+
' Follows IDE2003 - blank lines after blocks.
8585
Public Sub Method()
8686
If condition Then
8787
DoSomething()

docs/fundamentals/code-analysis/style-rules/ide2004.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "IDE2004: Blank line not allowed after constructor initializer colon"
33
description: "Learn about code analysis rule IDE2004: Blank line not allowed after constructor initializer colon"
4-
ms.date: 01/31/2025
4+
ms.date: 08/19/2025
55
f1_keywords:
66
- IDE2004
77
helpviewer_keywords:
@@ -38,7 +38,7 @@ public class DerivedClass : BaseClass
3838

3939
base(value)
4040
{
41-
// Constructor body
41+
// Constructor body.
4242
}
4343

4444
public DerivedClass(string name, int value) :
@@ -55,7 +55,7 @@ public class DerivedClass : BaseClass
5555
public DerivedClass(int value) :
5656
base(value)
5757
{
58-
// Constructor body
58+
// Constructor body.
5959
}
6060

6161
public DerivedClass(string name, int value) :
@@ -67,7 +67,7 @@ public class DerivedClass : BaseClass
6767
// Also acceptable on same line
6868
public DerivedClass() : base(0)
6969
{
70-
// Constructor body
70+
// Constructor body.
7171
}
7272
}
7373
```

docs/fundamentals/code-analysis/style-rules/ide2005.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "IDE2005: Blank line not allowed after conditional expression token"
33
description: "Learn about code analysis rule IDE2005: Blank line not allowed after conditional expression token"
4-
ms.date: 01/31/2025
4+
ms.date: 08/19/2025
55
f1_keywords:
66
- IDE2005
77
helpviewer_keywords:
@@ -59,19 +59,19 @@ var result = condition ? trueValue : falseValue;
5959
```
6060

6161
```vb
62-
' Violates IDE2005 - blank lines after conditional expression tokens
62+
' Violates IDE2005 - blank lines after conditional expression tokens.
6363
Dim result = If(condition,
6464

6565
trueValue,
6666

6767
falseValue)
6868

69-
' Follows IDE2005 - no blank lines after conditional expression tokens
69+
' Follows IDE2005 - no blank lines after conditional expression tokens.
7070
Dim result = If(condition,
7171
trueValue,
7272
falseValue)
7373

74-
' Also acceptable on single line
74+
' Also acceptable on single line.
7575
Dim result = If(condition, trueValue, falseValue)
7676
```
7777

docs/fundamentals/code-analysis/style-rules/ide2006.md

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "IDE2006: Blank line not allowed after arrow expression clause token"
33
description: "Learn about code analysis rule IDE2006: Blank line not allowed after arrow expression clause token"
4-
ms.date: 01/31/2025
4+
ms.date: 08/19/2025
55
f1_keywords:
66
- IDE2006
77
helpviewer_keywords:
@@ -37,58 +37,27 @@ public string GetMessage() =>
3737

3838
"Hello, World!";
3939

40-
var square = (int x) =>
41-
42-
x * x;
43-
44-
var result = value switch
45-
{
46-
1 =>
47-
48-
"One",
49-
2 =>
50-
51-
"Two",
52-
_ =>
53-
54-
"Other"
55-
};
56-
5740
// Follows IDE2006 - no blank lines after arrow expression tokens
5841
public string GetMessage() =>
5942
"Hello, World!";
6043

61-
var square = (int x) =>
62-
x * x;
63-
64-
var result = value switch
65-
{
66-
1 =>
67-
"One",
68-
2 =>
69-
"Two",
70-
_ =>
71-
"Other"
72-
};
73-
7444
// Also acceptable on single line
7545
public string GetMessage() => "Hello, World!";
76-
var square = (int x) => x * x;
7746
```
7847

7948
```vb
80-
' Violates IDE2006 - blank line after arrow expression token (Function expressions)
49+
' Violates IDE2006 - blank line after arrow expression token (Function expressions).
8150
Dim square = Function(x As Integer)
8251

8352
Return x * x
8453
End Function
8554

86-
' Follows IDE2006 - no blank lines after arrow expression tokens
55+
' Follows IDE2006 - no blank lines after arrow expression tokens.
8756
Dim square = Function(x As Integer)
8857
Return x * x
8958
End Function
9059

91-
' Also acceptable on single line where possible
60+
' Also acceptable on single line where possible.
9261
Dim getValue = Function() "Hello, World!"
9362
```
9463

0 commit comments

Comments
 (0)