-
Notifications
You must be signed in to change notification settings - Fork 43
Contributing
- Unless it is a trivial change, make sure that there is a corresponding issue for your change first. If there is none, create one.
- Create a fork in GitHub
- Create a branch off the master branch. Name it something that that makes sense, such as issue-123 or githubhandle-issue-123. This makes it easy for everyone to figure out what the branch is used for. It also makes it easier to isolate your change from incoming changes from the origin.
- Commit your changes and push your changes to GitHub
- Create a pull request against the origin's master branch
- DO follow our coding style (see below)
- DO include tests when adding new features. When fixing bugs, start with adding a test that highlights how the current behavior is broken.
- DO keep the discussions focused. When a new or related topic comes up it's often better to create new issue than to side track the discussion.
- DO blog and tweet (or whatever) about your contributions, frequently!
- DON'T surprise us with big pull requests. Instead, file an issue and start a discussion so we can agree on a direction before you invest a large amount of time.
- DON'T commit code that you didn't write. If you find MIT or Apache 2 licensed code that you think is a good fit to add to Vipr, file an issue and start a discussion before proceeding.
The general rule we follow is "use Visual Studio defaults".
- We use Allman style braces, where each brace begins on a new line. A single line statement block can go without braces but the block must be properly indented on its own line and it must not be nested in other statement blocks that use braces.
- We use four spaces of indentation (no tabs).
- We use
_camelCase
private members and usereadonly
where possible. Prefix instance fields with_
, static fields withs_
and thread static fields witht_
. - We avoid
this.
unless absolutely necessary. - We always specify the visibility, even if it's the default (i.e.
private string _foo
notstring _foo
). - Namespace imports should be specified at the top of the file, outside of
namespace
declarations and should be sorted alphabetically, withSystem.
namespaces at the top and blank lines between different top level groups. - Avoid more than one empty line at any time. For example, do not have two blank lines between members of a type.
- Avoid spurious free spaces.
For example avoid
if (someVar == 0)...
, where the dots mark the spurious free spaces. Consider enabling "View White Space (Ctrl+E, S)" if using Visual Studio, to aid detection. - We use language keywords instead of BCL types (i.e.
int, string, float
instead ofInt32, String, Single
, etc) for both type references as well as method calls (i.e.int.Parse
instead ofInt32.Parse
).
- We create a test project for each assembly in our solution. If creating both Unit Tests and Integration Tests then split them into two test projects. The test projects should live in a common folder whose name is Tests
- We follow a Given-When-Then convention in naming tests. The Given statement is captured in the test class name and the When-Then is captured in test method names.
- We use Fluent Assertions where possible to define test expectations.
Please format commit messages as follows (based on this excellent post):
Summarize change in 50 characters or less
Provide more detail after the first line. Leave one blank line below the
summary and wrap all lines at 72 characters or less.
If the change fixes an issue, leave another blank line after the final
paragraph and indicate which issue is fixed in the specific format
below.
Fix #42
Also do your best to factor commits appropriately, i.e not too large with unrelated things in the same commit, and not too small with the same small change applied N times in N different commits. If there was some accidental reformatting or whitespace changes during the course of your commits, please rebase them away before submitting the PR.
#Issues
If you are looking at getting your feet wet with some simple (but still beneficial) changes, check out our Up-for-grabs issues.
You do not need to file an issue for trivial changes (e.g. typo fixes). Just send us a PR if it's tiny.
If an issue is complex, consider filing it and giving us time to respond before sending a corresponding PR. If you want to work on the issue, just let it be known on the issue thread. Giving us a chance to review the issue will help save time. For example, we might let you know why existing behavior can't be changed or about particular implementation constraints you need to keep in mind, etc.
Don't feel obliged to match every issue with a PR. Simply filing issues for problems you encounter is a great way to contribute too!
- DO NOT submit PRs that alter licensing related files or headers. If you believe there's a problem with them, file an issue and let us take care of it.