Skip to content

Commit 2fc6fe2

Browse files
author
Greg Van Liew
authored
Merge branch 'master' into FromPublicMaster
2 parents 54034c4 + 29fdad9 commit 2fc6fe2

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

docs/ide/editorconfig-code-style-settings-reference.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ helpviewer_keywords:
1313
- "editor"
1414
ms.assetid:
1515
caps.latest.revision: 01
16-
author: "kaseyu"
16+
author: "kuhlenh"
1717
ms.author: "kaseyu"
1818
manager: "davidcsa"
1919
translation.priority.ht:
@@ -36,16 +36,16 @@ translation.priority.ht:
3636
.NET coding conventions are configured using an [EditorConfig](https://docs.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options) file. EditorConfig files allow you to **enable/disable individual .NET coding conventions** and **configure the degree at which you want the convention enforced** (via a severity level). To learn more about how to use EditorConfig to enforce consistency on your codebase, read [this article](https://docs.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options).
3737

3838
There are three supported .NET coding convention categories:
39-
- **[Language Conventions](#language)** are rules pertaining to the C# or Visual Basic language, e.g., `var`/explicit type, use expression-bodied member.
40-
- **[Formatting Rules](#formatting)** are rules regarding the layout and structure of your code in order to make it easier to read, e.g., Allman braces, spaces in control blocks.
41-
- **[Naming Conventions](#naming)** are rules respecting the way objects are named, e.g., `async` methods must end in "Async".
39+
- **[Language Conventions](#language)** are rules pertaining to the C# or Visual Basic language, for example, `var`/explicit type, use expression-bodied member.
40+
- **[Formatting Rules](#formatting)** are rules regarding the layout and structure of your code in order to make it easier to read, for example, Allman braces, spaces in control blocks.
41+
- **[Naming Conventions](#naming)** are rules respecting the way objects are named, for example, `async` methods must end in "Async".
4242

4343
# <a name="language"> Language Conventions </a>
4444
## Overview
4545
**Rule Format:**
4646
`options_name = false|true : none|suggestion|warning|error`
4747

48-
For code style option you must specify **true** (prefer this option) or **false** (do not prefer this option), a colon (`:`), and a severity (`none`, `silent`, `suggestion`, `warning`, or `error`). Severity means the level of enforcement for that style you want in your code base.
48+
For code style option, you must specify **true** (prefer this option) or **false** (do not prefer this option), a colon (`:`), and a severity (`none`, `silent`, `suggestion`, `warning`, or `error`). Severity means the level of enforcement for that style you want in your code base.
4949

5050
`none` and `silent` are synonymous and mean that no indication of any kind should be shown to the user. This has the effect of disabling this rule.
5151

@@ -64,7 +64,7 @@ error | When this style is not being followed, show a compiler error.
6464
- [Properties](#this_and_me_properties)
6565
- [Methods](#this_and_me_methods)
6666
- [Events](#this_and_me_events)
67-
- [Language keywords (int, string, etc. ) vs framework type names for type references](#language_keywords)
67+
- [Language keywords (int, string, etc.) vs framework type names for type references](#language_keywords)
6868
- [Locals, parameters, and members](#language_keywords_variables)
6969
- [Member access expressions](#language_keywords_member_access)
7070
- [Expression-level Preferences](#expression_level)
@@ -171,7 +171,7 @@ dotnet_style_qualification_for_method = false:suggestion
171171
dotnet_style_qualification_for_event = false:suggestion
172172
```
173173

174-
## <a name="language_keywords">Language keywords (int, string, etc. ) vs framework type names for type references </a>
174+
## <a name="language_keywords">Language keywords (int, string, etc.) vs framework type names for type references </a>
175175
### <a name="language_keywords_variables"> Locals, parameters, and members (IDE0012/IDE0014)</a>
176176
| **Option Name** | **Applicable Languages** | **Visual Studio Default** | **Supported Version** |
177177
| ----------- | -------------------- | ----------------------| ---------------- |
@@ -546,8 +546,8 @@ csharp_prefer_simple_default_expression = true:suggestion
546546

547547
| Value | Description | Applied
548548
| ------------- |:-------------|:-------------|
549-
| True | Prefer to use throw expressions instead of throw statements. | **C#:** <br>`this.s = ss ?? throw new ArgumentNullException(nameof(s));`
550-
| False | Prefer to use throw statements instead of throw expressions.| **C#:** <br>`if (s==null) {throw new ArgumentNullException(nameof(s));} this.s = s;`
549+
| True | Prefer to use `throw` expressions instead of `throw` statements. | **C#:** <br>`this.s = ss ?? throw new ArgumentNullException(nameof(s));`
550+
| False | Prefer to use `throw` statements instead of `throw` expressions.| **C#:** <br>`if (s==null) {throw new ArgumentNullException(nameof(s));} this.s = s;`
551551

552552
#### Example editorconfig file:
553553
```
@@ -565,7 +565,7 @@ csharp_style_throw_expression = true:suggestion
565565
| Value | Description | Applied
566566
| ------------- |:-------------|:-------------|
567567
| True | Prefer to use conditional coalescing operation (`?.`) when invoking a lambda instead of performing a null check. | **C#:** <br>`func?.Invoke(args);`
568-
| False | Prefer to preform a null check before invoking a lambda instead of using the conditional coalescing operator (`?.`).| **C#:** <br>`if (func!=null) { func(args); }`
568+
| False | Prefer to perform a null check before invoking a lambda instead of using the conditional coalescing operator (`?.`).| **C#:** <br>`if (func!=null) { func(args); }`
569569

570570
#### Example editorconfig file:
571571
```
@@ -598,7 +598,7 @@ csharp_prefer_braces = true:none
598598
**Rule Format:**
599599
`options_name = false|true`
600600

601-
For formatting options you must specify **true** (prefer this option) or **false** (do not prefer this option) except in a couple cases where you must instead specify what conditions you want the rule applied to.
601+
For formatting options, you must specify **true** (prefer this option) or **false** (do not prefer this option) except in a couple cases where you must instead specify what conditions you want the rule applied to.
602602

603603
## .NET Formatting Options
604604

@@ -611,7 +611,7 @@ For formatting options you must specify **true** (prefer this option) or **false
611611
- [Newline Before `else`](#newline_before_else)
612612
- [Newline Before `catch`](#newline_before_catch)
613613
- [Newline Before `finally`](#newline_before_finally)
614-
- [Newline Before Members in Object Intializers](#newline_before_object)
614+
- [Newline Before Members in Object Initializers](#newline_before_object)
615615
- [Newline Before Members in Anonymous Types](#newline_before_anonymous)
616616
- [Newline Before Members in Query Expression Clauses](#newline_before_query)
617617
- [Indentation Options](#indent)
@@ -808,7 +808,7 @@ try {
808808
csharp_new_line_before_finally = true
809809
```
810810

811-
### <a name="newline_before_object"> Newline Before Members in Object Intializers</a>
811+
### <a name="newline_before_object"> Newline Before Members in Object Initializers</a>
812812
| **Option Name** | **Applicable Languages** | **Visual Studio Default** | **Supported Version** |
813813
| ----------- | -------------------- | ----------------------| ---------------- |
814814
| `csharp_new_line_before_members_in_object_initializers`| C# | true | Visual Studio 2017 v. 15.3 |
@@ -1228,7 +1228,7 @@ styleTitle:<br>
12281228
`dotnet_naming_style.<styleTitle>.word_separator = string`<br>
12291229

12301230
## Writing a Naming Convention
1231-
For naming conventions you must specify **symbols**, **style**, and a **severity**. Naming conventions should be ordered from most-specific to least-specific. The first rule encountered that can be applied, will be the only rule applied.
1231+
For naming conventions, you must specify **symbols**, **style**, and a **severity**. Naming conventions should be ordered from most-specific to least-specific. The first rule encountered that can be applied, will be the only rule applied.
12321232

12331233
### Severity
12341234
The following are valid options for the severity of a naming style rule
@@ -1246,7 +1246,7 @@ warning | When this style is not being followed, show a compiler warning.
12461246
error | When this style is not being followed, show a compiler error.
12471247

12481248
### Symbol Specification
1249-
Idenfity _what_ symbols _with which_ modifiers and _at what_ accessibility level the naming rule should apply to.
1249+
Identify _what_ symbols _with which_ modifiers and _at what_ accessibility level the naming rule should apply to.
12501250

12511251
| Option Name | `dotnet_naming_rule.<namingRuleTitle>.symbols` |
12521252
| ------------- |:-------------:|

0 commit comments

Comments
 (0)