Skip to content

Commit d26e1bc

Browse files
authored
Merge pull request #1712 from MicrosoftDocs/master
3/30 AM Publish
2 parents 064f867 + abbd52e commit d26e1bc

11 files changed

+416
-308
lines changed
Lines changed: 54 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,67 @@
11
---
22
title: "CA1701: Resource string compound words should be cased correctly | Microsoft Docs"
3-
ms.custom: ""
4-
ms.date: "11/04/2016"
5-
ms.reviewer: ""
6-
ms.suite: ""
7-
ms.technology:
8-
- "vs-ide-code-analysis"
9-
ms.tgt_pltfrm: ""
10-
ms.topic: "article"
11-
f1_keywords:
3+
ms.date: 03/28/2018
4+
ms.technology: vs-ide-code-analysis
5+
ms.topic: reference
6+
f1_keywords:
127
- "ResourceStringCompoundWordsShouldBeCasedCorrectly"
138
- "CA1701"
14-
helpviewer_keywords:
9+
helpviewer_keywords:
1510
- "CA1701"
1611
- "ResourceStringCompoundWordsShouldBeCasedCorrectly"
1712
ms.assetid: 4ddbe09f-24b8-4c47-9373-a06f4487ca0d
18-
caps.latest.revision: 24
1913
author: "gewarren"
2014
ms.author: "gewarren"
2115
manager: ghogen
22-
ms.workload:
16+
ms.workload:
2317
- "multiple"
2418
---
2519
# CA1701: Resource string compound words should be cased correctly
26-
|||
27-
|-|-|
28-
|TypeName|ResourceStringCompoundWordsShouldBeCasedCorrectly|
29-
|CheckId|CA1701|
30-
|Category|Microsoft.Naming|
31-
|Breaking Change|Non-breaking|
32-
33-
## Cause
34-
A resource string contains a compound word that does not appear to be cased correctly.
35-
36-
## Rule Description
37-
Each word in the resource string is split into tokens that are based on the casing. Each contiguous two-token combination is checked by the Microsoft spelling checker library. If recognized, the word produces a violation of the rule. Examples of compound words that cause a violation are "CheckSum" and "MultiPart", which should be cased as "Checksum" and "Multipart", respectively. Due to previous common usage, several exceptions are built into the rule, and several single words are flagged, such as "Toolbar" and "Filename", that should be cased as two distinct words. In this example, "ToolBar" and "FileName" would be flagged.
38-
39-
Naming conventions provide a common look for libraries that target the common language runtime. This reduces the learning curve that is required for new software libraries, and increases customer confidence that the library was developed by someone who has expertise in developing managed code.
40-
41-
## How to Fix Violations
42-
Change the word so that it is cased correctly.
43-
44-
## When to Suppress Warnings
45-
It is safe to suppress a warning from this rule if both parts of the compound word are recognized by the spelling dictionary and the intent is to use two words.
46-
47-
You can also add compound words to a custom dictionary for the spelling checker. Words in the custom dictionary do not cause violations. For more information, see [How to: Customize the Code Analysis Dictionary](../code-quality/how-to-customize-the-code-analysis-dictionary.md).
48-
49-
## Related Rules
50-
[CA1702: Compound words should be cased correctly](../code-quality/ca1702-compound-words-should-be-cased-correctly.md)
51-
52-
[CA1709: Identifiers should be cased correctly](../code-quality/ca1709-identifiers-should-be-cased-correctly.md)
53-
54-
[CA1708: Identifiers should differ by more than case](../code-quality/ca1708-identifiers-should-differ-by-more-than-case.md)
55-
56-
## See Also
57-
[Capitalization Conventions](/dotnet/standard/design-guidelines/capitalization-conventions)
58-
[Naming Guidelines](/dotnet/standard/design-guidelines/naming-guidelines)
20+
21+
|||
22+
|-|-|
23+
|TypeName|ResourceStringCompoundWordsShouldBeCasedCorrectly|
24+
|CheckId|CA1701|
25+
|Category|Microsoft.Naming|
26+
|Breaking Change|Non-breaking|
27+
28+
## Cause
29+
30+
A resource string contains a compound word that does not appear to be cased correctly.
31+
32+
## Rule description
33+
34+
Each word in the resource string is split into tokens that are based on the casing. Each contiguous two-token combination is checked by the Microsoft spelling checker library. If recognized, the word produces a violation of the rule. Examples of compound words that cause a violation are "CheckSum" and "MultiPart", which should be cased as "Checksum" and "Multipart", respectively. Due to previous common usage, several exceptions are built into the rule, and several single words are flagged, such as "Toolbar" and "Filename", that should be cased as two distinct words. In this example, "ToolBar" and "FileName" would be flagged.
35+
36+
Naming conventions provide a common look for libraries that target the common language runtime. This reduces the learning curve that is required for new software libraries, and increases customer confidence that the library was developed by someone who has expertise in developing managed code.
37+
38+
## How to fix violations
39+
40+
Change the word so that it is cased correctly.
41+
42+
## Change the dictionary language
43+
44+
By default, the English (en) version of the spelling checker is used. If you want to change the language of the spelling checker, you can do so by adding one of the following attributes to your *AssemblyInfo.cs* or *AssemblyInfo.vb* file:
45+
46+
- Use <xref:System.Reflection.AssemblyCultureAttribute> to specify the culture if your resources are in a satellite assembly.
47+
- Use <xref:System.Resources.NeutralResourcesLanguageAttribute> to specify the *neutral culture* of your assembly if your resources are in the same assembly as your code.
48+
49+
> [!IMPORTANT]
50+
> If you set the culture to anything other than an English-based culture, this code analysis rule is silently disabled.
51+
52+
## When to suppress warnings
53+
54+
It is safe to suppress a warning from this rule if both parts of the compound word are recognized by the spelling dictionary and the intent is to use two words.
55+
56+
You can also add compound words to a custom dictionary for the spelling checker. Words in the custom dictionary do not cause violations. For more information, see [How to: Customize the Code Analysis Dictionary](../code-quality/how-to-customize-the-code-analysis-dictionary.md).
57+
58+
## Related rules
59+
60+
- [CA1702: Compound words should be cased correctly](../code-quality/ca1702-compound-words-should-be-cased-correctly.md)
61+
- [CA1709: Identifiers should be cased correctly](../code-quality/ca1709-identifiers-should-be-cased-correctly.md)
62+
- [CA1708: Identifiers should differ by more than case](../code-quality/ca1708-identifiers-should-differ-by-more-than-case.md)
63+
64+
## See also
65+
66+
- [Capitalization Conventions](/dotnet/standard/design-guidelines/capitalization-conventions)
67+
- [Naming Guidelines](/dotnet/standard/design-guidelines/naming-guidelines)
Lines changed: 57 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,70 @@
11
---
22
title: "CA1702: Compound words should be cased correctly | Microsoft Docs"
3-
ms.custom: ""
4-
ms.date: "11/04/2016"
5-
ms.reviewer: ""
6-
ms.suite: ""
7-
ms.technology:
8-
- "vs-ide-code-analysis"
9-
ms.tgt_pltfrm: ""
10-
ms.topic: "article"
11-
f1_keywords:
3+
ms.date: 03/28/2018
4+
ms.technology: vs-ide-code-analysis
5+
ms.topic: reference
6+
f1_keywords:
127
- "CA1702"
138
- "CompoundWordsShouldBeCasedCorrectly"
14-
helpviewer_keywords:
9+
helpviewer_keywords:
1510
- "CA1702"
1611
- "CompoundWordsShouldBeCasedCorrectly"
1712
ms.assetid: 05481245-7ad8-48c3-a456-3aa44b6160a6
18-
caps.latest.revision: 20
1913
author: "gewarren"
2014
ms.author: "gewarren"
2115
manager: ghogen
22-
ms.workload:
16+
ms.workload:
2317
- "multiple"
2418
---
2519
# CA1702: Compound words should be cased correctly
26-
|||
27-
|-|-|
28-
|TypeName|CompoundWordsShouldBeCasedCorrectly|
29-
|CheckId|CA1702|
30-
|Category|Microsoft.Naming|
31-
|Breaking Change|Breaking- when fired on assemblies.<br /><br /> Non-breaking - when fired on type parameters.|
32-
33-
## Cause
34-
The name of an identifier contains multiple words and at least one of the words appears to be a compound word that is not cased correctly.
35-
36-
## Rule Description
37-
The name of the identifier is split into words that are based on the casing. Each contiguous two-word combination is checked by the Microsoft spelling checker library. If it is recognized, the identifier produces a violation of the rule. Examples of compound words that cause a violation are "CheckSum" and "MultiPart", which should be cased as "Checksum" and "Multipart", respectively. Due to previous common usage, several exceptions are built into the rule, and several single words are flagged, such as "Toolbar" and "Filename", that should be cased as two distinct words (in this case, "ToolBar" and "FileName").
38-
39-
Naming conventions provide a common look for libraries that target the common language runtime. This reduces the learning curve that is required for new software libraries, and increases customer confidence that the library was developed by someone who has expertise in developing managed code.
40-
41-
## How to Fix Violations
42-
Change the name so that it is cased correctly.
43-
44-
## When to Suppress Warnings
45-
It is safe to suppress a warning from this rule if both parts of the compound word are recognized by the spelling dictionary and the intent is to use two words.
46-
47-
## Related Rules
48-
[CA1701: Resource string compound words should be cased correctly](../code-quality/ca1701-resource-string-compound-words-should-be-cased-correctly.md)
49-
50-
[CA1709: Identifiers should be cased correctly](../code-quality/ca1709-identifiers-should-be-cased-correctly.md)
51-
52-
[CA1708: Identifiers should differ by more than case](../code-quality/ca1708-identifiers-should-differ-by-more-than-case.md)
53-
54-
## See Also
55-
[Naming Guidelines](/dotnet/standard/design-guidelines/naming-guidelines)
56-
[Capitalization Conventions](/dotnet/standard/design-guidelines/capitalization-conventions)
20+
21+
|||
22+
|-|-|
23+
|TypeName|CompoundWordsShouldBeCasedCorrectly|
24+
|CheckId|CA1702|
25+
|Category|Microsoft.Naming|
26+
|Breaking Change|Breaking- when fired on assemblies.<br /><br /> Non-breaking - when fired on type parameters.|
27+
28+
## Cause
29+
30+
The name of an identifier contains multiple words, and at least one of the words appears to be a compound word that is not cased correctly.
31+
32+
## Rule description
33+
34+
The name of the identifier is split into words that are based on the casing. Each contiguous two-word combination is checked by the Microsoft spelling checker library. If it is recognized, the identifier produces a violation of the rule. Examples of compound words that cause a violation are "CheckSum" and "MultiPart", which should be cased as "Checksum" and "Multipart", respectively. Due to previous common usage, several exceptions are built into the rule, and several single words are flagged, such as "Toolbar" and "Filename", that should be cased as two distinct words (in this case, "ToolBar" and "FileName").
35+
36+
Naming conventions provide a common look for libraries that target the common language runtime. This reduces the learning curve that is required for new software libraries, and increases customer confidence that the library was developed by someone who has expertise in developing managed code.
37+
38+
## How to fix violations
39+
40+
Change the name so that it is cased correctly.
41+
42+
## Language
43+
44+
The spell checker currently checks only against English-based culture dictionaries. You can change the culture of your project in the project file, by adding the **CodeAnalysisCulture** element.
45+
46+
For example:
47+
48+
```xml
49+
<Project ...>
50+
<PropertyGroup>
51+
<CodeAnalysisCulture>en-AU</CodeAnalysisCulture>
52+
```
53+
54+
> [!IMPORTANT]
55+
> If you set the culture to anything other than an English-based culture, this code analysis rule is silently disabled.
56+
57+
## When to suppress warnings
58+
59+
It is safe to suppress a warning from this rule if both parts of the compound word are recognized by the spelling dictionary, and the intent is to use two words.
60+
61+
## Related rules
62+
63+
- [CA1701: Resource string compound words should be cased correctly](../code-quality/ca1701-resource-string-compound-words-should-be-cased-correctly.md)
64+
- [CA1709: Identifiers should be cased correctly](../code-quality/ca1709-identifiers-should-be-cased-correctly.md)
65+
- [CA1708: Identifiers should differ by more than case](../code-quality/ca1708-identifiers-should-differ-by-more-than-case.md)
66+
67+
## See also
68+
69+
- [Naming Guidelines](/dotnet/standard/design-guidelines/naming-guidelines)
70+
- [Capitalization Conventions](/dotnet/standard/design-guidelines/capitalization-conventions)
Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,58 @@
11
---
22
title: "CA1703: Resource strings should be spelled correctly | Microsoft Docs"
3-
ms.custom: ""
4-
ms.date: "11/04/2016"
5-
ms.reviewer: ""
6-
ms.suite: ""
7-
ms.technology:
8-
- "vs-ide-code-analysis"
9-
ms.tgt_pltfrm: ""
10-
ms.topic: "article"
11-
f1_keywords:
3+
ms.date: 03/28/2018
4+
ms.technology: vs-ide-code-analysis
5+
ms.topic: reference
6+
f1_keywords:
127
- "ResourceStringsShouldBeSpelledCorrectly"
138
- "CA1703"
14-
helpviewer_keywords:
9+
helpviewer_keywords:
1510
- "CA1703"
1611
- "ResourceStringsShouldBeSpelledCorrectly"
1712
ms.assetid: 693f4970-f512-40cb-ae3b-a0f3a5c6d6f1
18-
caps.latest.revision: 16
1913
author: "gewarren"
2014
ms.author: "gewarren"
2115
manager: ghogen
22-
ms.workload:
16+
ms.workload:
2317
- "multiple"
2418
---
2519
# CA1703: Resource strings should be spelled correctly
26-
|||
27-
|-|-|
28-
|TypeName|ResourceStringsShouldBeSpelledCorrectly|
29-
|CheckId|CA1703|
30-
|Category|Microsoft.Naming|
31-
|Breaking Change|Non-breaking|
32-
33-
## Cause
34-
A resource string contains one or more words that are not recognized by the Microsoft spelling checker library.
35-
36-
## Rule Description
37-
This rule parses the resource string into words (tokenizing compound words) and checks the spelling of each word/token. For information about the parsing algorithm, see [CA1704: Identifiers should be spelled correctly](../code-quality/ca1704-identifiers-should-be-spelled-correctly.md).
38-
39-
By default, the English (en) version of the spelling checker is used.
40-
41-
## How to Fix Violations
42-
To fix a violation of this rule, use complete words that are correctly spelled or add the words to a custom dictionary. For information about how to use custom dictionaries, see [CA1704: Identifiers should be spelled correctly](../code-quality/ca1704-identifiers-should-be-spelled-correctly.md).
43-
44-
## When to Suppress Warnings
45-
Do not suppress a warning from this rule. Correctly spelled words reduce the time that is required to learn new software libraries.
46-
47-
## Related Rules
48-
[CA1701: Resource string compound words should be cased correctly](../code-quality/ca1701-resource-string-compound-words-should-be-cased-correctly.md)
49-
50-
[CA1704: Identifiers should be spelled correctly](../code-quality/ca1704-identifiers-should-be-spelled-correctly.md)
51-
52-
[CA2204: Literals should be spelled correctly](../code-quality/ca2204-literals-should-be-spelled-correctly.md)
20+
21+
|||
22+
|-|-|
23+
|TypeName|ResourceStringsShouldBeSpelledCorrectly|
24+
|CheckId|CA1703|
25+
|Category|Microsoft.Naming|
26+
|Breaking Change|Non-breaking|
27+
28+
## Cause
29+
30+
A resource string contains one or more words that are not recognized by the Microsoft spelling checker library.
31+
32+
## Rule description
33+
34+
This rule parses the resource string into words (tokenizing compound words) and checks the spelling of each word/token. For information about the parsing algorithm, see [CA1704: Identifiers should be spelled correctly](../code-quality/ca1704-identifiers-should-be-spelled-correctly.md).
35+
36+
## How to fix violations
37+
38+
To fix a violation of this rule, use complete words that are correctly spelled or add the words to a custom dictionary. For information about how to use custom dictionaries, see [CA1704: Identifiers should be spelled correctly](../code-quality/ca1704-identifiers-should-be-spelled-correctly.md).
39+
40+
## Change the dictionary language
41+
42+
By default, the English (en) version of the spelling checker is used. If you want to change the language of the spelling checker, you can do so by adding one of the following attributes to your *AssemblyInfo.cs* or *AssemblyInfo.vb* file:
43+
44+
- Use <xref:System.Reflection.AssemblyCultureAttribute> to specify the culture if your resources are in a satellite assembly.
45+
- Use <xref:System.Resources.NeutralResourcesLanguageAttribute> to specify the *neutral culture* of your assembly if your resources are in the same assembly as your code.
46+
47+
> [!IMPORTANT]
48+
> If you set the culture to anything other than an English-based culture, this code analysis rule is silently disabled.
49+
50+
## When to suppress warnings
51+
52+
Do not suppress a warning from this rule. Correctly spelled words reduce the time that is required to learn new software libraries.
53+
54+
## Related rules
55+
56+
- [CA1701: Resource string compound words should be cased correctly](../code-quality/ca1701-resource-string-compound-words-should-be-cased-correctly.md)
57+
- [CA1704: Identifiers should be spelled correctly](../code-quality/ca1704-identifiers-should-be-spelled-correctly.md)
58+
- [CA2204: Literals should be spelled correctly](../code-quality/ca2204-literals-should-be-spelled-correctly.md)

0 commit comments

Comments
 (0)