Skip to content

Commit ebec7bf

Browse files
committed
Merge bitcoin/bitcoin#32572: doc: Remove stale sections in dev notes
fac00d4 doc: Move CI-must-pass requirement into readme section (MarcoFalke) fab79c1 doc: Clarify and move "hygienic commit" note (MarcoFalke) fac8b05 doc: Clarify strprintf size specifier note (MarcoFalke) faaf34a doc: Remove section about RPC alias via function pointer (MarcoFalke) 2222d61 doc: Remove section about RPC arg names in table (MarcoFalke) fa00b8c doc: Remove section about include guards (MarcoFalke) fad6cd7 doc: Remove dev note section on includes (MarcoFalke) fa6623d doc: Remove file name section (MarcoFalke) 7777fb8 doc: Remove shebang section (MarcoFalke) faf65f0 doc: Remove .gitignore section (MarcoFalke) faf2094 doc: Remove note about removed ParsePrechecks (MarcoFalke) fa69c5b doc: Remove -disablewallet from dev notes (MarcoFalke) Pull request description: This removes sections that I've been collecting as stale or overly redundant over the years. The rationale for each removal is in the commit message. ACKs for top commit: yuvicc: ACK fac00d4 janb84: LGTM ACK fac00d4 glozow: ACK fac00d4, all lgtm Tree-SHA512: 17a5b4277fb30d265959d1230a705b36d8501a64c0f4a7f272ea5d9c22031421f95c491144f6d6f714dc7927df667d96ece9ceb43e0a07317d76fdcc4769aaa7
2 parents 011a8c5 + fac00d4 commit ebec7bf

File tree

6 files changed

+14
-111
lines changed

6 files changed

+14
-111
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ fixes or code moves with actual code changes.
115115

116116
Make sure each individual commit is hygienic: that it builds successfully on its
117117
own without warnings, errors, regressions, or test failures.
118+
This means tests must be updated in the same commit that changes the behavior.
118119

119120
Commit messages should be verbose by default consisting of a short subject line
120121
(50 chars max), a blank line and detailed explanatory text as separate

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ in Python.
5656
These tests can be run (if the [test dependencies](/test) are installed) with: `build/test/functional/test_runner.py`
5757
(assuming `build` is your build directory).
5858

59-
The CI (Continuous Integration) systems make sure that every pull request is built for Windows, Linux, and macOS,
60-
and that unit/sanity tests are run automatically.
59+
The CI (Continuous Integration) systems make sure that every pull request is tested on Windows, Linux, and macOS.
60+
The CI must pass on all commits before merge to avoid unrelated CI failures on new pull requests.
6161

6262
### Manual Quality Assurance (QA) Testing
6363

doc/developer-notes.md

