tidy: use modernize-use-raw-string-literal #25110

pull fanquake wants to merge 2 commits into bitcoin:master from fanquake:modernize_use_raw_string_literal changing 30 files +135 −132
  1. fanquake commented at 6:29 PM on May 11, 2022: member

    Refactor and turn on modernize-raw-string-literal. See https://clang.llvm.org/extra/clang-tidy/checks/modernize-raw-string-literal.html. This is a bit noisy, but I think ultimately worth it.

    The motivation is to replace barely-(human)-parseable code like:

    HelpExampleCli("logging", "\"[\\\"all\\\"]\" \"[\\\"http\\\"]\"")
    + HelpExampleRpc("logging", "[\"all\"], [\"libevent\"]")
    

    with more-readable code like:

    HelpExampleCli("logging", R"("[\"all\"]" "[\"http\"]")")
    + HelpExampleRpc("logging", R"(["all"], ["libevent"])")
    

    while keeping the same output. i.e:

    Examples:
    Examples:
    > bitcoin-cli logging "[\"all\"]" "[\"http\"]"
    > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "logging", "params": [["all"], ["libevent"]]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
    

    Note that we already sporadically use raw string literals in the code base.

  2. ajtowns commented at 6:37 PM on May 11, 2022: contributor

    Just my opinion, but using R"" for any cases where we'd otherwise have three backslashes in a row ("\\\"") makes sense, but where it's just escaping an individual backslash or quote, it doesn't seem that useful to me.

  3. DrahtBot added the label Refactoring on May 11, 2022
  4. DrahtBot commented at 7:17 AM on May 12, 2022: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #25276 (doc: Fix typo in importdescriptors by KolbyML)
    • #25218 (refactor: introduce generic 'Result' classes and connect them to CreateTransaction and GetNewDestination by furszy)
    • #24162 (rpc: add require_checksum flag to deriveaddresses by kallewoof)
    • #24161 (rpc/doc: describe using combo(privkey) to get checksum and then list … by kallewoof)
    • #23319 (rpc: Return fee and prevout (utxos) to getrawtransaction by dougEfresh)
    • #22838 (descriptors: Be able to specify change and receiving in a single descriptor string by achow101)

    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.

  5. fanquake force-pushed on May 12, 2022
  6. DrahtBot added the label Needs rebase on May 18, 2022
  7. refactor: use raw string literals
    The motivation is to replace barely (human) parse-able code like:
    
    HelpExampleCli("createrawtransaction", "\"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" \"{\\\"myaddress\\\":0.01}\"")
    
    with code like:
    
    HelpExampleCli("createrawtransaction", R"("[{\"txid\" : \"mytxid\",\"vout\":0}]" "{\"myaddress\":0.01}")")
    6d3856142b
  8. tidy: use modernize-raw-string-literal
    https://clang.llvm.org/extra/clang-tidy/checks/modernize-raw-string-literal.html
    39c83aabca
  9. fanquake force-pushed on May 19, 2022
  10. DrahtBot removed the label Needs rebase on May 19, 2022
  11. DrahtBot added the label Needs rebase on Jun 6, 2022
  12. DrahtBot commented at 2:07 PM on June 6, 2022: contributor

    <!--cf906140f33d8803c4a75a2196329ecb-->

    🐙 This pull request conflicts with the target branch and needs rebase.

    <sub>Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".</sub>

  13. fanquake closed this on Aug 8, 2022

  14. 8498549767 commented at 10:48 AM on January 24, 2023: none

    Exlente

  15. bitcoin locked this on Jan 24, 2023
  16. fanquake deleted the branch on Sep 14, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 06:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me