Commit bb46968
committed
Merge #6559: backport: merge bitcoin#22903, bitcoin#24753, bitcoin#24831, bitcoin#28240, bitcoin#27012, bitcoin#25713, bitcoin#24971, bitcoin#25047 (clang-tidy and IWYU)
4009777 refactor: apply IWYU to `rpc/{fees,signmessage}.cpp` (Kittywhiskers Van Gogh)
85d96c2 merge bitcoin#25047: add readability-redundant-declaration (Kittywhiskers Van Gogh)
71b400d merge bitcoin#24971: modernize-use-nullptr (Kittywhiskers Van Gogh)
104ba87 merge bitcoin#25713: run clang-tidy in quiet mode (Kittywhiskers Van Gogh)
5647652 merge bitcoin#27012: Print iwyu patch in git diff format (Kittywhiskers Van Gogh)
2980992 merge bitcoin#28240: Remove unused boost signals2 from torcontrol (Kittywhiskers Van Gogh)
8e8faa2 merge bitcoin#24831: add include-what-you-use (Kittywhiskers Van Gogh)
c673048 merge bitcoin#24753: Add clang-tidy task (Kittywhiskers Van Gogh)
a6e80ec merge bitcoin#22903: Enable clang-tidy bugprone-argument-comment and fix violations (Kittywhiskers Van Gogh)
Pull request description:
## Additional Information
* While linting is generally reserved for our `arm_linux` build variant, utilizing IWYU (which in turns relies on `bear` for the compilation database, also relied upon by `clang-tidy`) requires a version paired to the Clang version ([source](https://github.com/dashpay/dash/blob/0b42caa2e84636e9a2901b485ea87627014a013b/contrib/containers/ci/Dockerfile#L139)) used to build the target codebase.
This means it has to be run on a build variant that uses Clang. We have opted to use `linux64_multiprocess` as it the most lightweight Clang build variant available (compared to fuzz, UBSan and TSan variants which come with sanitizers tacked on).
* An earlier version of this PR ([source](https://github.com/dashpay/dash/tree/2676eb914d7a1ca6a0f194fe5c573294c3ebee2f)) attempted to apply IWYU to Dash-specific code. This attempt was aborted because IWYU was found to behave non-deterministically.
Furthermore, while IWYU will tell you what headers to use, it will not do the following:
* Respect the usage of angle brackets for source headers (it will almost always suggest quotation marks)
* Use C++-style headers (it will prefer `string.h` over `cstring` and changing it is a manual errand)
* Apply its suggestions in alphabetical order (they will pool up at the bottom)
* Respect newlines meant to separate sets of headers
* Remain consistent (even if IWYU passes locally, there is no guarantee that it would translate to a green CI run)
But it will do the following:
* Change its suggestions based on the ordering of headers
* Make suggestions to add headers/forward declarations and then when run a second time, urge you to remove them
* Pull in implementation headers that shouldn't be directly included. IWYU currently ships with mappings to avoid this for the standard library ([source](https://github.com/include-what-you-use/include-what-you-use/blob/f88f045131bfa0ac709d1e0c103580666254b2c6/gcc.libc.imp)), Qt ([source](https://github.com/include-what-you-use/include-what-you-use/blob/f88f045131bfa0ac709d1e0c103580666254b2c6/qt5_11.imp)) and Boost ([source](https://github.com/include-what-you-use/include-what-you-use/blob/f88f045131bfa0ac709d1e0c103580666254b2c6/boost-all.imp)) but for all else, you're on your own.
It was determined for now that we will simply take guidance from upstream on the matter and extend it to Dash code at some point in the future.
* Both [bitcoin#25029](bitcoin#25029) and [bitcoin#25013](bitcoin#25013) made sure they pass IWYU, changes needed to ensure that the linter is satisfied were made in this PR.
## Breaking Changes
None expected.
## Checklist
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)**
- [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)**
- [x] I have made corresponding changes to the documentation **(note: N/A)**
- [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
ACKs for top commit:
UdjinM6:
utACK 4009777
PastaPastaPasta:
utACK 4009777
Tree-SHA512: 0dae87abfd1f309300a3caadff565da831122591611cb0f6a7dc620e3edc775aeef954935b19035e2fd5b8334bd2281fb05b193a3bdb0844cd0f03890f506212File tree
37 files changed
+160
-82
lines changed- ci
- dash
- test
- contrib
- containers/ci
- devtools/iwyu
- src
- bench
- compat
- governance
- init
- llmq
- masternode
- qt
- rpc
- support/allocators
- test/fuzz
- wallet
- test
37 files changed
+160
-82
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
| |||
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
63 | 86 | | |
64 | 87 | | |
65 | 88 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1911 | 1911 | | |
1912 | 1912 | | |
1913 | 1913 | | |
| 1914 | + | |
| 1915 | + | |
1914 | 1916 | | |
1915 | 1917 | | |
1916 | 1918 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| 87 | + | |
86 | 88 | | |
87 | | - | |
| 89 | + | |
| 90 | + | |
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
91 | | - | |
| 94 | + | |
92 | 95 | | |
93 | 96 | | |
94 | 97 | | |
| |||
140 | 143 | | |
141 | 144 | | |
142 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
143 | 154 | | |
144 | 155 | | |
145 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
0 commit comments