We're really happy to accept contributions. However we also ask that you follow a few rules when doing so.
When opening a pull request, please make sure your branch targets the latest main branch. Also make sure your branch is synchronized with the target branch, to avoid unnecessary surprises.
When opening pull requests, make sure the title reflects the changes proposed in the request. Prefer past tense, and be brief. If you're fixing an issue, mention it through its ID (like #123 for issue 123).
Most of the code style is based off Microsoft C# Coding Conventions and enforced by an .editorconfig file. Here are the ones worthy of note:
- Private fields of a class are to be prefixed with an underscore. DO NOT prefix them with
this. - Other members of a class may be prefixed with
this, if it helps with readability. Otherwise, avoid them. - Inherited members are to be prefixed with
base. - Give descriptive names to your variables. DO NOT use Hungarian Notation.
- Methods comprised of a single line of code are to be written with a expression body instead of a block body.
- Everything, besides constructors and private members, must have XML documentation.
- Keep the indentation level low. Prefer guard clauses whenever possible. Example:
// Prefer this
public void SomeMethod(int number)
{
if (number < 0)
return;
CallA();
CallB();
CallC();
}
// Avoid this
public void OtherMethod(int number)
{
if (number >= 0)
{
CallA();
CallB();
CallC();
}
}-
Members in classes should be ordered as follows (with few exceptions):
- Private fields not initialized in the constructor.
- Private fields initialized in the constructor.
- Properties not initialized in the constructor.
- Properties initialized in the constructor.
- Default constructor.
- Parameterized constructors (if any).
- Public methods.
- Internal methods.
- Protected methods.
- Private methods.
-
Pull requests that change the
.editorconfigfile in an attempt to circumvent its style rules will not be merged. -
Pull requests that add entries to the
GlobalSuppressions.csfile with no justification will not be merged.
- All pull requests must be successfully built by the CI tests on the repository. Pull requests that fail on them will not be merged.
- Pull requests may undergo a manual code review. Pull requests that fail to address the points brought in the review will not be merged.