You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/Configuration.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -314,39 +314,39 @@ The following example shows a settings file which allows the common prefixes as
314
314
}
315
315
```
316
316
317
-
### Tuple field names
317
+
### Tuple element names
318
318
319
-
The following properties are used to configure the behavior of the tuple field name analyzers.
319
+
The following properties are used to configure the behavior of the tuple element name analyzers.
320
320
321
321
| Property | Default Value | Minimum Version | Summary |
322
322
| --- | --- | --- | --- |
323
-
|`includeInferredTupleFieldNames`| false | 1.2.0 | Specifies whether inferred tuple field names will be analyzed as well. |
324
-
|`tupleFieldNameCasing`| "camelCase" | 1.2.0 | Specifies the casing convention used for tuple field names. |
323
+
|`includeInferredTupleElementNames`| false | 1.2.0 | Specifies whether inferred tuple element names will be analyzed as well. |
324
+
|`tupleElementNameCasing`| "camelCase" | 1.2.0 | Specifies the casing convention used for tuple element names. |
325
325
326
-
The following example shows a settings file which requires tuple field names to use pascalCase for all tuple field names (including implicitly named tuple fields).
326
+
The following example shows a settings file which requires tuple element names to use PascalCase for all tuple elements (including inferred element names).
327
327
328
328
```json
329
329
{
330
330
"settings": {
331
331
"namingRules": {
332
-
"includeInferredTupleFieldNames": true,
333
-
"tupleFieldNameCasing" : "pascalCase"
332
+
"includeInferredTupleElementNames": true,
333
+
"tupleElementNameCasing" : "PascalCase"
334
334
}
335
335
}
336
336
}
337
337
```
338
338
339
339
340
-
#### Tuple Field Name Casing
341
-
The `tupleFieldNameCasing` property affects the behavior of the [SA1316 Tuple field names must use correct casing](SA1316.md) analyzer.
340
+
#### Tuple Element Name Casing
341
+
The `tupleElementNameCasing` property affects the behavior of the [SA1316 Tuple element names should use correct casing](SA1316.md) analyzer.
342
342
343
343
This property has two allowed values, which are described as follows.
344
344
345
345
##### `"camelCase"`
346
-
In this mode, tuple field names must start with a lowercase letter.
346
+
In this mode, tuple element names must start with a lowercase letter.
347
347
348
-
##### `"pascalCase"`
349
-
In this mode, tuple field names must start with an uppercase letter.
348
+
##### `"PascalCase"`
349
+
In this mode, tuple element names must start with an uppercase letter.
Copy file name to clipboardExpand all lines: documentation/ReadabilityRules.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,4 +42,4 @@ Identifier | Name | Description
42
42
[SA1137](SA1137.md) | ElementsShouldHaveTheSameIndentation | Two sibling elements which each start on their own line have different levels of indentation.
43
43
[SA1139](SA1139.md) | UseLiteralsSuffixNotationInsteadOfCasting | Use literal suffix notation instead of casting.
44
44
[SA1141](SA1141.md) | UseTupleSyntax | Use tuple syntax instead of the underlying ValueTuple implementation type.
45
-
[SA1142](SA1142.md) | ReferToTupleFieldsByName | A field of a tuple was referenced by its metadata name when a field name is available.
45
+
[SA1142](SA1142.md) | ReferToTupleElementsByName | An element of a tuple was referenced by its metadata name when an element name is available.
Copy file name to clipboardExpand all lines: documentation/SA1142.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
<table>
4
4
<tr>
5
5
<td>TypeName</td>
6
-
<td>SA1142ReferToTupleFieldsByName</td>
6
+
<td>SA1142ReferToTupleElementsByName</td>
7
7
</tr>
8
8
<tr>
9
9
<td>CheckId</td>
@@ -20,18 +20,18 @@
20
20
21
21
## Cause
22
22
23
-
A field of a tuple was referenced by its metadata name when a field name is available.
23
+
An element of a tuple was referenced by its metadata name when an element name is available.
24
24
25
25
## Rule description
26
26
27
-
A field of a tuple was referenced by its metadata name when a field name is available. See the documentation on [tuple types](https://docs.microsoft.com/en-us/dotnet/csharp/tuples) for information on how to work with tuples in C# 7.
27
+
An element of a tuple was referenced by its metadata name when an element name is available. See the documentation on [tuple types](https://docs.microsoft.com/en-us/dotnet/csharp/tuples) for information on how to work with tuples in C# 7.
28
28
29
29
For example, the following code would produce a violation of this rule:
30
30
31
31
```csharp
32
32
(intvalueA, intvalueB) x;
33
33
34
-
vary=x.Item1;
34
+
vary=x.Item1;// SA1142
35
35
```
36
36
37
37
The following code would not produce any violations:
@@ -44,15 +44,15 @@ var y = x.valueA;
44
44
45
45
## How to fix violations
46
46
47
-
To fix a violation of this rule, use the appropriate tuple field name in code instead of the metadata name.
47
+
To fix a violation of this rule, use the appropriate tuple element name in code instead of the metadata name.
Field names within a tuple declaration should have the correct casing.
23
+
Element names within a tuple type should have the correct casing.
24
24
25
25
## Rule description
26
26
27
-
Tuple declarations with field names should use the configured casing for the field names (see [Configuration.md](Configuration.md) for details). See the documentation on [tuple types](https://docs.microsoft.com/en-us/dotnet/csharp/tuples) for information on how to work with tuples in C# 7.
27
+
Tuple types with element names should use the configured casing for the element names (see [Configuration.md](Configuration.md) for details). See the documentation on [tuple types](https://docs.microsoft.com/en-us/dotnet/csharp/tuples) for information on how to work with tuples in C# 7.
28
28
29
29
For example, the following code would produce a violation of this rule (with default settings):
30
30
31
31
```csharp
32
32
publicclassExampleClass
33
33
{
34
-
public (intValueA, intValueB) ExampleMethod()
34
+
public (intValueA, intValueB) ExampleMethod()// SA1316
35
35
{
36
36
}
37
37
}
@@ -50,15 +50,15 @@ public class ExampleClass
50
50
51
51
## How to fix violations
52
52
53
-
To fix a violation of this rule, correct the casing of the tuple field name.
53
+
To fix a violation of this rule, correct the casing of the tuple element name.
Copy file name to clipboardExpand all lines: documentation/SA1414.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,18 +20,18 @@
20
20
21
21
## Cause
22
22
23
-
A tuple declaration without element names is present in a member declaration.
23
+
A tuple type without element names is present in a member declaration.
24
24
25
25
## Rule description
26
26
27
-
Tuple types appearing in member declarations should have explicitly named tuple elements. See the documentation on [tuple types](https://docs.microsoft.com/en-us/dotnet/csharp/tuples) for information on how to work with tuples in C# 7.
27
+
Tuple types appearing in member declarations should have explicitly named elements. See the documentation on [tuple types](https://docs.microsoft.com/en-us/dotnet/csharp/tuples) for information on how to work with tuples in C# 7.
28
28
29
29
For example, the following code would produce a violation of this rule:
30
30
31
31
```csharp
32
32
publicclassExampleClass
33
33
{
34
-
public (int, int) ExampleMethod()
34
+
public (int, int) ExampleMethod()// SA1414
35
35
{
36
36
}
37
37
}
@@ -50,7 +50,7 @@ public class ExampleClass
50
50
51
51
## How to fix violations
52
52
53
-
To fix a violation of this rule, provide an element name foreach tuple element.
53
+
To fix a violation of this rule, provide an element name for each tuple element.
0 commit comments