Sourabh Singh Tomar | 932aae7 | 2020-09-10 17:34:37 | [diff] [blame] | 1 | <!--===- docs/PullRequestChecklist.md |
| 2 | |
| 3 | Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | See https://llvm.org/LICENSE.txt for license information. |
| 5 | SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | |
| 7 | --> |
| 8 | |
Pete Steinfeld | fa10045b | 2020-01-12 19:24:13 | [diff] [blame] | 9 | # Pull request checklist |
| 10 | Please review the following items before submitting a pull request. This list |
| 11 | can also be used when reviewing pull requests. |
| 12 | * Verify that new files have a license with correct file name. |
| 13 | * Run `git diff` on all modified files to look for spurious changes such as |
| 14 | `#include <iostream>`. |
| 15 | * If you added code that causes the compiler to emit a new error message, make |
| 16 | sure that you also added a test that causes that error message to appear |
| 17 | and verifies its correctness. |
| 18 | * Annotate the code and tests with appropriate references to constraint and |
Pete Steinfeld | 78807b9 | 2020-01-24 20:08:24 | [diff] [blame] | 19 | requirement numbers from the Fortran standard. Do not include the text of |
| 20 | the constraint or requirement, just its number. |
| 21 | * Alphabetize arbitrary lists of names. |
Pete Steinfeld | fa10045b | 2020-01-12 19:24:13 | [diff] [blame] | 22 | * Check dereferences of pointers and optionals where necessary. |
| 23 | * Ensure that the scopes of all functions and variables are as local as |
| 24 | possible. |
| 25 | * Try to make all functions fit on a screen (40 lines). |
| 26 | * Build and test with both GNU and clang compilers. |
| 27 | * When submitting an update to a pull request, review previous pull request |
| 28 | comments and make sure that you've actually made all of the changes that |
| 29 | were requested. |
| 30 | |
| 31 | ## Follow the style guide |
| 32 | The following items are taken from the [C++ style guide](C++style.md). But |
| 33 | even though I've read the style guide, they regularly trip me up. |
David Truby | 3214c18 | 2020-03-18 16:02:53 | [diff] [blame] | 34 | * Run clang-format using the git-clang-format script from LLVM HEAD. |
Pete Steinfeld | fa10045b | 2020-01-12 19:24:13 | [diff] [blame] | 35 | * Make sure that all source lines have 80 or fewer characters. Note that |
| 36 | clang-format will do this for most code. But you may need to break up long |
| 37 | strings. |
| 38 | * Review declarations for proper use of `constexpr` and `const`. |
Kiran Chandramohan | f0fbae5 | 2023-11-15 16:18:19 | [diff] [blame] | 39 | * Follow the C++ [naming guidelines](C++style.md#naming) |
Pete Steinfeld | 78807b9 | 2020-01-24 20:08:24 | [diff] [blame] | 40 | * Ensure that the names evoke their purpose and are consistent with existing code. |
| 41 | * Used braced initializers. |
Pete Steinfeld | fa10045b | 2020-01-12 19:24:13 | [diff] [blame] | 42 | * Review pointer and reference types to make sure that you're using them |
| 43 | appropriately. Note that the [C++ style guide](C++style.md) contains a |
| 44 | section that describes all of the pointer types along with their |
| 45 | characteristics. |
| 46 | * Declare non-member functions ```static``` when possible. Prefer |
| 47 | ```static``` functions over functions in anonymous namespaces. |