Skip to content

Commit

Permalink
Merge pull request #1549 from Noryoko/issue-1542
Browse files Browse the repository at this point in the history
Add Hungarian notation configuration documentation
  • Loading branch information
sharwell committed Sep 26, 2015
2 parents b9fa57a + 4c2f7d4 commit 842a1ee
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions documentation/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,40 @@ The following example shows a configuration file which requires developers to do
}
}
```

## Naming Rules

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.

```json
{
"settings": {
"namingRules": {
}
}
}
```

### Hungarian Notation

The following properties are used to configure allowable Hungarian notation prefixes in StyleCop Analyzers.

| Property | Default Value | Summary |
| --- | --- | --- |
| `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. |
| `allowedHungarianPrefixes` | `[ ]` | Specifies additional prefixes which are allowed to be used in variable names. See the example below for more information. |

The following example shows a settings file which allows the common prefixes as well as the custom prefixes 'md' and 'cd'.

```json
{
"settings": {
"namingRules": {
"allowedHungarianPrefixes": [
"cd",
"md"
]
}
}
}
```

0 comments on commit 842a1ee

Please sign in to comment.