Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-tidy: fixup named argument comments #26238

Merged
merged 1 commit into from Dec 6, 2022

Conversation

fanquake
Copy link
Member

@fanquake fanquake commented Oct 3, 2022

Fix comments so they are checked/consistent.
Fix incorrect comments.

src/wallet/rpc/backup.cpp Outdated Show resolved Hide resolved
@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 3, 2022

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK hebasto
Concept ACK MarcoFalke

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #bitcoin-core/gui/650 (Add Import to Wallet GUI by KolbyML)
  • #25979 ([WIP] wallet: standardize change output detection process by furszy)
  • #25934 (wallet, rpc: add label to listsinceblock by brunoerg)
  • #25806 (wallet: group outputs only once, decouple it from Coin Selection by furszy)
  • #25273 (wallet: Pass through transaction locktime and preset input sequences and scripts to CreateTransaction by achow101)
  • #22838 (descriptors: Be able to specify change and receiving in a single descriptor string by achow101)
  • #19461 (multiprocess: Add bitcoin-gui -ipcconnect option by ryanofsky)
  • #19460 (multiprocess: Add bitcoin-wallet -ipcconnect option by ryanofsky)
  • #10102 (Multiprocess bitcoin by ryanofsky)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@aureleoules
Copy link
Member

Should these comments be enforced with CommentBoolLiterals, CommentIntegerLiterals, CommentFloatLiterals, etc.?
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/argument-comment.html

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like the only purpose of a bunch of this is to cause needless merge conflicts and backport issues

src/qt/addresstablemodel.cpp Outdated Show resolved Hide resolved
@fanquake
Copy link
Member Author

looks like the only purpose of a bunch of this is to cause needless merge conflicts and backport issues

The easiest way to know the number of conflicts was to just open a PR, and doing that, might as well "fix" all issues, and see how bad it is. In any case, the change here is now much reduced.

@fanquake fanquake reopened this Dec 5, 2022
Fix comments so they are checked/consistent.
Fix incorrect arguments.
Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK. This allows clang-tidy to check that the arg name is correct

Unrelated whitespace changes have been dropped

@hebasto
Copy link
Member

hebasto commented Dec 5, 2022

This allows clang-tidy to check that the arg name is correct

Is it enforced somehow?

@fanquake
Copy link
Member Author

fanquake commented Dec 5, 2022

Is it enforced somehow?

clang-tidy & bugprone-argument-comment

@hebasto
Copy link
Member

hebasto commented Dec 5, 2022

Is it enforced somehow?

clang-tidy & bugprone-argument-comment

Why does it not fail currently on the master branch, considering

bitcoin/src/.clang-tidy

Lines 14 to 15 in 38cbf43

WarningsAsErrors: '
bugprone-argument-comment,
?

@fanquake
Copy link
Member Author

fanquake commented Dec 5, 2022

There are lots of linting related things that are not hard failures on the master branch.

@maflcko
Copy link
Member

maflcko commented Dec 6, 2022

Why does it not fail currently on the master branch

clang-tidy does not understand the syntax. Fixing the syntax is the goal of this pull

@hebasto
Copy link
Member

hebasto commented Dec 6, 2022

Why does it not fail currently on the master branch

clang-tidy does not understand the syntax. Fixing the syntax is the goal of this pull

Ah, right. I tested it a bit, and the clang-tidy is able to catch errors like that:

/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/qt/coincontroldialog.cpp:480:102: error: argument name 'noreason' in comment does not match parameter name 'reason' [bugprone-argument-comment,-warnings-as-errors]
        nPayFee = model->wallet().getMinimumFee(nBytes, m_coin_control, /*returned_target=*/nullptr, /*noreason=*/nullptr);
                                                                                                     ^~~~~~~~~~~~~
                                                                                                     /*reason=*/
./interfaces/wallet.h:248:20: note: 'reason' declared here
        FeeReason* reason) = 0;
--

and

/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/wallet/rpc/backup.cpp:187:97: error: argument name 'timestampmp' in comment does not match parameter name 'timestamp' [bugprone-argument-comment,-warnings-as-errors]
                pwallet->ImportScripts({GetScriptForDestination(WitnessV0KeyHash(vchAddress))}, /*timestampmp=*/0);
                                                                                                ^~~~~~~~~~~~~~~~
                                                                                                /*timestamp=*/
./wallet/wallet.h:602:65: note: 'timestamp' declared here
    bool ImportScripts(const std::set<CScript> scripts, int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
--

Concept ACK.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 203886c, I have reviewed the code and it looks OK, I agree it can be merged.

@maflcko maflcko merged commit 8ccab65 into bitcoin:master Dec 6, 2022
@fanquake fanquake deleted the fix_named_argument_cmnts branch December 6, 2022 11:07
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Dec 6, 2022
203886c Fixup clang-tidy named argument comments (fanquake)

Pull request description:

  Fix comments so they are checked/consistent.
  Fix incorrect comments.

ACKs for top commit:
  hebasto:
    ACK 203886c, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: e1257840f91fe39842e2b19299c1633604697b8584fe44b1977ada33cdde5433c877ed0b669fa334e20b04971dc89cd47d58b2783b6f7004521f01d05a1245da
@bitcoin bitcoin locked and limited conversation to collaborators Dec 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants