{"action":"created","comment":{"url":"https://api.github.com/repos/NuGet/NuGetDocs/pulls/comments/30426079","id":30426079,"diff_hunk":"@@ -1,102 +1,511 @@\n-﻿# Coding Guidelines\n+# Coding Guidelines\n \n Let's face it. No matter what coding guidelines we choose, we're not going to make everyone happy. \n In fact, some people out there might be downright angry at the choices we make. \n-But the fact of the matter is that there is no \"one true bracing style,\" despite \n-<a title=\"The One True Bracing Style\" href=\"http://en.wikipedia.org/wiki/Indent_style#Variant:_1TBS\">attempts to name a bracing style as such</a>. \n+But the fact of the matter is that there is no \"one true bracing style,\" despite [attempts to name a bracing style as such](http://en.wikipedia.org/wiki/Indent_style#Variant:_1TBS). \n+\n While we would like to embrace everyone's individual style, working together on the same codebase would be utter chaos \n if we don't enforce some consistency. When it comes to coding guidelines, consistency can be even more important than \n being \"right.\"\n \n-## Definitions\n+## Basics\n+\n+### Copyright header and license notice\n+\n+All source code files (mostly `src/**/*.cs` and `test/**/*.cs`) require this exact header (please do not make any changes to it):\n+\n+```c#\n+// Copyright (c) .NET Foundation. All rights reserved.\n+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n+```\n+\n+It is ok to skip it on generated files, such as `*.designer.cs`.\n+\n+Every repo also needs the Apache 2.0 License in a file called LICENSE.txt in the root of the repo. Please use only identical copies to what we have in other repos.\n+\n+(There are some exceptions to this, but they need to be approved by @eilon.)\n+\n+### Code reviews and checkins\n+\n+To help ensure that only the highest quality code makes its way into the project, please submit all your code changes to GitHub as PRs. This includes Visual Studio extension, gallery and command line code changes, unit test updates, and updates to official samples. For example, sending a PR for just an update to a unit test might seem like a waste of time but the unit tests are just as important as the product code and as such, reviewing changes to them is also just as important.\n+\n+The advantages are numerous: improving code quality, more visibility on changes and their potential impact, avoiding duplication of effort, and creating general awareness of progress being made in various areas.\n+\n+In general a PR should be signed off (using the :shipit: `:shipit:` emoticon) by the Subject Matter Expert (SME) of that code. For example, a change to the Banana project should be signed off by `@MrMonkey`, and not by `@MrsGiraffe`. If you don't know the SME, please talk to one of the engineering leads and they will be happy to help you identify the SME. Of course, sometimes it's the SME who is making a change, in which case a secondary person will have to sign off on the change (e.g. `@JuniorMonkey`).\n+\n+To commit the PR to the repo **do not use the Big Green Button**. Instead, do a typical push that you would use with Git (e.g. local pull, rebase, merge, push).\n+\n+## Source code management\n+\n+:grey_exclamation: The *structure* of the code that we write and the *tools* that we use to write the code.\n+\n+### Repos\n+\n+To create a new repo in the https://github.com/nuget/ org, contact @yishaigalatzer.\n+\n+### Home repo\n+\n+The https://github.com/nuget/Home repo is the starting point for all things NuGet. It has the [issue tracker](https://github.com/nuget/home/issues) as well as an [up-to-date README](https://github.com/NuGet/Home/blob/master/README.md) of how repos are structured. Make sure to consult it before beginning your journey through NuGet code.\n+\n+### Branch strategy\n+\n+In general:\n+\n+* `master` has the code for the latest release of NuGet (e.g. alpha, beta, RC, RTM)\n+* `dev` has the code that is being worked on but not yet released. This is the branch into which devs normally submit pull requests and merge changes into.\n+* `release` has the code that is being staged and stabilized for an upcoming release\n+\n+Shortly before a release, the `release` branches are created from `dev`, and stabilization work happens there. Post-release work continus in the `dev` branch. Once the release takes place, the code is pushed from `release` to `master`.\n+\n+### Solution and project folder structure and naming\n+\n+Solution files generally go in the repo root.\n+\n+Solution names match repo names (e.g. NuGet.sln in the NuGet repo).\n+\n+Every project also needs a `project.json` and a matching `.kproj` file. This `project.json` is the source of truth for a project's dependencies and configuration options.\n+\n+Solutions need to contain solution folders that match the physical folders (`src`, `test`, etc.).\n+\n+For example, in the `Fruit` repo with the `Banana` and `Lychee` projects you would have these files checked in:\n+\n+```\n+/Fruit.sln\n+/src\n+/src/NuGet.Banana\n+/src/NuGet.Banana/project.json\n+/src/NuGet.Banana/Banana.kproj\n+/src/NuGet.Banana/Banana.cs\n+/src/NuGet.Banana/Util/BananaUtil.cs\n+/src/NuGet.Lychee\n+/src/NuGet.Lychee/project.json\n+/src/NuGet.Lychee/Lychee.kproj\n+/src/NuGet.Lychee/Lychee.cs\n+/src/NuGet.Lychee/Util/LycheeUtil.cs\n+/test\n+/test/NuGet.Banana.Tests\n+/test/NuGet.Banana.Tests/project.json\n+/test/NuGet.Banana.Tests/BananaTest.kproj\n+/test/NuGet.Banana.Tests/BananaTest.cs\n+/test/NuGet.Banana.Tests/Util/BananaUtilTest.cs\n+```\n+\n+Note that after running the `build` command the system will generate the following files:\n+\n+```\n+/build/*.shade\n+```\n+\n+All these files are set to be ignored in the `.gitignore` file.\n+\n+### Conditional compilation for Desktop/CoreCLR\n+\n+Almost all development is done for both CoreCLR and Desktop .NET. Some code will be CoreCLR-specific or Desktop-specific because of API changes or behavior differences. The build system has two conditional compilation statements to assist with this:\n+\n+Desktop:\n+\n+```c#\n+#ifdef ASPNET50\n+```\n+\n+CoreCLR:\n+\n+```c#\n+#ifdef ASPNETCORE50","path":"NuGet.Docs/Contribute/Coding-Guidelines.md","position":118,"original_position":118,"commit_id":"3677d313f2c9d49bf3d6bdc0a3f1fa21bc8a1340","original_commit_id":"3677d313f2c9d49bf3d6bdc0a3f1fa21bc8a1340","user":{"login":"anurse","id":7574,"avatar_url":"https://avatars.githubusercontent.com/u/7574?v=3","gravatar_id":"","url":"https://api.github.com/users/anurse","html_url":"https://github.com/anurse","followers_url":"https://api.github.com/users/anurse/followers","following_url":"https://api.github.com/users/anurse/following{/other_user}","gists_url":"https://api.github.com/users/anurse/gists{/gist_id}","starred_url":"https://api.github.com/users/anurse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anurse/subscriptions","organizations_url":"https://api.github.com/users/anurse/orgs","repos_url":"https://api.github.com/users/anurse/repos","events_url":"https://api.github.com/users/anurse/events{/privacy}","received_events_url":"https://api.github.com/users/anurse/received_events","type":"User","site_admin":false},"body":"`ASPNETCORE50` => `DNXCORE50`","created_at":"2015-05-15T17:01:29Z","updated_at":"2015-05-15T17:01:29Z","html_url":"https://github.com/NuGet/NuGetDocs/pull/338#discussion_r30426079","pull_request_url":"https://api.github.com/repos/NuGet/NuGetDocs/pulls/338","_links":{"self":{"href":"https://api.github.com/repos/NuGet/NuGetDocs/pulls/comments/30426079"},"html":{"href":"https://github.com/NuGet/NuGetDocs/pull/338#discussion_r30426079"},"pull_request":{"href":"https://api.github.com/repos/NuGet/NuGetDocs/pulls/338"}}},"pull_request":{"url":"https://api.github.com/repos/NuGet/NuGetDocs/pulls/338","id":35491678,"html_url":"https://github.com/NuGet/NuGetDocs/pull/338","diff_url":"https://github.com/NuGet/NuGetDocs/pull/338.diff","patch_url":"https://github.com/NuGet/NuGetDocs/pull/338.patch","issue_url":"https://api.github.com/repos/NuGet/NuGetDocs/issues/338","number":338,"state":"open","locked":false,"title":"Coding guidelines update","user":{"login":"maartenba","id":485230,"avatar_url":"https://avatars.githubusercontent.com/u/485230?v=3","gravatar_id":"","url":"https://api.github.com/users/maartenba","html_url":"https://github.com/maartenba","followers_url":"https://api.github.com/users/maartenba/followers","following_url":"https://api.github.com/users/maartenba/following{/other_user}","gists_url":"https://api.github.com/users/maartenba/gists{/gist_id}","starred_url":"https://api.github.com/users/maartenba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maartenba/subscriptions","organizations_url":"https://api.github.com/users/maartenba/orgs","repos_url":"https://api.github.com/users/maartenba/repos","events_url":"https://api.github.com/users/maartenba/events{/privacy}","received_events_url":"https://api.github.com/users/maartenba/received_events","type":"User","site_admin":false},"body":"* Re-wrote coding guidelines based on aspnet\r\n* Added R# settings file which we can use on all projects\r\n\r\n@NuGet/core-team, please review","created_at":"2015-05-15T07:52:48Z","updated_at":"2015-05-15T17:01:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9cf7fe70037b01e0d8396759d51e963c5675e4e3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NuGet/NuGetDocs/pulls/338/commits","review_comments_url":"https://api.github.com/repos/NuGet/NuGetDocs/pulls/338/comments","review_comment_url":"https://api.github.com/repos/NuGet/NuGetDocs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NuGet/NuGetDocs/issues/338/comments","statuses_url":"https://api.github.com/repos/NuGet/NuGetDocs/statuses/3677d313f2c9d49bf3d6bdc0a3f1fa21bc8a1340","head":{"label":"NuGet:maartenba-codeguidelines","ref":"maartenba-codeguidelines","sha":"3677d313f2c9d49bf3d6bdc0a3f1fa21bc8a1340","user":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"repo":{"id":2629072,"name":"NuGetDocs","full_name":"NuGet/NuGetDocs","owner":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NuGet/NuGetDocs","description":"Documentation site for NuGet","fork":false,"url":"https://api.github.com/repos/NuGet/NuGetDocs","forks_url":"https://api.github.com/repos/NuGet/NuGetDocs/forks","keys_url":"https://api.github.com/repos/NuGet/NuGetDocs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NuGet/NuGetDocs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NuGet/NuGetDocs/teams","hooks_url":"https://api.github.com/repos/NuGet/NuGetDocs/hooks","issue_events_url":"https://api.github.com/repos/NuGet/NuGetDocs/issues/events{/number}","events_url":"https://api.github.com/repos/NuGet/NuGetDocs/events","assignees_url":"https://api.github.com/repos/NuGet/NuGetDocs/assignees{/user}","branches_url":"https://api.github.com/repos/NuGet/NuGetDocs/branches{/branch}","tags_url":"https://api.github.com/repos/NuGet/NuGetDocs/tags","blobs_url":"https://api.github.com/repos/NuGet/NuGetDocs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NuGet/NuGetDocs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NuGet/NuGetDocs/git/refs{/sha}","trees_url":"https://api.github.com/repos/NuGet/NuGetDocs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NuGet/NuGetDocs/statuses/{sha}","languages_url":"https://api.github.com/repos/NuGet/NuGetDocs/languages","stargazers_url":"https://api.github.com/repos/NuGet/NuGetDocs/stargazers","contributors_url":"https://api.github.com/repos/NuGet/NuGetDocs/contributors","subscribers_url":"https://api.github.com/repos/NuGet/NuGetDocs/subscribers","subscription_url":"https://api.github.com/repos/NuGet/NuGetDocs/subscription","commits_url":"https://api.github.com/repos/NuGet/NuGetDocs/commits{/sha}","git_commits_url":"https://api.github.com/repos/NuGet/NuGetDocs/git/commits{/sha}","comments_url":"https://api.github.com/repos/NuGet/NuGetDocs/comments{/number}","issue_comment_url":"https://api.github.com/repos/NuGet/NuGetDocs/issues/comments{/number}","contents_url":"https://api.github.com/repos/NuGet/NuGetDocs/contents/{+path}","compare_url":"https://api.github.com/repos/NuGet/NuGetDocs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NuGet/NuGetDocs/merges","archive_url":"https://api.github.com/repos/NuGet/NuGetDocs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NuGet/NuGetDocs/downloads","issues_url":"https://api.github.com/repos/NuGet/NuGetDocs/issues{/number}","pulls_url":"https://api.github.com/repos/NuGet/NuGetDocs/pulls{/number}","milestones_url":"https://api.github.com/repos/NuGet/NuGetDocs/milestones{/number}","notifications_url":"https://api.github.com/repos/NuGet/NuGetDocs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NuGet/NuGetDocs/labels{/name}","releases_url":"https://api.github.com/repos/NuGet/NuGetDocs/releases{/id}","created_at":"2011-10-23T03:34:15Z","updated_at":"2015-05-07T23:48:26Z","pushed_at":"2015-05-15T08:20:21Z","git_url":"git://github.com/NuGet/NuGetDocs.git","ssh_url":"git@github.com:NuGet/NuGetDocs.git","clone_url":"https://github.com/NuGet/NuGetDocs.git","svn_url":"https://github.com/NuGet/NuGetDocs","homepage":"docs.nuget.org","size":17480,"stargazers_count":93,"watchers_count":93,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":146,"mirror_url":null,"open_issues_count":45,"forks":146,"open_issues":45,"watchers":93,"default_branch":"master"}},"base":{"label":"NuGet:master","ref":"master","sha":"469157cd20b1878deb9ec7d63b319599eb3a3e20","user":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"repo":{"id":2629072,"name":"NuGetDocs","full_name":"NuGet/NuGetDocs","owner":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NuGet/NuGetDocs","description":"Documentation site for NuGet","fork":false,"url":"https://api.github.com/repos/NuGet/NuGetDocs","forks_url":"https://api.github.com/repos/NuGet/NuGetDocs/forks","keys_url":"https://api.github.com/repos/NuGet/NuGetDocs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NuGet/NuGetDocs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NuGet/NuGetDocs/teams","hooks_url":"https://api.github.com/repos/NuGet/NuGetDocs/hooks","issue_events_url":"https://api.github.com/repos/NuGet/NuGetDocs/issues/events{/number}","events_url":"https://api.github.com/repos/NuGet/NuGetDocs/events","assignees_url":"https://api.github.com/repos/NuGet/NuGetDocs/assignees{/user}","branches_url":"https://api.github.com/repos/NuGet/NuGetDocs/branches{/branch}","tags_url":"https://api.github.com/repos/NuGet/NuGetDocs/tags","blobs_url":"https://api.github.com/repos/NuGet/NuGetDocs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NuGet/NuGetDocs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NuGet/NuGetDocs/git/refs{/sha}","trees_url":"https://api.github.com/repos/NuGet/NuGetDocs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NuGet/NuGetDocs/statuses/{sha}","languages_url":"https://api.github.com/repos/NuGet/NuGetDocs/languages","stargazers_url":"https://api.github.com/repos/NuGet/NuGetDocs/stargazers","contributors_url":"https://api.github.com/repos/NuGet/NuGetDocs/contributors","subscribers_url":"https://api.github.com/repos/NuGet/NuGetDocs/subscribers","subscription_url":"https://api.github.com/repos/NuGet/NuGetDocs/subscription","commits_url":"https://api.github.com/repos/NuGet/NuGetDocs/commits{/sha}","git_commits_url":"https://api.github.com/repos/NuGet/NuGetDocs/git/commits{/sha}","comments_url":"https://api.github.com/repos/NuGet/NuGetDocs/comments{/number}","issue_comment_url":"https://api.github.com/repos/NuGet/NuGetDocs/issues/comments{/number}","contents_url":"https://api.github.com/repos/NuGet/NuGetDocs/contents/{+path}","compare_url":"https://api.github.com/repos/NuGet/NuGetDocs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NuGet/NuGetDocs/merges","archive_url":"https://api.github.com/repos/NuGet/NuGetDocs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NuGet/NuGetDocs/downloads","issues_url":"https://api.github.com/repos/NuGet/NuGetDocs/issues{/number}","pulls_url":"https://api.github.com/repos/NuGet/NuGetDocs/pulls{/number}","milestones_url":"https://api.github.com/repos/NuGet/NuGetDocs/milestones{/number}","notifications_url":"https://api.github.com/repos/NuGet/NuGetDocs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NuGet/NuGetDocs/labels{/name}","releases_url":"https://api.github.com/repos/NuGet/NuGetDocs/releases{/id}","created_at":"2011-10-23T03:34:15Z","updated_at":"2015-05-07T23:48:26Z","pushed_at":"2015-05-15T08:20:21Z","git_url":"git://github.com/NuGet/NuGetDocs.git","ssh_url":"git@github.com:NuGet/NuGetDocs.git","clone_url":"https://github.com/NuGet/NuGetDocs.git","svn_url":"https://github.com/NuGet/NuGetDocs","homepage":"docs.nuget.org","size":17480,"stargazers_count":93,"watchers_count":93,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":146,"mirror_url":null,"open_issues_count":45,"forks":146,"open_issues":45,"watchers":93,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NuGet/NuGetDocs/pulls/338"},"html":{"href":"https://github.com/NuGet/NuGetDocs/pull/338"},"issue":{"href":"https://api.github.com/repos/NuGet/NuGetDocs/issues/338"},"comments":{"href":"https://api.github.com/repos/NuGet/NuGetDocs/issues/338/comments"},"review_comments":{"href":"https://api.github.com/repos/NuGet/NuGetDocs/pulls/338/comments"},"review_comment":{"href":"https://api.github.com/repos/NuGet/NuGetDocs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NuGet/NuGetDocs/pulls/338/commits"},"statuses":{"href":"https://api.github.com/repos/NuGet/NuGetDocs/statuses/3677d313f2c9d49bf3d6bdc0a3f1fa21bc8a1340"}}}}