|
| 1 | +This is a .NET based repository that contains the VSTest test platform. Please follow these guidelines when contributing: |
| 2 | + |
| 3 | +## Code Standards |
| 4 | + |
| 5 | +You MUST follow all code-formatting and naming conventions defined in [`.editorconfig`](../.editorconfig). |
| 6 | + |
| 7 | +In addition to the rules enforced by `.editorconfig`, you SHOULD: |
| 8 | + |
| 9 | +- Favor style and conventions that are consistent with the existing codebase. |
| 10 | +- Prefer file-scoped namespace declarations and single-line using directives. |
| 11 | +- Ensure that the final return statement of a method is on its own line. |
| 12 | +- Use pattern matching and switch expressions wherever possible. |
| 13 | +- Use `nameof` instead of string literals when referring to member names. |
| 14 | +- Always use `is null` or `is not null` instead of `== null` or `!= null`. |
| 15 | +- Trust the C# null annotations and don't add null checks when the type system says a value cannot be null. |
| 16 | +- Prefer `?.` if applicable (e.g. `scope?.Dispose()`). |
| 17 | +- Use `ObjectDisposedException.ThrowIf` where applicable. |
| 18 | +- Respect StyleCop.Analyzers rules, in particular: |
| 19 | + - SA1028: Code must not contain trailing whitespace |
| 20 | + - SA1316: Tuple element names should use correct casing |
| 21 | + - SA1518: File is required to end with a single newline character |
| 22 | + |
| 23 | +You MUST minimize adding public API surface area but any newly added public API MUST be declared in the related `PublicAPI.Unshipped.txt` file. |
| 24 | + |
| 25 | +## Localization Guidelines |
| 26 | + |
| 27 | +Anytime you add a new localization resource, you MUST: |
| 28 | +- Add a corresponding entry in the localization resource file. |
| 29 | +- Add an entry in all `*.xlf` files related to the modified `.resx` file. |
| 30 | +- Do not modify existing entries in '*.xlf' files unless you are also modifying the corresponding `.resx` file. |
0 commit comments