ci: clang-tidy does not check header files? #26703

issue maflcko opened this issue on December 15, 2022
  1. maflcko commented at 8:48 AM on December 15, 2022: member

    Inside the CI env FILE_ENV="./ci/test/00_setup_env_native_tidy.sh" clang-tidy only checks our cpp files and not our header files?

    Currently it passes on master, however if manually invoked on a header file, it will fail:

    # clang-tidy-15 -p=/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu -quiet /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.cpp && echo $?
    543 warnings generated.
    1086 warnings generated.
    0
    
    # clang-tidy-15 -p=/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu -quiet /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h && echo $?
    408 warnings generated.
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:192:19: error: std::move of the const variable 'name' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
            : m_names{std::move(name)},
                      ^~~~~~~~~~    ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:193:18: error: std::move of the const variable 'type' of the trivially-copyable type 'const RPCArg::Type' has no effect; remove std::move() [performance-move-const-arg,-warnings-as-errors]
              m_type{std::move(type)},
                     ^~~~~~~~~~    ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:194:22: error: std::move of the const variable 'fallback' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
              m_fallback{std::move(fallback)},
                         ^~~~~~~~~~        ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:195:25: error: std::move of the const variable 'description' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
              m_description{std::move(description)},
                            ^~~~~~~~~~           ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:208:19: error: std::move of the const variable 'name' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
            : m_names{std::move(name)},
                      ^~~~~~~~~~    ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:209:18: error: std::move of the const variable 'type' of the trivially-copyable type 'const RPCArg::Type' has no effect; remove std::move() [performance-move-const-arg,-warnings-as-errors]
              m_type{std::move(type)},
                     ^~~~~~~~~~    ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:210:19: error: std::move of the const variable 'inner' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
              m_inner{std::move(inner)},
                      ^~~~~~~~~~     ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:211:22: error: std::move of the const variable 'fallback' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
              m_fallback{std::move(fallback)},
                         ^~~~~~~~~~        ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:212:25: error: std::move of the const variable 'description' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
              m_description{std::move(description)},
                            ^~~~~~~~~~           ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:275:18: error: std::move of the const variable 'type' of the trivially-copyable type 'const RPCResult::Type' has no effect; remove std::move() [performance-move-const-arg,-warnings-as-errors]
            : m_type{std::move(type)},
                     ^~~~~~~~~~    ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:276:22: error: std::move of the const variable 'm_key_name' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
              m_key_name{std::move(m_key_name)},
                         ^~~~~~~~~~          ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:277:19: error: std::move of the const variable 'inner' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
              m_inner{std::move(inner)},
                      ^~~~~~~~~~     ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:280:25: error: std::move of the const variable 'description' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
              m_description{std::move(description)},
                            ^~~~~~~~~~           ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:281:18: error: std::move of the const variable 'cond' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
              m_cond{std::move(cond)}
                     ^~~~~~~~~~    ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:302:18: error: std::move of the const variable 'type' of the trivially-copyable type 'const RPCResult::Type' has no effect; remove std::move() [performance-move-const-arg,-warnings-as-errors]
            : m_type{std::move(type)},
                     ^~~~~~~~~~    ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:303:22: error: std::move of the const variable 'm_key_name' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
              m_key_name{std::move(m_key_name)},
                         ^~~~~~~~~~          ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:304:19: error: std::move of the const variable 'inner' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
              m_inner{std::move(inner)},
                      ^~~~~~~~~~     ~
    /bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/rpc/util.h:307:25: error: std::move of the const variable 'description' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
              m_description{std::move(description)},
                            ^~~~~~~~~~           ~
    
  2. maflcko added the label Bug on Dec 15, 2022
  3. maflcko added the label Tests on Dec 15, 2022
  4. iscodand commented at 4:35 PM on December 15, 2022: none

    I can solve this

  5. maflcko closed this on Feb 1, 2023

  6. bitcoin locked this on Feb 1, 2024
Contributors
Labels

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-24 09:14 UTC

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