blob: f1cf498a1624cd175d8ae70eca767d030b3f9c7b [file] [log] [blame] [view]
Sourabh Singh Tomar932aae72020-09-10 17:34:371<!--===- 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 Steinfeldfa10045b2020-01-12 19:24:139# Pull request checklist
10Please review the following items before submitting a pull request. This list
11can 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 Steinfeld78807b92020-01-24 20:08:2419 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 Steinfeldfa10045b2020-01-12 19:24:1322* 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
32The following items are taken from the [C++ style guide](C++style.md). But
33even though I've read the style guide, they regularly trip me up.
David Truby3214c182020-03-18 16:02:5334* Run clang-format using the git-clang-format script from LLVM HEAD.
Pete Steinfeldfa10045b2020-01-12 19:24:1335* 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 Chandramohanf0fbae52023-11-15 16:18:1939* Follow the C++ [naming guidelines](C++style.md#naming)
Pete Steinfeld78807b92020-01-24 20:08:2440* Ensure that the names evoke their purpose and are consistent with existing code.
41* Used braced initializers.
Pete Steinfeldfa10045b2020-01-12 19:24:1342* 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.