Lines changed: 3 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -784,38 +784,6 @@ Threads
784784
- [ThreadI2PAcceptIncoming (`b-i2paccept`)](https://doxygen.bitcoincore.org/class_c_connman.html#a57787b4f9ac847d24065fbb0dd6e70f8)
785785
: Listens for and accepts incoming I2P connections through the I2P SAM proxy.
786786

787-
Ignoring IDE/editor files
788-
--------------------------
789-
790-
In closed-source environments in which everyone uses the same IDE, it is common
791-
to add temporary files it produces to the project-wide `.gitignore` file.
792-
793-
However, in open source software such as Bitcoin Core, where everyone uses
794-
their own editors/IDE/tools, it is less common. Only you know what files your
795-
editor produces and this may change from version to version. The canonical way
796-
to do this is thus to create your local gitignore. Add this to `~/.gitconfig`:
797-
798-
```
799-
[core]
800-
excludesfile = /home/.../.gitignore_global
801-
```
802-
803-
(alternatively, type the command `git config --global core.excludesfile ~/.gitignore_global`
804-
on a terminal)
805-
806-
Then put your favourite tool's temporary filenames in that file, e.g.
807-
```
808-
# NetBeans
809-
nbproject/
810-
```
811-
812-
Another option is to create a per-repository excludes file `.git/info/exclude`.
813-
These are not committed but apply only to one repository.
814-
815-
If a set of tools is used by the build system or scripts the repository (for
816-
example, lcov) it is perfectly acceptable to add its files to `.gitignore`
817-
and commit them.
818-
819787
Development guidelines
820788
============================
821789

@@ -830,15 +798,6 @@ General Bitcoin Core
830798
- *Rationale*: RPC allows for better automatic testing. The test suite for
831799
the GUI is very limited.
832800

833-
- Make sure pull requests pass CI before merging.
834-
835-
- *Rationale*: Makes sure that they pass thorough testing, and that the tester will keep passing
836-
on the master branch. Otherwise, all new pull requests will start failing the tests, resulting in
837-
confusion and mayhem.
838-
839-
- *Explanation*: If the test suite is to be updated for a change, this has to
840-
be done first.
841-
842801
Logging
843802
-------
844803

@@ -878,11 +837,6 @@ Note that the format strings and parameters of `LogDebug` and `LogTrace`
878837
are only evaluated if the logging category is enabled, so you must be
879838
careful to avoid side-effects in those expressions.
880839

881-
Wallet
882-
-------
883-
884-
- Make sure that no crashes happen with run-time option `-disablewallet`.
885-
886840
General C++
887841
-------------
888842

@@ -1008,7 +962,7 @@ Strings and formatting
1008962
buffer overflows, and surprises with `\0` characters. Also, some C string manipulations
1009963
tend to act differently depending on platform, or even the user locale.
1010964
1011-
- For `strprintf`, `LogInfo`, `LogDebug`, etc formatting characters don't need size specifiers.
965+
- For `strprintf`, `LogInfo`, `LogDebug`, etc formatting characters don't need size specifiers (hh, h, l, ll, j, z, t, L) for arithmetic types.
1012966
1013967
- *Rationale*: Bitcoin Core uses tinyformat, which is type safe. Leave them out to avoid confusion.
1014968
@@ -1032,7 +986,7 @@ Strings and formatting
1032986
- In cases where you do call `.c_str()`, you might want to additionally check that the string does not contain embedded '\0' characters, because
1033987
it will (necessarily) truncate the string. This might be used to hide parts of the string from logging or to circumvent
1034988
checks. If a use of strings is sensitive to this, take care to check the string for embedded NULL characters first
1035-
and reject it if there are any (see `ParsePrechecks` in `strencodings.cpp` for an example).
989+
and reject it if there are any.
1036990
1037991
Shadowing
1038992
--------------
@@ -1159,27 +1113,7 @@ TRY_LOCK(cs_vNodes, lockNodes);
11591113
Scripts
11601114
--------------------------
11611115
1162-
Write scripts in Python rather than bash, when possible.
1163-
1164-
### Shebang
1165-
1166-
- Use `#!/usr/bin/env bash` instead of obsolete `#!/bin/bash`.
1167-
1168-
- [*Rationale*](https://github.com/dylanaraps/pure-bash-bible#shebang):
1169-
1170-
`#!/bin/bash` assumes it is always installed to /bin/ which can cause issues;
1171-
1172-
`#!/usr/bin/env bash` searches the user's PATH to find the bash binary.
1173-
1174-
OK:
1175-
```bash
1176-
#!/usr/bin/env bash
1177-
```
1178-
1179-
Wrong:
1180-
```bash
1181-
#!/bin/bash
1182-
```
1116+
Write scripts in Python or Rust rather than bash, when possible.
11831117
11841118
Source code organization
11851119
--------------------------
@@ -1189,12 +1123,6 @@ Source code organization
11891123
11901124
- *Rationale*: Shorter and simpler header files are easier to read and reduce compile time.
11911125
1192-
- Use only the lowercase alphanumerics (`a-z0-9`), underscore (`_`) and hyphen (`-`) in source code filenames.
1193-
1194-
- *Rationale*: `grep`:ing and auto-completing filenames is easier when using a consistent
1195-
naming pattern. Potential problems when building on case-insensitive filesystems are
1196-
avoided when using only lowercase characters in source code filenames.
1197-
11981126
- Every `.cpp` and `.h` file should `#include` every header file it directly uses classes, functions or other
11991127
definitions from, even if those headers are already included indirectly through other headers.
12001128
@@ -1222,24 +1150,6 @@ namespace {
12221150

12231151
- *Rationale*: Avoids confusion about the namespace context.
12241152

1225-
- Use `#include <primitives/transaction.h>` bracket syntax instead of
1226-
`#include "primitives/transactions.h"` quote syntax.
1227-
1228-
- *Rationale*: Bracket syntax is less ambiguous because the preprocessor
1229-
searches a fixed list of include directories without taking location of the
1230-
source file into account. This allows quoted includes to stand out more when
1231-
the location of the source file actually is relevant.
1232-
1233-
- Use include guards to avoid the problem of double inclusion. The header file
1234-
`foo/bar.h` should use the include guard identifier `BITCOIN_FOO_BAR_H`, e.g.
1235-
1236-
```c++
1237-
#ifndef BITCOIN_FOO_BAR_H
1238-
#define BITCOIN_FOO_BAR_H
1239-
...
1240-
#endif // BITCOIN_FOO_BAR_H
1241-
```
1242-
12431153
GUI
12441154
-----
12451155

@@ -1466,10 +1376,6 @@ A few guidelines for introducing and reviewing new RPC interfaces:
14661376
- *Rationale*: Integer verbosity allows for multiple values. Undocumented boolean verbosity is deprecated
14671377
and new RPC methods should prevent its use.
14681378

1469-
- Don't forget to fill in the argument names correctly in the RPC command table.
1470-
1471-
- *Rationale*: If not, the call cannot be used with name-based arguments.
1472-
14731379
- Add every non-string RPC argument `(method, idx, name)` to the table `vRPCConvertParams` in `rpc/client.cpp`.
14741380

14751381
- *Rationale*: `bitcoin-cli` and the GUI debug console use this table to determine how to
@@ -1501,17 +1407,6 @@ A few guidelines for introducing and reviewing new RPC interfaces:
15011407
until the wallet is caught up to the chainstate as of the RPC call's entry.
15021408
This also makes the API much easier for RPC clients to reason about.
15031409

1504-
- Be aware of RPC method aliases and generally avoid registering the same
1505-
callback function pointer for different RPCs.
1506-
1507-
- *Rationale*: RPC methods registered with the same function pointer will be
1508-
considered aliases and only the first method name will show up in the
1509-
`help` RPC command list.
1510-
1511-
- *Exception*: Using RPC method aliases may be appropriate in cases where a
1512-
new RPC is replacing a deprecated RPC, to avoid both RPCs confusingly
1513-
showing up in the command list.
1514-
15151410
- Use *invalid* bech32 addresses (e.g. in the constant array `EXAMPLE_ADDRESS`) for
15161411
`RPCExamples` help documentation.
15171412

test/lint/lint-files.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
ALLOWED_PERMISSION_NON_EXECUTABLES = 0o644
2727
ALLOWED_PERMISSION_EXECUTABLES = 0o755
2828
ALLOWED_EXECUTABLE_SHEBANG = {
29+
# https://github.com/dylanaraps/pure-bash-bible#shebang:
30+
# `#!/bin/bash` assumes it is always installed to /bin/ which can cause issues;
31+
# `#!/usr/bin/env bash` searches the user's PATH to find the bash binary.
2932
"py": [b"#!/usr/bin/env python3"],
3033
"sh": [b"#!/usr/bin/env bash", b"#!/bin/sh"],
3134
}

test/lint/lint-include-guards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def main():
8383

8484
if count != 3:
8585
print(f'{header_file} seems to be missing the expected '
86-
'include guard:')
86+
'include guard to prevent the double inclusion problem:')
8787
print(f' #ifndef {header_id}')
8888
print(f' #define {header_id}')
8989
print(' ...')

test/lint/lint-includes.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ def main():
166166

167167
# Enforce bracket syntax includes
168168
quote_syntax_inclusions = find_quote_syntax_inclusions()
169+
# *Rationale*: Bracket syntax is less ambiguous because the preprocessor
170+
# searches a fixed list of include directories without taking location of the
171+
# source file into account. This allows quoted includes to stand out more when
172+
# the location of the source file actually is relevant.
169173

170174
if quote_syntax_inclusions:
171175
print("Please use bracket syntax includes (\"#include <foo.h>\") instead of quote syntax includes:")

0 commit comments

Comments
 (0)