Skip to content

Commit 842a1ee

Browse files
committed
Merge pull request #1549 from Noryoko/issue-1542
Add Hungarian notation configuration documentation
2 parents b9fa57a + 4c2f7d4 commit 842a1ee

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

documentation/Configuration.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,40 @@ The following example shows a configuration file which requires developers to do
164164
}
165165
}
166166
```
167+
168+
## Naming Rules
169+
170+
This section describes the features of naming rules which can be configured in **stylecop.json**. Each of the described properties are configured in the `namingRules` object, which is shown in the following sample file.
171+
172+
```json
173+
{
174+
"settings": {
175+
"namingRules": {
176+
}
177+
}
178+
}
179+
```
180+
181+
### Hungarian Notation
182+
183+
The following properties are used to configure allowable Hungarian notation prefixes in StyleCop Analyzers.
184+
185+
| Property | Default Value | Summary |
186+
| --- | --- | --- |
187+
| `allowCommonHungarianPrefixes` | **true** | Specifies whether common non-Hungarian notation prefixes should be allowed. When true, the two-letter words 'as', 'at', 'by', 'do', 'go', 'if', 'in', 'is', 'it', 'no', 'of', 'on', 'or', and 'to' are allowed to appear as prefixes for variable names. |
188+
| `allowedHungarianPrefixes` | `[ ]` | Specifies additional prefixes which are allowed to be used in variable names. See the example below for more information. |
189+
190+
The following example shows a settings file which allows the common prefixes as well as the custom prefixes 'md' and 'cd'.
191+
192+
```json
193+
{
194+
"settings": {
195+
"namingRules": {
196+
"allowedHungarianPrefixes": [
197+
"cd",
198+
"md"
199+
]
200+
}
201+
}
202+
}
203+
```

0 commit comments

Comments
 (0)