aboutsummaryrefslogtreecommitdiff
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorJeremy Hayes <jeremy@lunarg.com>2017-01-19 14:10:18 -0700
committerJeremy Hayes <jeremy-lunarg@users.noreply.github.com>2017-01-20 10:23:42 -0700
commitaa1d33fcfb9e9e7c90572dab9fe7048731fe767d (patch)
treea9f6875e03ee23f96af5492ce21b3bbe2b04f1c3 /CONTRIBUTING.md
parente0d1f4fe83eedc043e6bd41f37e233f32afdcd6f (diff)
downloadvulkan-validation-layers-aa1d33fcfb9e9e7c90572dab9fe7048731fe767d.tar.gz
contrib: Update style guide and add Git rules
Change-Id: I968e503c0c9c107d5e4496e54f68e0e57563fec2
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md14
1 files changed, 13 insertions, 1 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 160c9d247..67bf24124 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -44,7 +44,10 @@ later on this page.
#### **Coding Conventions and Formatting**
-* Try to follow any existing style in the file. "When in Rome..."
+* Use the [Google style guide](https://google.github.io/styleguide/cppguide.html) for source code with the following two exceptions.
+ * The column limit is 132 (as opposed to the default value 80). The clang-format tool will handle this. See below.
+ * If you can justify a reason for violating a rule in the guidelines, then you are free to do so. Be prepared to defend your decision during code review. This should be used responsibly. An example of a bad reason is “I don’t like that rule.” An example of a good reason is “This violates the style guide, but it improves type safety.”
+
* Run clang-format on your changes to maintain formatting.
* There are `.clang-format files` throughout the repository to define clang-format settings
which are found and used automatically by clang-format.
@@ -57,6 +60,15 @@ later on this page.
> $ git add -u .
> $ git commit
+* Follow these seven rules for git commit messages.
+ * Limit the subject line to 50 characters. Begin with a one-word component description followed by a colon (e.g. loader, layers, tests, etc.).
+ * Separate subject from body with a blank line.
+ * Wrap the body at 72 characters.
+ * Capitalize the subject line.
+ * Do not end the subject line with a period.
+ * Use the body to explain what and why vs. how.
+ * Use the imperative mood in the subject line. This just means to write it as a command (e.g. Fix the sprocket).
+
#### **Testing**
* Run the existing tests in the repository before and after your changes to check for any regressions.
There are some tests that appear in all repositories.