Contributing to gir.core is very easy. If there is something wrong or missing just open an issue to get in contact or join #gircore on matrix.
If a pull request contributes new code, please be aware of the project's license. For easy adoption of the code please adhere to the following coding guidelines.
The following guidelines aim to provide a framework to write code in a consistent style. If the following guidelines are incomplete the official C# coding conventions and framework design guidelines apply.
- Begin a comment with an uppercase letter.
- End a comment with a period.
- Insert a space before starting the comment text.
Implicitly Typed Local Variables
varfor variables if the type of the right hand side expression is obvious or not important.
- Use object initializers to create objects.
Members include: Properties, constructors, methods, fields, events.
- Call static members by using the class name:
- Fields are only allowed to be private. If needed create a property.
- Don't use Hungarian notation.
- Don't use abbreviations as part of identifier names.
PascalCasefor all public / protected members.
PascalCasefor all types.
camelCasefor all parameter names.
_camelCasefor all private instance fields.
Structure of *.cs files
Partial classes are allowed do split the content of a class into well named files with the following notation:
Implementations which are external to the concrete class must be either in a separate
#region or a separate partial class (e.g. interface implementations).
Inside a source file the structure is like:
- Private fields
All access modifiers should explicitly stated in the code.