This document describes contribution guidelines that are specific to CoreFX. Please read .NET Core Guidelines for more general .NET Core contribution guidelines.
We intend to bring dotnet/corefx into full conformance with the style guidelines described in Coding Style. We plan to do that with tooling, in a holistic way. In the meantime, please:
- DO NOT send PRs for style changes. For example, do not send PRs that are focused on changing usage of
Int32
toint
. - DO NOT send PRs for upgrading code to use newer language features, though it's ok to use newer language features as part of new code that's written. For example, it's ok to use expression-bodied members as part of new code you write, but do not send a PR focused on changing existing properties or methods to use the feature.
- DO give priority to the current style of the project or file you're changing even if it diverges from the general guidelines.
- DO NOT submit such PRs until the APIs have been approved via the API Review Process.
- DO submit all code changes via pull requests (PRs) rather than through a direct commit. PRs will be reviewed and potentially merged by the repo maintainers after a peer review that includes at least one maintainer.
- DO NOT submit "work in progress" PRs. A PR should only be submitted when it is considered ready for review and subsequent merging by the contributor.
- DO give PRs short-but-descriptive names (e.g. "Improve code coverage for System.Console by 10%", not "Fix #1234")
- DO refer to any relevant issues, and include keywords that automatically close issues when the PR is merged.
- DO tag any users that should know about and/or review the change.
- DO ensure each commit successfully builds. The entire PR must pass all tests in the Continuous Integration (CI) system before it'll be merged.
- DO address PR feedback in an additional commit(s) rather than amending the existing commits, and only rebase/squash them when necessary. This makes it easier for reviewers to track changes.
- DO assume that "Squash and Merge" will be used to merge your commit unless you request otherwise in the PR.
- DO NOT fix merge conflicts using a merge commit. Prefer
git rebase
. - DO NOT mix independent, unrelated changes in one PR. Separate real product/test code changes from larger code formatting/dead code removal changes. Separate unrelated fixes into separate PRs, especially if they are in different assemblies.
-
DO use "Squash and Merge" by default for individual contributions unless requested by the PR author. Do so, even if the PR contains only one commit. It creates a simpler history than "Create a Merge Commit". Reasons that PR authors may request "Merge and Commit" may include (but are not limited to):
- The change is easier to understand as a series of focused commits. Each commit in the series must be buildable so as not to break
git bisect
. - Contributor is using an e-mail address other than the primary GitHub address and wants that preserved in the history. Contributor must be willing to squash the commits manually before acceptance.
- The change is easier to understand as a series of focused commits. Each commit in the series must be buildable so as not to break