this derivation will be built: /nix/store/pck1ja5yd8r7f3gv8d5hvic3j3q861xh-nix-grpc-store-clang-tidy-0.2.2.drv building '/nix/store/pck1ja5yd8r7f3gv8d5hvic3j3q861xh-nix-grpc-store-clang-tidy-0.2.2.drv' nix-grpc-store-clang-tidy-0.2.2> tribuchet: building on eliza nix-grpc-store-clang-tidy-0.2.2> Running phase: unpackPhase nix-grpc-store-clang-tidy-0.2.2> unpacking source archive /nix/store/cg0kqvfmmilqxhzjggy8hqwkfmib4xpd-source nix-grpc-store-clang-tidy-0.2.2> source root is source nix-grpc-store-clang-tidy-0.2.2> Running phase: patchPhase nix-grpc-store-clang-tidy-0.2.2> Running phase: updateAutotoolsGnuConfigScriptsPhase nix-grpc-store-clang-tidy-0.2.2> Running phase: configurePhase nix-grpc-store-clang-tidy-0.2.2> mesonConfigurePhase flags: --prefix=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2 --libdir=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/lib --libexecdir=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/libexec --bindir=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/bin --sbindir=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/sbin --includedir=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/include --mandir=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/share/man --infodir=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/share/info --localedir=/nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/share/locale -Dauto_features=enabled -Dwrap_mode=nodownload --buildtype=plain -Db_pch=false nix-grpc-store-clang-tidy-0.2.2> The Meson build system nix-grpc-store-clang-tidy-0.2.2> Version: 1.12.1 nix-grpc-store-clang-tidy-0.2.2> Source dir: /build/source nix-grpc-store-clang-tidy-0.2.2> Build dir: /build/source/build nix-grpc-store-clang-tidy-0.2.2> Build type: native build nix-grpc-store-clang-tidy-0.2.2> WARNING: Project does not target a minimum version but uses feature introduced in '1.1': meson.options file. Use meson_options.txt instead nix-grpc-store-clang-tidy-0.2.2> Project name: nix-grpc-store nix-grpc-store-clang-tidy-0.2.2> Project version: 0.2.2 nix-grpc-store-clang-tidy-0.2.2> C++ compiler for the host machine: clang++ (clang 22.1.8 "clang version 22.1.8") nix-grpc-store-clang-tidy-0.2.2> C++ linker for the host machine: clang++ ld.bfd 2.46 nix-grpc-store-clang-tidy-0.2.2> Host machine cpu family: aarch64 nix-grpc-store-clang-tidy-0.2.2> Host machine cpu: aarch64 nix-grpc-store-clang-tidy-0.2.2> Found pkg-config: YES (/nix/store/ilg26l78wi5v6nhdn4ffxba1f4yc1h9s-pkg-config-wrapper-0.29.2/bin/pkg-config) 0.29.2 nix-grpc-store-clang-tidy-0.2.2> Run-time dependency grpc++ found: YES 1.84.0 nix-grpc-store-clang-tidy-0.2.2> Run-time dependency protobuf found: YES 36.2.0 nix-grpc-store-clang-tidy-0.2.2> Run-time dependency libzstd found: YES 1.5.7 nix-grpc-store-clang-tidy-0.2.2> Run-time dependency threads found: YES nix-grpc-store-clang-tidy-0.2.2> Run-time dependency libcrypto found: YES 3.5.9 nix-grpc-store-clang-tidy-0.2.2> Run-time dependency prometheus-cpp-core found: YES 1.3.0 nix-grpc-store-clang-tidy-0.2.2> Run-time dependency prometheus-cpp-pull found: YES 1.3.0 nix-grpc-store-clang-tidy-0.2.2> Run-time dependency absl_flat_hash_map found: YES 20260817 nix-grpc-store-clang-tidy-0.2.2> Run-time dependency absl_hash found: YES 20260817 nix-grpc-store-clang-tidy-0.2.2> Run-time dependency absl_synchronization found: YES 20260817 nix-grpc-store-clang-tidy-0.2.2> Compiler for C++ supports arguments -Werror=thread-safety: YES nix-grpc-store-clang-tidy-0.2.2> Run-time dependency nix-store found: YES 2.36.0pre20261025_d99b7516 nix-grpc-store-clang-tidy-0.2.2> Run-time dependency nix-util found: YES 2.36.0pre20261025_d99b7516 nix-grpc-store-clang-tidy-0.2.2> Run-time dependency jemalloc found: YES 5.4.0_0 nix-grpc-store-clang-tidy-0.2.2> Run-time dependency libcurl found: YES 8.22.0 nix-grpc-store-clang-tidy-0.2.2> Run-time dependency nlohmann_json found: YES 3.12.0 nix-grpc-store-clang-tidy-0.2.2> Check usable header "jwt-cpp/traits/nlohmann-json/defaults.h" : YES nix-grpc-store-clang-tidy-0.2.2> Checking if "Store::addTempRoots" with dependencies nix-store, nix-util compiles: YES nix-grpc-store-clang-tidy-0.2.2> Program protoc found: YES (/nix/store/wq8r8l8dqynvgy22q9fs7pni029v7hf7-protobuf-36.2/bin/protoc) nix-grpc-store-clang-tidy-0.2.2> Program grpc_cpp_plugin found: YES (/nix/store/jiwg78779483yvcsn3nsv79d8nkncb9r-grpc-1.84.0/bin/grpc_cpp_plugin) nix-grpc-store-clang-tidy-0.2.2> Program mold found: YES (/nix/store/h4d6k29dw2p2jvwnff2n2dmcc5yq2xwy-mold-unwrapped-wrapper-3.0.0/bin/mold) nix-grpc-store-clang-tidy-0.2.2> Run-time dependency dl found: YES nix-grpc-store-clang-tidy-0.2.2> Program tests/farm-client-test.sh found: YES (/build/source/tests/farm-client-test.sh) nix-grpc-store-clang-tidy-0.2.2> Program tests/oidc-test.sh found: YES (/build/source/tests/oidc-test.sh) nix-grpc-store-clang-tidy-0.2.2> Program tests/reverse-gateway-test.sh found: YES (/build/source/tests/reverse-gateway-test.sh) nix-grpc-store-clang-tidy-0.2.2> Build targets in project: 37 nix-grpc-store-clang-tidy-0.2.2> WARNING: Project specifies no minimum version but uses features which were added in versions: nix-grpc-store-clang-tidy-0.2.2> * 1.1: {'meson.options file'} nix-grpc-store-clang-tidy-0.2.2> nix-grpc-store-clang-tidy-0.2.2> nix-grpc-store 0.2.2 nix-grpc-store-clang-tidy-0.2.2> nix-grpc-store-clang-tidy-0.2.2> User defined options nix-grpc-store-clang-tidy-0.2.2> auto_features: enabled nix-grpc-store-clang-tidy-0.2.2> b_pch : false nix-grpc-store-clang-tidy-0.2.2> bindir : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/bin nix-grpc-store-clang-tidy-0.2.2> buildtype : plain nix-grpc-store-clang-tidy-0.2.2> includedir : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/include nix-grpc-store-clang-tidy-0.2.2> infodir : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/share/info nix-grpc-store-clang-tidy-0.2.2> libdir : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/lib nix-grpc-store-clang-tidy-0.2.2> libexecdir : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/libexec nix-grpc-store-clang-tidy-0.2.2> localedir : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/share/locale nix-grpc-store-clang-tidy-0.2.2> mandir : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/share/man nix-grpc-store-clang-tidy-0.2.2> prefix : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2 nix-grpc-store-clang-tidy-0.2.2> sbindir : /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2/sbin nix-grpc-store-clang-tidy-0.2.2> wrap_mode : nodownload nix-grpc-store-clang-tidy-0.2.2> nix-grpc-store-clang-tidy-0.2.2> Found ninja-1.13.2 at /nix/store/6iwk9hppg8q0fr54mg28klc1hgaizhaa-ninja-1.13.2/bin/ninja nix-grpc-store-clang-tidy-0.2.2> mesonConfigurePhase: enabled\ parallel\ building nix-grpc-store-clang-tidy-0.2.2> configurePhase completed in 48 seconds nix-grpc-store-clang-tidy-0.2.2> Running phase: buildPhase nix-grpc-store-clang-tidy-0.2.2> [1/2] Generating eds_proto with a custom command nix-grpc-store-clang-tidy-0.2.2> [2/2] Generating nix_remote_proto with a custom command nix-grpc-store-clang-tidy-0.2.2> [0/1] /nix/store/4mm6h8v69a4mg9sxwsancrf2zsfg5gv2-meson-1.12.1/bin/meson --internal clangtidy /build/source /build/source/build --color always nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-frames-test.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto data(uint64_t id, std::string_view bytes) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | if (size > limit) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | cv.wait(lock, stop, [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | auto const it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto acknowledge(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!enqueue(std::move(msg))) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | if (streams.contains(id) && acknowledged.contains(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 150 | if (removed) cv.notify_all(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | void acknowledgementSent(uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 208 | auto terminal(uint64_t id, bool abort) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-frames-test.cc:8:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 8 | int main() nix-grpc-store-clang-tidy-0.2.2> | ~~~ ^ nix-grpc-store-clang-tidy-0.2.2> | auto -> int nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-frames-test.cc:11:18: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 6 | #include "reverse-frames.hh" nix-grpc-store-clang-tidy-0.2.2> 7 | nix-grpc-store-clang-tidy-0.2.2> 8 | int main() nix-grpc-store-clang-tidy-0.2.2> 9 | { nix-grpc-store-clang-tidy-0.2.2> 10 | nixgrpc::ReverseFrames frames; nix-grpc-store-clang-tidy-0.2.2> 11 | nix::remote::ReverseOpen start; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-frames-test.cc:26:18: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 26 | nix::remote::ReverseFarmMsg msg; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-frames-test.cc:52:10: error: no header providing "uint64_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | for (uint64_t id = 3; id < 3 + nixgrpc::ReverseFrames::maxStreams; ++id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-frames-test.cc:56:5: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | size_t queued = 0; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-frames-test.cc:70:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 70 | std::jthread waiter([&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-frames-test.cc:87:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | std::jthread producer([&] { enqueued = streamed.waitData(1, payload, uploadStop.get_token()); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-frames-test.cc:93:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | std::jthread interrupted([&] { enqueued = streamed.waitData(1, payload, uploadStop.get_token()); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-frames-test.cc:103:28: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 103 | std::jthread discarded([&] { enqueued = cancelled.waitData(1, payload, stillRunning.get_token()); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-registry-test.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto data(uint64_t id, std::string_view bytes) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | if (size > limit) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | cv.wait(lock, stop, [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | auto const it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto acknowledge(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!enqueue(std::move(msg))) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | if (streams.contains(id) && acknowledged.contains(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 150 | if (removed) cv.notify_all(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | void acknowledgementSent(uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 208 | auto terminal(uint64_t id, bool abort) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:44:71: error: 128 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:82:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | auto it = sessions.find(std::string(workerId)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:92:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 92 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:107:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:130:30: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 130 | for (auto & [id, session] : sessions) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:32:38: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | [[nodiscard]] auto open(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:51:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 51 | auto it = streams.find(frame.stream_id()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | if (!cancelled.contains(frame.stream_id())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:101: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | auto pending = [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::_Deque_iterator nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | std::ranges::find_if queue nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:111:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | auto it = pending(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:135:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:168:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | [[nodiscard]] auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:171:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 171 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:9:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 9 | int main() nix-grpc-store-clang-tidy-0.2.2> | ~~~ ^ nix-grpc-store-clang-tidy-0.2.2> | auto -> int nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:14:57: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 14 | assert(!registry.registerWorker("worker", "worker", [] {})); // standby nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> /nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert' nix-grpc-store-clang-tidy-0.2.2> 138 | ((__VA_ARGS__) \ nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:16:51: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 16 | assert(!registry.registerWorker("", "worker", [] {})); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> /nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert' nix-grpc-store-clang-tidy-0.2.2> 138 | ((__VA_ARGS__) \ nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:17:56: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 17 | assert(!registry.registerWorker("other", "worker", [] {})); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> /nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert' nix-grpc-store-clang-tidy-0.2.2> 138 | ((__VA_ARGS__) \ nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:18:115: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 18 | assert(!registry.registerWorker(std::string_view("worker\0extra", 12), std::string_view("worker\0extra", 12), [] {})); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> /nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert' nix-grpc-store-clang-tidy-0.2.2> 138 | ((__VA_ARGS__) \ nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:22:53: error: no header providing "nixgrpc::ReverseTransport" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 8 | nix-grpc-store-clang-tidy-0.2.2> 9 | int main() nix-grpc-store-clang-tidy-0.2.2> 10 | { nix-grpc-store-clang-tidy-0.2.2> 11 | nixgrpc::ReverseRegistry registry; nix-grpc-store-clang-tidy-0.2.2> 12 | int firstCancelled = 0; nix-grpc-store-clang-tidy-0.2.2> 13 | int secondCancelled = 0; nix-grpc-store-clang-tidy-0.2.2> 14 | assert(!registry.registerWorker("worker", "worker", [] {})); // standby nix-grpc-store-clang-tidy-0.2.2> 15 | registry.setActive(true); nix-grpc-store-clang-tidy-0.2.2> 16 | assert(!registry.registerWorker("", "worker", [] {})); nix-grpc-store-clang-tidy-0.2.2> 17 | assert(!registry.registerWorker("other", "worker", [] {})); nix-grpc-store-clang-tidy-0.2.2> 18 | assert(!registry.registerWorker(std::string_view("worker\0extra", 12), std::string_view("worker\0extra", 12), [] {})); nix-grpc-store-clang-tidy-0.2.2> 19 | assert(!registry.registerWorker("worker", "worker", {})); nix-grpc-store-clang-tidy-0.2.2> 20 | assert(!registry.find("worker")); nix-grpc-store-clang-tidy-0.2.2> 21 | nix-grpc-store-clang-tidy-0.2.2> 22 | auto firstTransport = std::make_shared(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:23:19: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | auto first = *registry.registerWorker("worker", "worker", [&] { nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> 24 | ++firstCancelled; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> 25 | // A session teardown can synchronously inspect the replacement. nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> 26 | assert(registry.find("worker")); nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> 27 | }, {}, firstTransport); nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:23:63: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | auto first = *registry.registerWorker("worker", "worker", [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:31:19: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 31 | auto other = *registry.registerWorker("other", "other", [] {}); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:31:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 31 | auto other = *registry.registerWorker("other", "other", [] {}); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:32:20: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto second = *registry.registerWorker("worker", "worker", [&] { ++secondCancelled; }); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:32:64: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto second = *registry.registerWorker("worker", "worker", [&] { ++secondCancelled; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:35:18: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 7 | nix::remote::ReverseWorkerMsg stale; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:50:19: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 50 | auto third = *registry.registerWorker("worker", "worker", [&] { ++thirdCancelled; }); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:50:63: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 50 | auto third = *registry.registerWorker("worker", "worker", [&] { ++thirdCancelled; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:58:25: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | auto normalClose = *registry.registerWorker("worker", "worker", [&] { ++normalCloseCancelled; }); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:58:69: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | auto normalClose = *registry.registerWorker("worker", "worker", [&] { ++normalCloseCancelled; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:64:17: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | auto old = *registry.registerWorker("worker", "worker", [] {}); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:64:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | auto old = *registry.registerWorker("worker", "worker", [] {}); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:65:23: error: variable name 'go' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | std::atomic go{false}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:66:26: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 66 | std::thread closeOld([&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:73:25: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto replacement = *registry.registerWorker("worker", "worker", [] {}); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-registry-test.cc:73:69: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto replacement = *registry.registerWorker("worker", "worker", [] {}); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-responses-test.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto data(uint64_t id, std::string_view bytes) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | if (size > limit) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | cv.wait(lock, stop, [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | auto const it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto acknowledge(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!enqueue(std::move(msg))) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | if (streams.contains(id) && acknowledged.contains(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 150 | if (removed) cv.notify_all(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | void acknowledgementSent(uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 208 | auto terminal(uint64_t id, bool abort) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:32:38: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | [[nodiscard]] auto open(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:51:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 51 | auto it = streams.find(frame.stream_id()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | if (!cancelled.contains(frame.stream_id())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:101: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | auto pending = [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::_Deque_iterator nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | std::ranges::find_if queue nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:111:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | auto it = pending(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:135:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:168:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | [[nodiscard]] auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:171:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 171 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-responses-test.cc:8:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 8 | int main() nix-grpc-store-clang-tidy-0.2.2> | ~~~ ^ nix-grpc-store-clang-tidy-0.2.2> | auto -> int nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-responses-test.cc:13:18: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 6 | #include "reverse-responses.hh" nix-grpc-store-clang-tidy-0.2.2> 7 | nix-grpc-store-clang-tidy-0.2.2> 8 | int main() nix-grpc-store-clang-tidy-0.2.2> 9 | { nix-grpc-store-clang-tidy-0.2.2> 10 | nixgrpc::ReverseResponses replies; nix-grpc-store-clang-tidy-0.2.2> 11 | assert(!replies.open(0)); nix-grpc-store-clang-tidy-0.2.2> 12 | assert(replies.open(1) && !replies.open(1)); nix-grpc-store-clang-tidy-0.2.2> 13 | nix::remote::ReverseWorkerMsg response; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-responses-test.cc:23:60: error: no header providing "nixgrpc::ReverseFrames" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 6 | response.mutable_data()->set_data(std::string(nixgrpc::ReverseFrames::maxFrameBytes + 1, 'x')); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-responses-test.cc:27:53: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | response.mutable_finish()->set_code(static_cast(grpc::StatusCode::OK)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-responses-test.cc:27:69: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | response.mutable_finish()->set_code(static_cast(grpc::StatusCode::OK)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-responses-test.cc:40:41: error: 123 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 40 | response.mutable_finish()->set_code(123); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-responses-test.cc:63:5: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | size_t queued = 0; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-responses-test.cc:77:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | std::jthread waiter([&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-responses-test.cc:79:37: error: 6 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 79 | received = replies.waitTake(6, isolated, stop.get_token()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-responses-test.cc:80:40: error: 6 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 80 | && isolated.stream_id() == 6 && isolated.data().data() == "only six"; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-responses-test.cc:82:28: error: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | response.set_stream_id(5); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-responses-test.cc:85:28: error: 6 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 85 | response.set_stream_id(6); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/dispatcher-session-test.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 12 | #include nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> 13 | #include nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 90 | std::chrono::system_clock::time_point credentialExpiresAt{}; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:323:61: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 323 | lastAssignId = (static_cast(entropy()) << 32) | entropy(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 371 | auto const it = workerIds.find(std::string(addr)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/dispatcher-session-test.cc:14:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 14 | int main() nix-grpc-store-clang-tidy-0.2.2> | ~~~ ^ nix-grpc-store-clang-tidy-0.2.2> | auto -> int nix-grpc-store-clang-tidy-0.2.2> ../tests/dispatcher-session-test.cc:70:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 70 | if (msg.has_assigned()) directAssigned = !msg.assigned().reverse(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/dispatcher-session-test.cc:72:8: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 72 | }, [] {}); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/dispatcher-session-test.cc:87:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | .send = [](const nix::remote::SchedCmd &) { return true; }, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/dispatcher-session-test.cc:129:106: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 129 | auto follower = dispatcher.connectClient([](const nix::remote::SchedMsg &) -> bool { return true; }, [] {}); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/dispatcher-session-test.cc:150:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 150 | .send = [&](const nix::remote::SchedCmd & cmd) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/dispatcher-session-test.cc:168:10: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 5 | for (uint32_t const version : {0U, nixgrpc::reverseProtocolVersion + 1}) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/dispatcher-session-test.cc:182:51: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 182 | auto reverseClient = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {}); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/dispatcher-session-test.cc:182:103: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 182 | auto reverseClient = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {}); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/dispatcher-session-test.cc:190:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 190 | .send = [](const nix::remote::SchedCmd &) { return true; }, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/client/channel.cc nix-grpc-store-clang-tidy-0.2.2> [1/1] (1/2) Processing file /build/source/src/client/channel.cc. nix-grpc-store-clang-tidy-0.2.2> [1/1] (2/2) Processing file /build/source/src/client/channel.cc. nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-roundtrip-test.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (RAND_bytes(reinterpret_cast(key.data()), static_cast(key.size())) != 1) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:62:95: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:96:61: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | result.push_back(static_cast(size >> (i * 8))); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:46: error: 2 adjacent parameters of 'verify' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:183:107: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:250:9: error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 250 | unsigned char mac[EVP_MAX_MD_SIZE]; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast(key.size()), nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | ( nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | == nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:86: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 258 | return std::string(reinterpret_cast(mac), macBytes); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto data(uint64_t id, std::string_view bytes) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | if (size > limit) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | cv.wait(lock, stop, [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | auto const it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto acknowledge(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!enqueue(std::move(msg))) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | if (streams.contains(id) && acknowledged.contains(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 150 | if (removed) cv.notify_all(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | void acknowledgementSent(uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 208 | auto terminal(uint64_t id, bool abort) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:50:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 50 | auto const id = frame.stream_id(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:68:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 68 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != 0u) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 75 | return Event{.kind = Event::Kind::cancel, .streamId = id}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:109:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | if (cancelledIds.erase(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | if (cancelledIds.erase(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (!streams.erase(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | == 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (!streams.erase(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:44:71: error: 128 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:82:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | auto it = sessions.find(std::string(workerId)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:92:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 92 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:107:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:130:30: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 130 | for (auto & [id, session] : sessions) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:32:38: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | [[nodiscard]] auto open(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:51:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 51 | auto it = streams.find(frame.stream_id()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | if (!cancelled.contains(frame.stream_id())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:101: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | auto pending = [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::_Deque_iterator nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | std::ranges::find_if queue nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:111:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | auto it = pending(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:135:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:168:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | [[nodiscard]] auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:171:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 171 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:10:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 10 | int main() nix-grpc-store-clang-tidy-0.2.2> | ~~~ ^ nix-grpc-store-clang-tidy-0.2.2> | auto -> int nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:12:20: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 4 | #include "reverse-capability.hh" nix-grpc-store-clang-tidy-0.2.2> 5 | #include "reverse-frames.hh" nix-grpc-store-clang-tidy-0.2.2> 6 | #include "reverse-inbound.hh" nix-grpc-store-clang-tidy-0.2.2> 7 | #include "reverse-registry.hh" nix-grpc-store-clang-tidy-0.2.2> 8 | #include "reverse-responses.hh" nix-grpc-store-clang-tidy-0.2.2> 9 | nix-grpc-store-clang-tidy-0.2.2> 10 | int main() nix-grpc-store-clang-tidy-0.2.2> 11 | { nix-grpc-store-clang-tidy-0.2.2> 12 | using nixgrpc::Caller; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:18:20: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 4 | #include "reverse-capability.hh" nix-grpc-store-clang-tidy-0.2.2> 5 | #include "reverse-frames.hh" nix-grpc-store-clang-tidy-0.2.2> 6 | #include "reverse-inbound.hh" nix-grpc-store-clang-tidy-0.2.2> 7 | #include "reverse-registry.hh" nix-grpc-store-clang-tidy-0.2.2> 8 | #include "reverse-responses.hh" nix-grpc-store-clang-tidy-0.2.2> 9 | nix-grpc-store-clang-tidy-0.2.2> 10 | int main() nix-grpc-store-clang-tidy-0.2.2> 11 | { nix-grpc-store-clang-tidy-0.2.2> 12 | using nixgrpc::Caller; nix-grpc-store-clang-tidy-0.2.2> 13 | using nixgrpc::ReverseCapability; nix-grpc-store-clang-tidy-0.2.2> 14 | using nixgrpc::ReverseFrames; nix-grpc-store-clang-tidy-0.2.2> 15 | using nixgrpc::ReverseInbound; nix-grpc-store-clang-tidy-0.2.2> 16 | using nixgrpc::ReverseRegistry; nix-grpc-store-clang-tidy-0.2.2> 17 | using nixgrpc::ReverseResponses; nix-grpc-store-clang-tidy-0.2.2> 18 | using nixgrpc::Role; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:25:59: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 25 | auto handle = registry.registerWorker(worker, worker, [] {}, *key); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:33:91: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 33 | "BuildDerivation", writer, "assigned.drv", 42, 0); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:35:18: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 4 | nix::remote::ReverseOpen start; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:38:34: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 3 | assert(outgoing.open(1, std::move(start)) && outgoing.data(1, "request bytes") && outgoing.halfClose(1)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:40:18: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 40 | nix::remote::ReverseFarmMsg toWorker; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:44:18: error: no header providing "nix::remote::BuildDerivationRequest" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | nix::remote::BuildDerivationRequest request; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:46:27: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 46 | request.set_assign_id(42); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:48:27: error: 43 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 48 | request.set_assign_id(43); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:50:39: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 50 | assert(outgoing.take(toWorker) && incoming.accept(toWorker)->kind == ReverseInbound::Event::Kind::data); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> /nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert' nix-grpc-store-clang-tidy-0.2.2> 138 | ((__VA_ARGS__) \ nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:51:39: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 51 | assert(outgoing.take(toWorker) && incoming.accept(toWorker)->kind == ReverseInbound::Event::Kind::halfClose); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> /nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert' nix-grpc-store-clang-tidy-0.2.2> 138 | ((__VA_ARGS__) \ nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:54:18: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 54 | nix::remote::ReverseWorkerMsg fromWorker; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:58:55: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | fromWorker.mutable_finish()->set_code(static_cast(grpc::StatusCode::OK)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:58:71: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | fromWorker.mutable_finish()->set_code(static_cast(grpc::StatusCode::OK)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-roundtrip-test.cc:68:64: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 68 | auto replacement = registry.registerWorker(worker, worker, [] {}, *nextKey); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-capability-test.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (RAND_bytes(reinterpret_cast(key.data()), static_cast(key.size())) != 1) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:62:95: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:96:61: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | result.push_back(static_cast(size >> (i * 8))); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:46: error: 2 adjacent parameters of 'verify' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:183:107: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:250:9: error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 250 | unsigned char mac[EVP_MAX_MD_SIZE]; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast(key.size()), nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | ( nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | == nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:86: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 258 | return std::string(reinterpret_cast(mac), macBytes); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:7:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 7 | int main() nix-grpc-store-clang-tidy-0.2.2> | ~~~ ^ nix-grpc-store-clang-tidy-0.2.2> | auto -> int nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:9:20: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 5 | #include "reverse-capability.hh" nix-grpc-store-clang-tidy-0.2.2> 6 | nix-grpc-store-clang-tidy-0.2.2> 7 | int main() nix-grpc-store-clang-tidy-0.2.2> 8 | { nix-grpc-store-clang-tidy-0.2.2> 9 | using nixgrpc::Caller; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:11:20: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 5 | #include "reverse-capability.hh" nix-grpc-store-clang-tidy-0.2.2> 6 | nix-grpc-store-clang-tidy-0.2.2> 7 | int main() nix-grpc-store-clang-tidy-0.2.2> 8 | { nix-grpc-store-clang-tidy-0.2.2> 9 | using nixgrpc::Caller; nix-grpc-store-clang-tidy-0.2.2> 10 | using nixgrpc::ReverseCapability; nix-grpc-store-clang-tidy-0.2.2> 11 | using nixgrpc::Role; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:19:5: error: 'const auto worker' can be declared as 'const auto *const worker' [readability-qualified-auto,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 19 | auto const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef"; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | const auto *const nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:20:56: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 20 | auto token = ReverseCapability::mint(*key, worker, 7, 42, "BuildDerivation", writer, "abc.drv", 93, 0, now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:20:59: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 20 | auto token = ReverseCapability::mint(*key, worker, 7, 42, "BuildDerivation", writer, "abc.drv", 93, 0, now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:20:101: error: 93 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 20 | auto token = ReverseCapability::mint(*key, worker, 7, 42, "BuildDerivation", writer, "abc.drv", 93, 0, now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:22:69: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 22 | auto verified = ReverseCapability::verify(*key, *token, worker, 7, 42, "BuildDerivation", now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:22:72: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 22 | auto verified = ReverseCapability::verify(*key, *token, worker, 7, 42, "BuildDerivation", now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:25:18: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 5 | nix::remote::ReverseOpen open; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:31:18: error: no header providing "nix::remote::BuildDerivationRequest" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 31 | nix::remote::BuildDerivationRequest request; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:33:27: error: 93 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 33 | request.set_assign_id(93); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:35:27: error: 94 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 35 | request.set_assign_id(94); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:37:27: error: 93 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 37 | request.set_assign_id(93); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:38:40: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 3 | request.set_build_mode(static_cast(nix::bmRepair)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:38:55: error: no header providing "nix::bmRepair" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 3 | request.set_build_mode(static_cast(nix::bmRepair)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:67:60: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | auto readToken = ReverseCapability::mint(*key, worker, 7, 44, "StoreInfo", reader, {}, 0, 0, now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:67:63: error: 44 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | auto readToken = ReverseCapability::mint(*key, worker, 7, 44, "StoreInfo", reader, {}, 0, 0, now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:69:73: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 69 | auto readBack = ReverseCapability::verify(*key, *readToken, worker, 7, 44, "StoreInfo", now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:69:76: error: 44 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 69 | auto readBack = ReverseCapability::verify(*key, *readToken, worker, 7, 44, "StoreInfo", now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:71:62: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 71 | auto importToken = ReverseCapability::mint(*key, worker, 7, 45, "AddMultipleToStore", writer, {}, 0, 0, now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:71:65: error: 45 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 71 | auto importToken = ReverseCapability::mint(*key, worker, 7, 45, "AddMultipleToStore", writer, {}, 0, 0, now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:73:73: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto import = ReverseCapability::verify(*key, *importToken, worker, 7, 45, "AddMultipleToStore", now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:73:76: error: 45 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto import = ReverseCapability::verify(*key, *importToken, worker, 7, 45, "AddMultipleToStore", now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:75:18: error: no header providing "nix::remote::AddMultipleChunk" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | nix::remote::AddMultipleChunk first; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:80:62: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 80 | auto uploadToken = ReverseCapability::mint(*key, worker, 7, 47, "UploadBuildInputs", writer, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:80:65: error: 47 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 80 | auto uploadToken = ReverseCapability::mint(*key, worker, 7, 47, "UploadBuildInputs", writer, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:81:59: error: 93 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | "abc.drv", 93, 0, now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:83:73: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | auto upload = ReverseCapability::verify(*key, *uploadToken, worker, 7, 47, "UploadBuildInputs", now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:83:76: error: 47 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | auto upload = ReverseCapability::verify(*key, *uploadToken, worker, 7, 47, "UploadBuildInputs", now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:97:69: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 97 | auto trustedUploadToken = ReverseCapability::mint(*key, worker, 7, 48, "UploadBuildInputs", trusted, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:97:72: error: 48 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 97 | auto trustedUploadToken = ReverseCapability::mint(*key, worker, 7, 48, "UploadBuildInputs", trusted, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:98:66: error: 93 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 98 | "abc.drv", 93, 0, now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:100:87: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 100 | auto trustedUpload = ReverseCapability::verify(*key, *trustedUploadToken, worker, 7, 48, "UploadBuildInputs", now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:100:90: error: 48 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 100 | auto trustedUpload = ReverseCapability::verify(*key, *trustedUploadToken, worker, 7, 48, "UploadBuildInputs", now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:105:24: error: no header providing "std::nullopt" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 3 | noRole.role = std::nullopt; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:109:65: error: 7 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | auto anonymousToken = ReverseCapability::mint(*key, worker, 7, 46, "StoreInfo", anonymous, {}, 0, 0, now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-capability-test.cc:109:68: error: 46 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | auto anonymousToken = ReverseCapability::mint(*key, worker, 7, 46, "StoreInfo", anonymous, {}, 0, 0, now); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/daemon/dispatcher.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.cc:175:24: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 175 | if (auto const it = workers.find(static_cast(wid)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.cc:576:47: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 576 | revokeOn(*wid, cancel.drv_path(), core.entry(*drv)->assignId); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.cc:600:33: error: 2 adjacent parameters of 'ownsAssignment' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 600 | auto Dispatcher::ownsAssignment(std::string_view workerAddr, std::string_view drvPath, uint64_t assignId) const -> bool nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.cc:600:50: note: the first parameter in the range is 'workerAddr' nix-grpc-store-clang-tidy-0.2.2> 600 | auto Dispatcher::ownsAssignment(std::string_view workerAddr, std::string_view drvPath, uint64_t assignId) const -> bool nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.cc:600:79: note: the last parameter in the range is 'drvPath' nix-grpc-store-clang-tidy-0.2.2> 600 | auto Dispatcher::ownsAssignment(std::string_view workerAddr, std::string_view drvPath, uint64_t assignId) const -> bool nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.cc:634:16: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 634 | auto const it = core.findDrv(drvPath); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.cc:658:5: error: replace loop by 'std::ranges::any_of()' [readability-use-anyofallof,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 658 | for (const auto & [wid, worker] : workers) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.cc:666:36: error: 2 adjacent parameters of 'podOwnsAssignment' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 666 | auto Dispatcher::podOwnsAssignment(std::string_view podId, std::string_view drvPath, uint64_t assignId) const -> bool nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.cc:666:53: note: the first parameter in the range is 'podId' nix-grpc-store-clang-tidy-0.2.2> 666 | auto Dispatcher::podOwnsAssignment(std::string_view podId, std::string_view drvPath, uint64_t assignId) const -> bool nix-grpc-store-clang-tidy-0.2.2> | ^~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.cc:666:77: note: the last parameter in the range is 'drvPath' nix-grpc-store-clang-tidy-0.2.2> 666 | auto Dispatcher::podOwnsAssignment(std::string_view podId, std::string_view drvPath, uint64_t assignId) const -> bool nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 12 | #include nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> 13 | #include nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 90 | std::chrono::system_clock::time_point credentialExpiresAt{}; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:323:61: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 323 | lastAssignId = (static_cast(entropy()) << 32) | entropy(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 371 | auto const it = workerIds.find(std::string(addr)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-upload-test.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (RAND_bytes(reinterpret_cast(key.data()), static_cast(key.size())) != 1) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:62:95: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:96:61: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | result.push_back(static_cast(size >> (i * 8))); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:46: error: 2 adjacent parameters of 'verify' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:183:107: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:250:9: error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 250 | unsigned char mac[EVP_MAX_MD_SIZE]; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast(key.size()), nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | ( nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | == nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:86: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 258 | return std::string(reinterpret_cast(mac), macBytes); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto data(uint64_t id, std::string_view bytes) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | if (size > limit) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | cv.wait(lock, stop, [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | auto const it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto acknowledge(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!enqueue(std::move(msg))) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | if (streams.contains(id) && acknowledged.contains(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 150 | if (removed) cv.notify_all(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | void acknowledgementSent(uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 208 | auto terminal(uint64_t id, bool abort) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:20: error: variable name 'ok' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:45: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:88: error: rvalue reference parameter 'frame' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 33 | if (assigned && !assigned()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:35:13: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 35 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 42 | if (!ok) cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:49:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 68 | if (closed) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 79 | if (ended || !chunks.empty()) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:80:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 80 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | if (chunks.empty()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:92:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 92 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:103:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 103 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 113 | if (!ended || closed || !chunks.empty()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:120:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 120 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:129:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 129 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | if (failed || bytes.empty() || !consume) return fail(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:53:37: error: result of a `data()` call may not be null terminated, provide size information to the callee to prevent potential issues [bugprone-suspicious-stringview-data-usage,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | buffer.append(bytes.data(), count); nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~^~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | for (unsigned i = 0; i < 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:58:90: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:58:100: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 59 | if (length == 0 || length > maxChunkBytes) return fail(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast(*expected)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 66 | return fail(); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:7:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 7 | int main() nix-grpc-store-clang-tidy-0.2.2> | ~~~ ^ nix-grpc-store-clang-tidy-0.2.2> | auto -> int nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:9:25: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 4 | #include "reverse-upload.hh" nix-grpc-store-clang-tidy-0.2.2> 5 | #include "reverse-upload-pipe.hh" nix-grpc-store-clang-tidy-0.2.2> 6 | nix-grpc-store-clang-tidy-0.2.2> 7 | int main() nix-grpc-store-clang-tidy-0.2.2> 8 | { nix-grpc-store-clang-tidy-0.2.2> 9 | auto key = nixgrpc::ReverseCapability::newKey(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:12:5: error: variable 'writer' of type 'nixgrpc::Caller' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 12 | nixgrpc::Caller writer{.name = "client", .role = nixgrpc::Role::write, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:12:14: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 4 | #include "reverse-upload.hh" nix-grpc-store-clang-tidy-0.2.2> 5 | #include "reverse-upload-pipe.hh" nix-grpc-store-clang-tidy-0.2.2> 6 | nix-grpc-store-clang-tidy-0.2.2> 7 | int main() nix-grpc-store-clang-tidy-0.2.2> 8 | { nix-grpc-store-clang-tidy-0.2.2> 9 | auto key = nixgrpc::ReverseCapability::newKey(); nix-grpc-store-clang-tidy-0.2.2> 10 | assert(key); nix-grpc-store-clang-tidy-0.2.2> 11 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef"; nix-grpc-store-clang-tidy-0.2.2> 12 | nixgrpc::Caller writer{.name = "client", .role = nixgrpc::Role::write, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:12:63: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 4 | #include "reverse-upload.hh" nix-grpc-store-clang-tidy-0.2.2> 5 | #include "reverse-upload-pipe.hh" nix-grpc-store-clang-tidy-0.2.2> 6 | nix-grpc-store-clang-tidy-0.2.2> 7 | int main() nix-grpc-store-clang-tidy-0.2.2> 8 | { nix-grpc-store-clang-tidy-0.2.2> 9 | auto key = nixgrpc::ReverseCapability::newKey(); nix-grpc-store-clang-tidy-0.2.2> 10 | assert(key); nix-grpc-store-clang-tidy-0.2.2> 11 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef"; nix-grpc-store-clang-tidy-0.2.2> 12 | nixgrpc::Caller writer{.name = "client", .role = nixgrpc::Role::write, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:14:116: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 14 | auto token = nixgrpc::ReverseCapability::mint(*key, worker, 1, 1, "UploadBuildInputs", writer, "assigned.drv", 42); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:19:18: error: no header providing "nix::remote::UploadBuildInputsChunk" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 4 | #include "reverse-upload.hh" nix-grpc-store-clang-tidy-0.2.2> 5 | #include "reverse-upload-pipe.hh" nix-grpc-store-clang-tidy-0.2.2> 6 | nix-grpc-store-clang-tidy-0.2.2> 7 | int main() nix-grpc-store-clang-tidy-0.2.2> 8 | { nix-grpc-store-clang-tidy-0.2.2> 9 | auto key = nixgrpc::ReverseCapability::newKey(); nix-grpc-store-clang-tidy-0.2.2> 10 | assert(key); nix-grpc-store-clang-tidy-0.2.2> 11 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef"; nix-grpc-store-clang-tidy-0.2.2> 12 | nixgrpc::Caller writer{.name = "client", .role = nixgrpc::Role::write, nix-grpc-store-clang-tidy-0.2.2> 13 | .kind = nixgrpc::Caller::Kind::named}; nix-grpc-store-clang-tidy-0.2.2> 14 | auto token = nixgrpc::ReverseCapability::mint(*key, worker, 1, 1, "UploadBuildInputs", writer, "assigned.drv", 42); nix-grpc-store-clang-tidy-0.2.2> 15 | assert(token); nix-grpc-store-clang-tidy-0.2.2> 16 | auto delegated = nixgrpc::ReverseCapability::verify(*key, *token, worker, 1, 1, "UploadBuildInputs"); nix-grpc-store-clang-tidy-0.2.2> 17 | assert(delegated); nix-grpc-store-clang-tidy-0.2.2> 18 | nix-grpc-store-clang-tidy-0.2.2> 19 | nix::remote::UploadBuildInputsChunk first; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:21:25: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 21 | first.set_assign_id(42); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:24:25: error: 43 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 24 | first.set_assign_id(43); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:26:25: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 26 | first.set_assign_id(42); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:39:24: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 39 | next.set_assign_id(42); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:52:119: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 52 | auto buildToken = nixgrpc::ReverseCapability::mint(*key, worker, 1, 2, "BuildDerivation", writer, "assigned.drv", 42); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:62:50: error: 70000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | follow.mutable_chunk()->set_data(std::string(70000, 'z')); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:65:41: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | auto const length = static_cast(part.size()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:66:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 66 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:66:87: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 66 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:66:97: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 66 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:70:5: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | size_t count = 0; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:71:20: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 71 | auto consume = [&](nix::remote::UploadBuildInputsChunk && part) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:71:63: error: rvalue reference parameter 'part' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 71 | auto consume = [&](nix::remote::UploadBuildInputsChunk && part) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:73:93: error: 70000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | return count == 1 ? part.chunk().data() == "header" : part.chunk().data().size() == 70000; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:75:61: error: 16381 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | for (size_t offset = 0; offset < wire.size(); offset += 16381) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:75:67: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | for (size_t offset = 0; offset < wire.size(); offset += 16381) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 76 | assert(decoder.feed(std::string_view(wire).substr(offset, 16381), consume)); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:86:32: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 86 | assert(!aborted.feed(wire, [](nix::remote::UploadBuildInputsChunk &&) { return false; })); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> /nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert' nix-grpc-store-clang-tidy-0.2.2> 138 | ((__VA_ARGS__) \ nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:86:73: error: rvalue reference parameter '' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 86 | assert(!aborted.feed(wire, [](nix::remote::UploadBuildInputsChunk &&) { return false; })); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:89:26: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 89 | follow.set_assign_id(42); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:91:5: error: variable 'wireNext' of type 'std::string' (aka 'basic_string') can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 91 | std::string wireNext = follow.SerializeAsString(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:95:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | for (unsigned i = 0; i < 4; ++i) malformed.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:95:92: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | for (unsigned i = 0; i < 4; ++i) malformed.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:95:102: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | for (unsigned i = 0; i < 4; ++i) malformed.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:98:41: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 98 | assert(!invalidNext.feed(malformed, [](nix::remote::UploadBuildInputsChunk &&) { return true; })); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> /nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert' nix-grpc-store-clang-tidy-0.2.2> 138 | ((__VA_ARGS__) \ nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:98:82: error: rvalue reference parameter '' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 98 | assert(!invalidNext.feed(malformed, [](nix::remote::UploadBuildInputsChunk &&) { return true; })); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:106:53: error: 70000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 106 | largePart.mutable_chunk()->set_data(std::string(70000, 'z')); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:108:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 108 | auto push = [&](std::string_view data) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:111:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:111:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:111:99: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:113:67: error: 16381 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 113 | for (size_t offset = 0; offset < framed.size(); offset += 16381) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:113:73: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 113 | for (size_t offset = 0; offset < framed.size(); offset += 16381) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 114 | assert(large.feed(std::string_view(framed).substr(offset, 16381), nix-grpc-store-clang-tidy-0.2.2> 115 | [&](nix::remote::UploadBuildInputsChunk &&) { ++parts; return true; })); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:114:13: error: side effect in assert() condition discarded in release builds [bugprone-assert-side-effect,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 114 | assert(large.feed(std::string_view(framed).substr(offset, 16381), nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:114:20: error: side effects in the 1st macro argument '__VA_ARGS__' are repeated in macro expansion [bugprone-macro-repeated-side-effects,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 114 | assert(large.feed(std::string_view(framed).substr(offset, 16381), nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> /nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:137:13: note: macro 'assert' defined here nix-grpc-store-clang-tidy-0.2.2> 137 | # define assert(...) \ nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:115:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 115 | [&](nix::remote::UploadBuildInputsChunk &&) { ++parts; return true; })); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> /nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert' nix-grpc-store-clang-tidy-0.2.2> 138 | ((__VA_ARGS__) \ nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:115:73: error: rvalue reference parameter '' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 115 | [&](nix::remote::UploadBuildInputsChunk &&) { ++parts; return true; })); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:118:28: error: 70 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 118 | for (size_t i = 0; i < 70; ++i) push(laterWire); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:118:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 118 | for (size_t i = 0; i < 70; ++i) push(laterWire); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:125:18: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 125 | auto frame = [](const nix::remote::UploadBuildInputsChunk & chunk) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::string nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:129:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 129 | for (unsigned i = 0; i < 4; ++i) out.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:129:86: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 129 | for (unsigned i = 0; i < 4; ++i) out.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:129:96: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 129 | for (unsigned i = 0; i < 4; ++i) out.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-upload-test.cc:136:28: error: 80 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 136 | for (size_t i = 0; i < 80; ++i) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-inbound-test.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (RAND_bytes(reinterpret_cast(key.data()), static_cast(key.size())) != 1) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:62:95: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:96:61: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | result.push_back(static_cast(size >> (i * 8))); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:46: error: 2 adjacent parameters of 'verify' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:183:107: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:250:9: error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 250 | unsigned char mac[EVP_MAX_MD_SIZE]; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast(key.size()), nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | ( nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | == nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:86: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 258 | return std::string(reinterpret_cast(mac), macBytes); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto data(uint64_t id, std::string_view bytes) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | if (size > limit) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | cv.wait(lock, stop, [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | auto const it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto acknowledge(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!enqueue(std::move(msg))) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | if (streams.contains(id) && acknowledged.contains(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 150 | if (removed) cv.notify_all(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | void acknowledgementSent(uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 208 | auto terminal(uint64_t id, bool abort) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:50:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 50 | auto const id = frame.stream_id(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:68:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 68 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != 0u) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 75 | return Event{.kind = Event::Kind::cancel, .streamId = id}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:109:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | if (cancelledIds.erase(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | if (cancelledIds.erase(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (!streams.erase(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | == 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (!streams.erase(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-inbound-test.cc:6:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 6 | int main() nix-grpc-store-clang-tidy-0.2.2> | ~~~ ^ nix-grpc-store-clang-tidy-0.2.2> | auto -> int nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-inbound-test.cc:8:20: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 4 | #include "reverse-inbound.hh" nix-grpc-store-clang-tidy-0.2.2> 5 | nix-grpc-store-clang-tidy-0.2.2> 6 | int main() nix-grpc-store-clang-tidy-0.2.2> 7 | { nix-grpc-store-clang-tidy-0.2.2> 8 | using nixgrpc::Caller; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-inbound-test.cc:9:20: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 4 | #include "reverse-inbound.hh" nix-grpc-store-clang-tidy-0.2.2> 5 | nix-grpc-store-clang-tidy-0.2.2> 6 | int main() nix-grpc-store-clang-tidy-0.2.2> 7 | { nix-grpc-store-clang-tidy-0.2.2> 8 | using nixgrpc::Caller; nix-grpc-store-clang-tidy-0.2.2> 9 | using nixgrpc::ReverseCapability; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-inbound-test.cc:11:20: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 4 | #include "reverse-inbound.hh" nix-grpc-store-clang-tidy-0.2.2> 5 | nix-grpc-store-clang-tidy-0.2.2> 6 | int main() nix-grpc-store-clang-tidy-0.2.2> 7 | { nix-grpc-store-clang-tidy-0.2.2> 8 | using nixgrpc::Caller; nix-grpc-store-clang-tidy-0.2.2> 9 | using nixgrpc::ReverseCapability; nix-grpc-store-clang-tidy-0.2.2> 10 | using nixgrpc::ReverseInbound; nix-grpc-store-clang-tidy-0.2.2> 11 | using nixgrpc::Role; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-inbound-test.cc:15:5: error: 'const auto worker' can be declared as 'const auto *const worker' [readability-qualified-auto,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 15 | auto const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef"; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | const auto *const nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-inbound-test.cc:20:18: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 4 | nix::remote::ReverseFarmMsg open; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-inbound-test.cc:49:56: error: no header providing "nixgrpc::ReverseFrames" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 4 | data.mutable_data()->set_data(std::string(nixgrpc::ReverseFrames::maxFrameBytes + 1, 'x')); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/dispatcher-bench.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 12 | #include nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> 13 | #include nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 90 | std::chrono::system_clock::time_point credentialExpiresAt{}; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:323:61: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 323 | lastAssignId = (static_cast(entropy()) << 32) | entropy(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 371 | auto const it = workerIds.find(std::string(addr)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-worker-test.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (RAND_bytes(reinterpret_cast(key.data()), static_cast(key.size())) != 1) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:62:95: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:96:61: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | result.push_back(static_cast(size >> (i * 8))); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:46: error: 2 adjacent parameters of 'verify' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:183:107: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:250:9: error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 250 | unsigned char mac[EVP_MAX_MD_SIZE]; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast(key.size()), nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | ( nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | == nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:86: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 258 | return std::string(reinterpret_cast(mac), macBytes); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto data(uint64_t id, std::string_view bytes) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | if (size > limit) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | cv.wait(lock, stop, [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | auto const it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto acknowledge(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!enqueue(std::move(msg))) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | if (streams.contains(id) && acknowledged.contains(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 150 | if (removed) cv.notify_all(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | void acknowledgementSent(uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 208 | auto terminal(uint64_t id, bool abort) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:63:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 63 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:65:14: error: variable 'minRole' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | Role minRole; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:81:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | return {{grpc::StatusCode::UNIMPLEMENTED, "unknown reverse method"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:85:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 85 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:91:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 91 | return {{grpc::StatusCode::INVALID_ARGUMENT, "upload does not accept a build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:95:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:99:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no matching live assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:104:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unexpected build assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:109:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session unavailable"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:115:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 115 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session changed"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:122:16: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open), nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> 123 | std::string(drvPath), assignId}}; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:122:43: error: use designated initializer list to initialize 'Prepared' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open), nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .session= .open= nix-grpc-store-clang-tidy-0.2.2> 123 | std::string(drvPath), assignId}}; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .drvPath= .assignId= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:33:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 33 | struct Prepared nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:185:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 185 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:189:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 189 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:193:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 193 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:197:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 197 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned build route"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:202:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 202 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound build assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:214:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 214 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:218:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 218 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:222:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 222 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned upload route"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:227:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 227 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:233:11: error: member 'auth' of type 'Auth &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 233 | Auth &auth; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:234:22: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 234 | ReverseRegistry ®istry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:44:71: error: 128 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:82:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | auto it = sessions.find(std::string(workerId)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:92:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 92 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:107:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:130:30: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 130 | for (auto & [id, session] : sessions) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:49:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:56:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:57:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:59:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:60:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:61:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 61 | auto const id = session->transport->nextStreamId.fetch_add(1); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:62:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:64:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:65:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | if (!selection.prepared || selection.prepared->session != session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 66 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker changed during selection"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:67:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | if (request.ByteSizeLong() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 68 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:70:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 70 | if (bytes.size() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 71 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:72:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:75:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (!status.ok()) return status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:77:16: error: class 'Release' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:77:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> 78 | ReverseTransport & transport; nix-grpc-store-clang-tidy-0.2.2> 79 | uint64_t id; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> | {} nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:78:32: error: member 'transport' of type 'ReverseTransport &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 78 | ReverseTransport & transport; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:84:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | if (!completed) (void) transport.outgoing.cancel(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:86: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:96: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:99:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:100:83: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 101 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker or assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:102:115: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 103 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request queue full"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:105:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:111:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:119:71: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:119:76: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:126:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:125: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 128 | return {grpc::StatusCode::UNAVAILABLE, nix-grpc-store-clang-tidy-0.2.2> 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:131:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 132 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:133:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:135:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 135 | if (beforeAck) beforeAck(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:136:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 136 | if (!transport.outgoing.acknowledge(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 137 | return {grpc::StatusCode::UNAVAILABLE, "cannot acknowledge reverse result"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:145:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | if (pending.size() < 4) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:147:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 147 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:148:91: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:148:101: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:149:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:153:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 153 | if (pending.size() < *expected) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:154:78: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 154 | if (!receive(std::string_view(pending).substr(0, *expected))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 155 | return {grpc::StatusCode::DATA_LOSS, "invalid or rejected reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:159:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:161:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:162:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:163:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 164 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:169:22: error: member 'gateway' of type 'ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 169 | ReverseGateway & gateway; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:170:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 170 | ReverseRegistry & registry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:32:38: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | [[nodiscard]] auto open(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:51:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 51 | auto it = streams.find(frame.stream_id()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | if (!cancelled.contains(frame.stream_id())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:101: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | auto pending = [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::_Deque_iterator nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | std::ranges::find_if queue nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:111:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | auto it = pending(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:135:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:168:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | [[nodiscard]] auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:171:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 171 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:26:41: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 26 | [[nodiscard]] auto message(uint64_t id, const nix::remote::BuildDerivationChunk & chunk, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:27:48: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 27 | std::stop_token stop, const std::function & cancelled = {}) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:30:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | if (size > ReverseRelay::maxMessageBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:32:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | if (wire.size() > ReverseRelay::maxMessageBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:36:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 36 | for (unsigned i = 0; i < 4; ++i) bytes.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:36:88: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 36 | for (unsigned i = 0; i < 4; ++i) bytes.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:36:98: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 36 | for (unsigned i = 0; i < 4; ++i) bytes.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:42:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 42 | if (!push(std::move(frame), stop, cancelled)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:47:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | [[nodiscard]] auto finish(uint64_t id, const grpc::Status & status, std::stop_token stop, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:53:78: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | frame.mutable_finish()->set_message(status.error_message().substr(0, 1024)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:56:39: error: parameter 'stop' of type 'std::stop_token' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 16 | return push(std::move(frame), stop, {}, waitForSpace, std::move(afterAck)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | std::move( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:67:84: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | [[nodiscard]] auto take(nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:70:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 70 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:71:62: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 71 | if (closed || stop.stop_requested() || queue.empty()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:79:46: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 79 | [[nodiscard]] auto acknowledged(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:83:13: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | auto it = afterAcks.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:85:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 85 | if (it == afterAcks.end()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:89:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 89 | if (completion) completion(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:95:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:108:13: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 108 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:111:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | for (auto & [id, complete] : pending) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:117:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 117 | void cancel(uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:119:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:134:19: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 134 | } else ++it; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:134:19: error: statement should have braces [readability-inconsistent-ifelse-braces,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 134 | } else ++it; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:141:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 141 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:146:82: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 146 | [[nodiscard]] auto push(nix::remote::ReverseWorkerMsg frame, std::stop_token stop, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:151:51: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 151 | if (size > ReverseFrames::maxFrameBytes + 1024) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:151:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 151 | if (size > ReverseFrames::maxFrameBytes + 1024) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:155:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 155 | && (!cancelled || !cancelled())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 156 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:156:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:159:43: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | || (cancelled && cancelled())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:162:86: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 162 | || !afterAcks.emplace(frame.stream_id(), std::move(afterAck)).second) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:8:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 8 | int main() nix-grpc-store-clang-tidy-0.2.2> | ~~~ ^ nix-grpc-store-clang-tidy-0.2.2> | auto -> int nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:11:5: error: variable 'stop' of type 'std::stop_source' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 11 | std::stop_source stop; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:12:18: error: no header providing "nix::remote::BuildDerivationChunk" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 6 | #include "reverse-worker.hh" nix-grpc-store-clang-tidy-0.2.2> 7 | nix-grpc-store-clang-tidy-0.2.2> 8 | int main() nix-grpc-store-clang-tidy-0.2.2> 9 | { nix-grpc-store-clang-tidy-0.2.2> 10 | nixgrpc::ReverseWorkerOutbound replies; nix-grpc-store-clang-tidy-0.2.2> 11 | std::stop_source stop; nix-grpc-store-clang-tidy-0.2.2> 12 | nix::remote::BuildDerivationChunk chunk; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:13:50: error: 130000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 13 | chunk.mutable_done()->set_result(std::string(130000, 'x')); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:15:36: error: no header providing "grpc::Status" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | #include nix-grpc-store-clang-tidy-0.2.2> 3 | #include nix-grpc-store-clang-tidy-0.2.2> 4 | #include nix-grpc-store-clang-tidy-0.2.2> 5 | nix-grpc-store-clang-tidy-0.2.2> 6 | #include "reverse-worker.hh" nix-grpc-store-clang-tidy-0.2.2> 7 | nix-grpc-store-clang-tidy-0.2.2> 8 | int main() nix-grpc-store-clang-tidy-0.2.2> 9 | { nix-grpc-store-clang-tidy-0.2.2> 10 | nixgrpc::ReverseWorkerOutbound replies; nix-grpc-store-clang-tidy-0.2.2> 11 | std::stop_source stop; nix-grpc-store-clang-tidy-0.2.2> 12 | nix::remote::BuildDerivationChunk chunk; nix-grpc-store-clang-tidy-0.2.2> 13 | chunk.mutable_done()->set_result(std::string(130000, 'x')); nix-grpc-store-clang-tidy-0.2.2> 14 | assert(replies.message(1, chunk, stop.get_token())); nix-grpc-store-clang-tidy-0.2.2> 15 | assert(replies.finish(1, grpc::Status::OK, stop.get_token())); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:16:18: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 16 | nix::remote::ReverseWorkerMsg frame; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:24:55: error: no header providing "nixgrpc::ReverseFrames" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 6 | assert(frame.data().data().size() <= nixgrpc::ReverseFrames::maxFrameBytes); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:28:5: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | uint32_t length = 0; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:29:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 29 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 30 | length |= static_cast(static_cast(wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:30:72: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | length |= static_cast(static_cast(wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:30:82: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | length |= static_cast(static_cast(wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:32:76: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | assert(wire.size() == length + 4 && decoded.ParseFromArray(wire.data() + 4, static_cast(length))); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:36:5: error: side effect in assert() condition discarded in release builds [bugprone-assert-side-effect,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 36 | assert(replies.finish(10, grpc::Status::OK, stop.get_token(), true, [&] { retired = true; })); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:36:73: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 36 | assert(replies.finish(10, grpc::Status::OK, stop.get_token(), true, [&] { retired = true; })); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> /nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert' nix-grpc-store-clang-tidy-0.2.2> 138 | ((__VA_ARGS__) \ nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:43:5: error: side effect in assert() condition discarded in release builds [bugprone-assert-side-effect,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | assert(lost.finish(11, grpc::Status::OK, stop.get_token(), true, [&] { abandoned = true; })); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:43:70: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | assert(lost.finish(11, grpc::Status::OK, stop.get_token(), true, [&] { abandoned = true; })); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> /nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert' nix-grpc-store-clang-tidy-0.2.2> 138 | ((__VA_ARGS__) \ nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:52:37: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 52 | assert(replies.finish(2, {grpc::StatusCode::CANCELLED, "cancelled"}, stop.get_token())); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:56:58: error: no header providing "nixgrpc::ReverseRelay" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 6 | huge.mutable_done()->set_result(std::string(nixgrpc::ReverseRelay::maxMessageBytes + 1, 'x')); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:63:10: error: no header providing "uint64_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 63 | for (uint64_t id = 1; id <= 10000; ++id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:63:33: error: 10000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 63 | for (uint64_t id = 1; id <= 10000; ++id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:64:77: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | if (!saturated.finish(id, {grpc::StatusCode::CANCELLED, std::string(1024, 'x')}, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:76:33: error: 10000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 76 | for (uint64_t id = 1; id <= 10000; ++id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:83:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | std::jthread producer([&](std::stop_token workStop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:84:33: error: 10001 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | queued = blocked.finish(10001, {grpc::StatusCode::CANCELLED, statusText}, workStop); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-worker-test.cc:84:83: error: parameter 'workStop' of type 'std::stop_token' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 5 | queued = blocked.finish(10001, {grpc::StatusCode::CANCELLED, statusText}, workStop); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | std::move( ) nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-import-test.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (RAND_bytes(reinterpret_cast(key.data()), static_cast(key.size())) != 1) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:62:95: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:96:61: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | result.push_back(static_cast(size >> (i * 8))); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:46: error: 2 adjacent parameters of 'verify' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:183:107: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:250:9: error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 250 | unsigned char mac[EVP_MAX_MD_SIZE]; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast(key.size()), nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | ( nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | == nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:86: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 258 | return std::string(reinterpret_cast(mac), macBytes); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto data(uint64_t id, std::string_view bytes) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | if (size > limit) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | cv.wait(lock, stop, [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | auto const it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto acknowledge(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!enqueue(std::move(msg))) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | if (streams.contains(id) && acknowledged.contains(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 150 | if (removed) cv.notify_all(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | void acknowledgementSent(uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 208 | auto terminal(uint64_t id, bool abort) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:20: error: variable name 'ok' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:45: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:88: error: rvalue reference parameter 'frame' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 33 | if (assigned && !assigned()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:35:13: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 35 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 42 | if (!ok) cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:49:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 68 | if (closed) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 79 | if (ended || !chunks.empty()) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:80:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 80 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | if (chunks.empty()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:92:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 92 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:103:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 103 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 113 | if (!ended || closed || !chunks.empty()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:120:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 120 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:129:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 129 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | if (failed || bytes.empty() || !consume) return fail(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:53:37: error: result of a `data()` call may not be null terminated, provide size information to the callee to prevent potential issues [bugprone-suspicious-stringview-data-usage,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | buffer.append(bytes.data(), count); nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~^~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | for (unsigned i = 0; i < 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:58:90: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:58:100: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 59 | if (length == 0 || length > maxChunkBytes) return fail(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast(*expected)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 66 | return fail(); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:327:14: error: variable 'extra' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 327 | char extra; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | = 0 nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:330:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:336:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 336 | if (out.pos != 0) throw nix::Error("trailing decompressed upload data"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:338:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 338 | if (zin.pos != zin.size) throw nix::Error("trailing compressed upload data"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:29:5: error: an exception may be thrown in function 'main' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 29 | int main() nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/upload-spool.hh:67:13: note: frame #0: unhandled exception of type 'nix::Error' may be thrown in function 'NarSpool' here nix-grpc-store-clang-tidy-0.2.2> 67 | throw nix::Error("cannot create a spool file: %s", opened.error().message()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:136:23: note: frame #1: function 'main' calls function 'NarSpool' here nix-grpc-store-clang-tidy-0.2.2> 136 | nixgrpc::NarSpool spool; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:29:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 29 | int main() nix-grpc-store-clang-tidy-0.2.2> | ~~~ ^ nix-grpc-store-clang-tidy-0.2.2> | auto -> int nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:33:5: error: variable 'cleanup' of type 'nix::AutoDelete' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 33 | nix::AutoDelete cleanup(root); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:39:33: error: no header providing "nixgrpc::ReverseFrames" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 26 | #include "reverse-upload-pipe.hh" nix-grpc-store-clang-tidy-0.2.2> 27 | #include "upload-spool.hh" nix-grpc-store-clang-tidy-0.2.2> 28 | nix-grpc-store-clang-tidy-0.2.2> 29 | int main() nix-grpc-store-clang-tidy-0.2.2> 30 | { nix-grpc-store-clang-tidy-0.2.2> 31 | nix::initLibStore(false); nix-grpc-store-clang-tidy-0.2.2> 32 | auto const root = nix::createTempDir(); nix-grpc-store-clang-tidy-0.2.2> 33 | nix::AutoDelete cleanup(root); nix-grpc-store-clang-tidy-0.2.2> 34 | auto sourceStore = nix::openStore("local?root=" + (root / "source").string()); nix-grpc-store-clang-tidy-0.2.2> 35 | auto destination = nix::openStore("local?root=" + (root / "destination").string()); nix-grpc-store-clang-tidy-0.2.2> 36 | nix-grpc-store-clang-tidy-0.2.2> 37 | // Compress poorly so the wire stream, not merely the decompressed NAR, nix-grpc-store-clang-tidy-0.2.2> 38 | // exceeds the registration reader's bounded 4 MiB queue. nix-grpc-store-clang-tidy-0.2.2> 39 | std::string random(nixgrpc::ReverseFrames::maxQueuedBytes + 2 * 1024 * 1024, '\0'); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:39:65: error: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 39 | std::string random(nixgrpc::ReverseFrames::maxQueuedBytes + 2 * 1024 * 1024, '\0'); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | ( ) nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:39:65: error: performing an implicit widening conversion to type 'size_t' (aka 'unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:39:65: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 3 | std::string random(nixgrpc::ReverseFrames::maxQueuedBytes + 2 * 1024 * 1024, '\0'); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:39:65: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 39 | std::string random(nixgrpc::ReverseFrames::maxQueuedBytes + 2 * 1024 * 1024, '\0'); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:39:69: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 39 | std::string random(nixgrpc::ReverseFrames::maxQueuedBytes + 2 * 1024 * 1024, '\0'); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:39:76: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 39 | std::string random(nixgrpc::ReverseFrames::maxQueuedBytes + 2 * 1024 * 1024, '\0'); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:40:23: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 40 | assert(RAND_bytes(reinterpret_cast(random.data()), static_cast(random.size())) == 1); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:58:64: error: no header providing "nix::NoRepair" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 6 | rejected->addToStore(unsignedOutput, unsignedNar, nix::NoRepair, nix::CheckSigs); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:59:25: error: no header providing "nix::Error" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 6 | } catch (const nix::Error &) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:65:5: error: variable 'signer' of type 'nix::LocalSigner' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | nix::LocalSigner signer(std::move(signingKey)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:65:34: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 22 | nix::LocalSigner signer(std::move(signingKey)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:68:39: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 68 | keys.emplace(publicKey.name, std::move(publicKey)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:85:5: error: variable 'trusted' of type 'nixgrpc::Caller' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 85 | nixgrpc::Caller trusted{.name = "test-writer", .role = nixgrpc::Role::trusted, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:85:14: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | nixgrpc::Caller trusted{.name = "test-writer", .role = nixgrpc::Role::trusted, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:85:69: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | nixgrpc::Caller trusted{.name = "test-writer", .role = nixgrpc::Role::trusted, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:87:25: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 26 | auto key = nixgrpc::ReverseCapability::newKey(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:91:76: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 91 | trusted, "assigned.drv", 42); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:95:49: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | nixgrpc::ReverseUploadPipe pipe(*delegated, [] { return true; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:96:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto send = [&](const nix::remote::UploadBuildInputsChunk & frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:96:40: error: no header providing "nix::remote::UploadBuildInputsChunk" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 25 | auto send = [&](const nix::remote::UploadBuildInputsChunk & frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:100:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 100 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:100:87: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 100 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:100:97: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 100 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:102:14: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 3 | for (size_t offset = 0; offset < wire.size(); offset += nixgrpc::ReverseFrames::maxFrameBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:102:103: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 102 | for (size_t offset = 0; offset < wire.size(); offset += nixgrpc::ReverseFrames::maxFrameBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 103 | if (!pipe.feed(std::string_view(wire).substr(offset, nixgrpc::ReverseFrames::maxFrameBytes))) nix-grpc-store-clang-tidy-0.2.2> 104 | throw std::runtime_error("bounded upload handoff overflowed"); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:103:106: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 103 | if (!pipe.feed(std::string_view(wire).substr(offset, nixgrpc::ReverseFrames::maxFrameBytes))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 104 | throw std::runtime_error("bounded upload handoff overflowed"); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:108:26: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 108 | header.set_assign_id(42); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:119:26: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | std::thread producer([&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:121:71: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 121 | for (size_t offset = 0; offset < packed.size(); offset += 256 * 1024) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:121:71: error: performing an implicit widening conversion to type 'size_t' (aka 'unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:121:71: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 121 | for (size_t offset = 0; offset < packed.size(); offset += 256 * 1024) { nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:121:71: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 121 | for (size_t offset = 0; offset < packed.size(); offset += 256 * 1024) { nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:121:77: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 121 | for (size_t offset = 0; offset < packed.size(); offset += 256 * 1024) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:123:71: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 123 | chunk.mutable_chunk()->set_data(packed.substr(offset, 256 * 1024)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:123:71: error: performing an implicit widening conversion to type 'size_type' (aka 'unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:123:71: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 123 | chunk.mutable_chunk()->set_data(packed.substr(offset, 256 * 1024)); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:123:71: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 123 | chunk.mutable_chunk()->set_data(packed.substr(offset, 256 * 1024)); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:123:77: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 123 | chunk.mutable_chunk()->set_data(packed.substr(offset, 256 * 1024)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:130:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 130 | if (!pipe.finish()) throw std::runtime_error("upload half-close rejected"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:142:24: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 142 | pipe, std::move(*flags.mutable_data())); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:144:13: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 144 | [&](const nix::ValidPathInfo & imported, nix::Source & stream) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-import-test.cc:158:23: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 158 | if (producerError) std::rethrow_exception(producerError); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-request-test.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (RAND_bytes(reinterpret_cast(key.data()), static_cast(key.size())) != 1) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:62:95: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:96:61: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | result.push_back(static_cast(size >> (i * 8))); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:46: error: 2 adjacent parameters of 'verify' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:183:107: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:250:9: error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 250 | unsigned char mac[EVP_MAX_MD_SIZE]; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast(key.size()), nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | ( nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | == nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:86: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 258 | return std::string(reinterpret_cast(mac), macBytes); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto data(uint64_t id, std::string_view bytes) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | if (size > limit) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | cv.wait(lock, stop, [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | auto const it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto acknowledge(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!enqueue(std::move(msg))) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | if (streams.contains(id) && acknowledged.contains(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 150 | if (removed) cv.notify_all(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | void acknowledgementSent(uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 208 | auto terminal(uint64_t id, bool abort) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:63:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 63 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:65:14: error: variable 'minRole' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | Role minRole; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:81:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | return {{grpc::StatusCode::UNIMPLEMENTED, "unknown reverse method"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:85:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 85 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:91:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 91 | return {{grpc::StatusCode::INVALID_ARGUMENT, "upload does not accept a build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:95:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:99:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no matching live assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:104:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unexpected build assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:109:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session unavailable"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:115:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 115 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session changed"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:122:16: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open), nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> 123 | std::string(drvPath), assignId}}; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:122:43: error: use designated initializer list to initialize 'Prepared' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open), nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .session= .open= nix-grpc-store-clang-tidy-0.2.2> 123 | std::string(drvPath), assignId}}; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .drvPath= .assignId= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:33:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 33 | struct Prepared nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:185:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 185 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:189:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 189 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:193:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 193 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:197:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 197 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned build route"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:202:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 202 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound build assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:214:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 214 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:218:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 218 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:222:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 222 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned upload route"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:227:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 227 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:233:11: error: member 'auth' of type 'Auth &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 233 | Auth &auth; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:234:22: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 234 | ReverseRegistry ®istry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:50:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 50 | auto const id = frame.stream_id(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:68:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 68 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != 0u) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 75 | return Event{.kind = Event::Kind::cancel, .streamId = id}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:109:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | if (cancelledIds.erase(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | if (cancelledIds.erase(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (!streams.erase(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | == 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (!streams.erase(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:44:71: error: 128 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:82:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | auto it = sessions.find(std::string(workerId)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:92:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 92 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:107:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:130:30: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 130 | for (auto & [id, session] : sessions) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:49:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:56:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:57:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:59:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:60:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:61:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 61 | auto const id = session->transport->nextStreamId.fetch_add(1); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:62:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:64:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:65:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | if (!selection.prepared || selection.prepared->session != session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 66 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker changed during selection"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:67:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | if (request.ByteSizeLong() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 68 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:70:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 70 | if (bytes.size() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 71 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:72:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:75:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (!status.ok()) return status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:77:16: error: class 'Release' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:77:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> 78 | ReverseTransport & transport; nix-grpc-store-clang-tidy-0.2.2> 79 | uint64_t id; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> | {} nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:78:32: error: member 'transport' of type 'ReverseTransport &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 78 | ReverseTransport & transport; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:84:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | if (!completed) (void) transport.outgoing.cancel(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:86: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:96: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:99:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:100:83: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 101 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker or assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:102:115: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 103 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request queue full"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:105:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:111:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:119:71: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:119:76: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:126:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:125: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 128 | return {grpc::StatusCode::UNAVAILABLE, nix-grpc-store-clang-tidy-0.2.2> 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:131:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 132 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:133:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:135:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 135 | if (beforeAck) beforeAck(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:136:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 136 | if (!transport.outgoing.acknowledge(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 137 | return {grpc::StatusCode::UNAVAILABLE, "cannot acknowledge reverse result"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:145:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | if (pending.size() < 4) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:147:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 147 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:148:91: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:148:101: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:149:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:153:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 153 | if (pending.size() < *expected) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:154:78: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 154 | if (!receive(std::string_view(pending).substr(0, *expected))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 155 | return {grpc::StatusCode::DATA_LOSS, "invalid or rejected reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:159:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:161:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:162:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:163:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 164 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:169:22: error: member 'gateway' of type 'ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 169 | ReverseGateway & gateway; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:170:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 170 | ReverseRegistry & registry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:48:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 48 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:53:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto const id = event->streamId; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:66:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:77:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | if (auto it = uploads.find(id); it != uploads.end()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:77:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | if (auto it = uploads.find(id); it != uploads.end()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 78 | return it->second->feed(frame.data().data()); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:86:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 86 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 87 | length |= static_cast(static_cast(pending.wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:87:92: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | length |= static_cast(static_cast(pending.wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:87:102: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | length |= static_cast(static_cast(pending.wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:94:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:94:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:95:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | auto it = requests.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:108:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 108 | if (auto it = uploads.find(id); it != uploads.end()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:112:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:114:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 114 | if (ready && ready->id == id) ready.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:121:64: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 121 | [[nodiscard]] auto lastRejection() const -> const char * { std::scoped_lock lock(mutex); return rejection; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:123:62: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 123 | [[nodiscard]] auto takeReady() -> std::optional { std::scoped_lock lock(mutex); return std::exchange(ready, std::nullopt); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:124:69: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 124 | [[nodiscard]] auto takeUploadReady() -> std::optional { std::scoped_lock lock(mutex); return std::exchange(uploadReady, std::nullopt); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:130:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 130 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:131:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:131:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:141:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 141 | [[nodiscard]] auto finished(uint64_t id) -> bool { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:142:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 142 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:148:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:149:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:149:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:32:38: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | [[nodiscard]] auto open(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:51:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 51 | auto it = streams.find(frame.stream_id()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | if (!cancelled.contains(frame.stream_id())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:101: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | auto pending = [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::_Deque_iterator nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | std::ranges::find_if queue nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:111:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | auto it = pending(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:135:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:168:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | [[nodiscard]] auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:171:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 171 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:20: error: variable name 'ok' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:45: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:88: error: rvalue reference parameter 'frame' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 33 | if (assigned && !assigned()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:35:13: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 35 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 42 | if (!ok) cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:49:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 68 | if (closed) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 79 | if (ended || !chunks.empty()) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:80:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 80 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | if (chunks.empty()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:92:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 92 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:103:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 103 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 113 | if (!ended || closed || !chunks.empty()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:120:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 120 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:129:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 129 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | if (failed || bytes.empty() || !consume) return fail(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:53:37: error: result of a `data()` call may not be null terminated, provide size information to the callee to prevent potential issues [bugprone-suspicious-stringview-data-usage,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | buffer.append(bytes.data(), count); nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~^~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | for (unsigned i = 0; i < 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:58:90: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:58:100: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 59 | if (length == 0 || length > maxChunkBytes) return fail(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast(*expected)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 66 | return fail(); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:327:14: error: variable 'extra' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 327 | char extra; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | = 0 nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:330:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:336:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 336 | if (out.pos != 0) throw nix::Error("trailing decompressed upload data"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:338:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 338 | if (zin.pos != zin.size) throw nix::Error("trailing compressed upload data"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:11:5: error: an exception may be thrown in function 'main' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 11 | int main() nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:330:42: note: frame #0: unhandled exception of type 'nix::EndOfFile' may be thrown in function 'finishFrame' here nix-grpc-store-clang-tidy-0.2.2> 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:278:5: note: frame #1: function 'main' calls function 'finishFrame' here nix-grpc-store-clang-tidy-0.2.2> 278 | source.finishFrame(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:11:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 11 | int main() nix-grpc-store-clang-tidy-0.2.2> | ~~~ ^ nix-grpc-store-clang-tidy-0.2.2> | auto -> int nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:13:25: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 9 | #include "reverse-request.hh" nix-grpc-store-clang-tidy-0.2.2> 10 | nix-grpc-store-clang-tidy-0.2.2> 11 | int main() nix-grpc-store-clang-tidy-0.2.2> 12 | { nix-grpc-store-clang-tidy-0.2.2> 13 | auto key = nixgrpc::ReverseCapability::newKey(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:16:5: error: variable 'writer' of type 'nixgrpc::Caller' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 16 | nixgrpc::Caller writer{.name = "real-client", .role = nixgrpc::Role::write, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:16:14: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 8 | #include "pump.hh" nix-grpc-store-clang-tidy-0.2.2> 9 | #include "reverse-request.hh" nix-grpc-store-clang-tidy-0.2.2> 10 | nix-grpc-store-clang-tidy-0.2.2> 11 | int main() nix-grpc-store-clang-tidy-0.2.2> 12 | { nix-grpc-store-clang-tidy-0.2.2> 13 | auto key = nixgrpc::ReverseCapability::newKey(); nix-grpc-store-clang-tidy-0.2.2> 14 | assert(key); nix-grpc-store-clang-tidy-0.2.2> 15 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef"; nix-grpc-store-clang-tidy-0.2.2> 16 | nixgrpc::Caller writer{.name = "real-client", .role = nixgrpc::Role::write, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:16:68: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 8 | #include "pump.hh" nix-grpc-store-clang-tidy-0.2.2> 9 | #include "reverse-request.hh" nix-grpc-store-clang-tidy-0.2.2> 10 | nix-grpc-store-clang-tidy-0.2.2> 11 | int main() nix-grpc-store-clang-tidy-0.2.2> 12 | { nix-grpc-store-clang-tidy-0.2.2> 13 | auto key = nixgrpc::ReverseCapability::newKey(); nix-grpc-store-clang-tidy-0.2.2> 14 | assert(key); nix-grpc-store-clang-tidy-0.2.2> 15 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef"; nix-grpc-store-clang-tidy-0.2.2> 16 | nixgrpc::Caller writer{.name = "real-client", .role = nixgrpc::Role::write, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:18:114: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 18 | auto token = nixgrpc::ReverseCapability::mint(*key, worker, 1, 1, "BuildDerivation", writer, "assigned.drv", 42, 0); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:21:18: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 8 | #include "pump.hh" nix-grpc-store-clang-tidy-0.2.2> 9 | #include "reverse-request.hh" nix-grpc-store-clang-tidy-0.2.2> 10 | nix-grpc-store-clang-tidy-0.2.2> 11 | int main() nix-grpc-store-clang-tidy-0.2.2> 12 | { nix-grpc-store-clang-tidy-0.2.2> 13 | auto key = nixgrpc::ReverseCapability::newKey(); nix-grpc-store-clang-tidy-0.2.2> 14 | assert(key); nix-grpc-store-clang-tidy-0.2.2> 15 | std::string const worker = "pod:staging:01234567-89ab-cdef-0123-456789abcdef"; nix-grpc-store-clang-tidy-0.2.2> 16 | nixgrpc::Caller writer{.name = "real-client", .role = nixgrpc::Role::write, nix-grpc-store-clang-tidy-0.2.2> 17 | .kind = nixgrpc::Caller::Kind::named}; nix-grpc-store-clang-tidy-0.2.2> 18 | auto token = nixgrpc::ReverseCapability::mint(*key, worker, 1, 1, "BuildDerivation", writer, "assigned.drv", 42, 0); nix-grpc-store-clang-tidy-0.2.2> 19 | assert(token); nix-grpc-store-clang-tidy-0.2.2> 20 | nixgrpc::ReverseRequest requests(worker, 1, *key); nix-grpc-store-clang-tidy-0.2.2> 21 | nix::remote::ReverseFarmMsg frame; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:26:18: error: no header providing "nix::remote::BuildDerivationRequest" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 26 | nix::remote::BuildDerivationRequest build; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:28:25: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 28 | build.set_assign_id(42); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:40:27: error: 43 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 40 | decoded.set_assign_id(43); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:44:113: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | auto next = nixgrpc::ReverseCapability::mint(*key, worker, 1, 2, "BuildDerivation", writer, "assigned.drv", 42, 0); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:91:81: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 91 | writer, "assigned.drv", 42); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:93:54: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | nixgrpc::ReverseRequest uploads(worker, 1, *key, [](std::string_view drv, uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:93:79: error: no header providing "uint64_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | nixgrpc::ReverseRequest uploads(worker, 1, *key, [](std::string_view drv, uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:93:88: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | nixgrpc::ReverseRequest uploads(worker, 1, *key, [](std::string_view drv, uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:94:47: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | return drv == "assigned.drv" && id == 42; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:103:18: error: no header providing "nix::remote::UploadBuildInputsChunk" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 103 | nix::remote::UploadBuildInputsChunk header; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:105:26: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | header.set_assign_id(42); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:109:37: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | auto const length = static_cast(bytes.size()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:110:37: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 110 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:110:83: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 110 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:110:93: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 110 | for (unsigned i = 0; i < 4; ++i) wire.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:124:54: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 124 | nixgrpc::ReverseRequest aborted(worker, 1, *key, [](std::string_view, uint64_t) { return true; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:133:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 133 | std::jthread reader([&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:142:56: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 142 | nixgrpc::ReverseRequest malformed(worker, 1, *key, [](std::string_view, uint64_t) { return true; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:152:14: error: no header providing "nixgrpc::ReverseUploadPipe" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 10 | nixgrpc::ReverseUploadPipe pressured(upload->delegated); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:153:17: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | std::atomic consumed{0}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:154:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 154 | std::jthread consumer([&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:163:53: error: 96 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 163 | nextChunk.mutable_chunk()->set_data(std::string(96 * 1024, 'x')); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:163:53: error: performing an implicit widening conversion to type 'size_type' (aka 'unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:163:53: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 2 | nextChunk.mutable_chunk()->set_data(std::string(96 * 1024, 'x')); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:163:53: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 163 | nextChunk.mutable_chunk()->set_data(std::string(96 * 1024, 'x')); nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:163:58: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 163 | nextChunk.mutable_chunk()->set_data(std::string(96 * 1024, 'x')); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:167:37: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 167 | for (unsigned i = 0; i < 4; ++i) nextFramed.push_back(static_cast((nextSize >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:167:91: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 167 | for (unsigned i = 0; i < 4; ++i) nextFramed.push_back(static_cast((nextSize >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:167:101: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 167 | for (unsigned i = 0; i < 4; ++i) nextFramed.push_back(static_cast((nextSize >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:169:17: error: loop variable name 'n' is too short, expected at least 2 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 169 | for (size_t n = 0; n < 48; ++n) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:169:28: error: 48 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 169 | for (size_t n = 0; n < 48; ++n) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:170:80: error: no header providing "nixgrpc::ReverseFrames" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 9 | for (size_t offset = 0; offset < nextFramed.size(); offset += nixgrpc::ReverseFrames::maxFrameBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:170:109: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 170 | for (size_t offset = 0; offset < nextFramed.size(); offset += nixgrpc::ReverseFrames::maxFrameBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 171 | assert(pressured.feed(std::string_view(nextFramed).substr(offset, nixgrpc::ReverseFrames::maxFrameBytes))); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:192:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 192 | std::jthread producer([&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:193:21: error: loop variable name 'n' is too short, expected at least 2 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 193 | for (size_t n = 0; n < 1000; ++n) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:193:32: error: 1000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 193 | for (size_t n = 0; n < 1000; ++n) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:193:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 193 | for (size_t n = 0; n < 1000; ++n) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 194 | if (!interrupted.feed(nextFramed)) { exited = true; return; } nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:203:17: error: loop variable name 'n' is too short, expected at least 2 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 203 | for (size_t n = 0; n < 100; ++n) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:203:28: error: 100 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 203 | for (size_t n = 0; n < 100; ++n) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:213:26: error: 43 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 213 | header.set_assign_id(43); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:217:37: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 217 | for (unsigned i = 0; i < 4; ++i) wrongFramed.push_back(static_cast((wrongSize >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:217:93: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 217 | for (unsigned i = 0; i < 4; ++i) wrongFramed.push_back(static_cast((wrongSize >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:217:103: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 217 | for (unsigned i = 0; i < 4; ++i) wrongFramed.push_back(static_cast((wrongSize >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:222:26: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 222 | header.set_assign_id(42); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:227:37: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 227 | for (unsigned i = 0; i < 4; ++i) wrongFramed.push_back(static_cast((unsignedSize >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:227:96: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 227 | for (unsigned i = 0; i < 4; ++i) wrongFramed.push_back(static_cast((unsignedSize >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:227:106: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 227 | for (unsigned i = 0; i < 4; ++i) wrongFramed.push_back(static_cast((unsignedSize >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:231:52: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 231 | nixgrpc::ReverseRequest stale(worker, 1, *key, [](std::string_view, uint64_t) { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:238:59: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 238 | nixgrpc::ReverseUploadPipe revoked(upload->delegated, [&] { return expected.load(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:243:71: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 243 | nixgrpc::ReverseUploadPipe revokedWhileReading(upload->delegated, [&] { return readingLive.load(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:244:26: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 244 | std::jthread waiting([&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:256:23: error: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 256 | std::string plain(5 * 1024 * 1024, 'a'); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:256:23: error: performing an implicit widening conversion to type 'size_type' (aka 'unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:256:23: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 256 | std::string plain(5 * 1024 * 1024, 'a'); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:256:23: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 256 | std::string plain(5 * 1024 * 1024, 'a'); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:256:27: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 256 | std::string plain(5 * 1024 * 1024, 'a'); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:256:34: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 256 | std::string plain(5 * 1024 * 1024, 'a'); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:266:37: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 266 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast((dataSize >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:266:87: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 266 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast((dataSize >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:266:97: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 266 | for (unsigned i = 0; i < 4; ++i) framed.push_back(static_cast((dataSize >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:268:101: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 268 | for (size_t offset = 0; offset < framed.size(); offset += nixgrpc::ReverseFrames::maxFrameBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 269 | assert(compressed.feed(std::string_view(framed).substr(offset, nixgrpc::ReverseFrames::maxFrameBytes))); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:274:26: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 6 | compressed, std::move(*firstCompressed.mutable_data())); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:282:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 282 | auto checkInvalidFrame = [&](std::string badCompressed) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:290:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 290 | for (unsigned i = 0; i < 4; ++i) framedPart.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:290:93: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 290 | for (unsigned i = 0; i < 4; ++i) framedPart.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:290:103: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 290 | for (unsigned i = 0; i < 4; ++i) framedPart.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:292:109: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 292 | for (size_t offset = 0; offset < framedPart.size(); offset += nixgrpc::ReverseFrames::maxFrameBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 293 | assert(bad.feed(std::string_view(framedPart).substr(offset, nixgrpc::ReverseFrames::maxFrameBytes))); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-request-test.cc:306:27: error: no header providing "nix::Error" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | catch (const nix::Error &) { rejected = true; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/daemon/sandbox-linux.cc nix-grpc-store-clang-tidy-0.2.2> [1/1] (1/2) Processing file /build/source/src/daemon/sandbox-linux.cc. nix-grpc-store-clang-tidy-0.2.2> [1/1] (2/2) Processing file /build/source/src/daemon/sandbox-linux.cc. nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/daemon/options.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:519:10: error: function 'doVerify' has cognitive complexity of 49 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 519 | auto doVerify(const std::string & token, std::chrono::system_clock::time_point now) -> Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:522:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 522 | if (!parsed) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:525:47: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 525 | auto const iss = parsed->has_issuer() ? parsed->get_issuer() : ""; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:526:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 526 | for (size_t idx = 0; idx < config.providers.size(); ++idx) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:528:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 528 | if (provider.issuer != iss) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:531:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 531 | if (!parsed->has_expires_at()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:535:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 535 | for (auto & verifier : candidates(provider, keys.at(idx), *parsed, now)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:538:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 538 | if (!err) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:542:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 542 | if (err) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:547:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 547 | if (sub.empty() || sub.contains('\0')) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:547:29: note: +1 nix-grpc-store-clang-tidy-0.2.2> 547 | if (sub.empty() || sub.contains('\0')) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:552:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 552 | if (auto const * namespaceClaim = lookupClaim(claims, "kubernetes.io.namespace"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:32: note: +1 nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:82: note: +1 nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:67: note: +1 nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:66: note: +1 nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:91: note: +1 nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:65: note: +1 nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:569:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 569 | if (auto const aud = claims.find("aud"); aud != claims.end()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:570:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 570 | if (aud->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:572:24: note: +1, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:572:64: note: +1 nix-grpc-store-clang-tidy-0.2.2> 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:577:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 577 | if (parsed->has_issued_at()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:580:68: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 580 | return {.identity = std::move(identity), .error = role ? "" : "no rule matched"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/options.cc:189:34: error: 600 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 189 | if (!secs || *secs < 600 || *secs > 3600) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/options.cc:189:49: error: 3600 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 189 | if (!secs || *secs < 600 || *secs > 3600) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:323:61: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 323 | lastAssignId = (static_cast(entropy()) << 32) | entropy(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 371 | auto const it = workerIds.find(std::string(addr)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/nar-fetcher-test.cc nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:327:14: error: variable 'extra' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 327 | char extra; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | = 0 nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:330:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:336:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 336 | if (out.pos != 0) throw nix::Error("trailing decompressed upload data"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:338:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 338 | if (zin.pos != zin.size) throw nix::Error("trailing compressed upload data"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/daemon/eds.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 12 | #include nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> 13 | #include nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 90 | std::chrono::system_clock::time_point credentialExpiresAt{}; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:519:10: error: function 'doVerify' has cognitive complexity of 49 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 519 | auto doVerify(const std::string & token, std::chrono::system_clock::time_point now) -> Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:522:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 522 | if (!parsed) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:525:47: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 525 | auto const iss = parsed->has_issuer() ? parsed->get_issuer() : ""; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:526:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 526 | for (size_t idx = 0; idx < config.providers.size(); ++idx) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:528:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 528 | if (provider.issuer != iss) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:531:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 531 | if (!parsed->has_expires_at()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:535:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 535 | for (auto & verifier : candidates(provider, keys.at(idx), *parsed, now)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:538:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 538 | if (!err) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:542:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 542 | if (err) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:547:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 547 | if (sub.empty() || sub.contains('\0')) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:547:29: note: +1 nix-grpc-store-clang-tidy-0.2.2> 547 | if (sub.empty() || sub.contains('\0')) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:552:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 552 | if (auto const * namespaceClaim = lookupClaim(claims, "kubernetes.io.namespace"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:32: note: +1 nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:82: note: +1 nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:67: note: +1 nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:66: note: +1 nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:91: note: +1 nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:65: note: +1 nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:569:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 569 | if (auto const aud = claims.find("aud"); aud != claims.end()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:570:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 570 | if (aud->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:572:24: note: +1, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:572:64: note: +1 nix-grpc-store-clang-tidy-0.2.2> 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:577:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 577 | if (parsed->has_issued_at()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:580:68: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 580 | return {.identity = std::move(identity), .error = role ? "" : "no rule matched"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:323:61: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 323 | lastAssignId = (static_cast(entropy()) << 32) | entropy(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 371 | auto const it = workerIds.find(std::string(addr)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/scheduler-grpc-bench.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 12 | #include nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> 13 | #include nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 90 | std::chrono::system_clock::time_point credentialExpiresAt{}; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:323:61: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 323 | lastAssignId = (static_cast(entropy()) << 32) | entropy(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 371 | auto const it = workerIds.find(std::string(addr)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/client/store.cc nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:327:14: error: variable 'extra' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 327 | char extra; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | = 0 nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:330:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:336:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 336 | if (out.pos != 0) throw nix::Error("trailing decompressed upload data"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:338:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 338 | if (zin.pos != zin.size) throw nix::Error("trailing compressed upload data"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/scheduler-test.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:323:61: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 323 | lastAssignId = (static_cast(entropy()) << 32) | entropy(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 371 | auto const it = workerIds.find(std::string(addr)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/reverse-gateway-test.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (RAND_bytes(reinterpret_cast(key.data()), static_cast(key.size())) != 1) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:62:95: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:96:61: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | result.push_back(static_cast(size >> (i * 8))); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:46: error: 2 adjacent parameters of 'verify' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:183:107: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:250:9: error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 250 | unsigned char mac[EVP_MAX_MD_SIZE]; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast(key.size()), nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | ( nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | == nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:86: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 258 | return std::string(reinterpret_cast(mac), macBytes); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto data(uint64_t id, std::string_view bytes) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | if (size > limit) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | cv.wait(lock, stop, [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | auto const it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto acknowledge(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!enqueue(std::move(msg))) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | if (streams.contains(id) && acknowledged.contains(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 150 | if (removed) cv.notify_all(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | void acknowledgementSent(uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 208 | auto terminal(uint64_t id, bool abort) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:63:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 63 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:65:14: error: variable 'minRole' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | Role minRole; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:81:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | return {{grpc::StatusCode::UNIMPLEMENTED, "unknown reverse method"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:85:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 85 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:91:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 91 | return {{grpc::StatusCode::INVALID_ARGUMENT, "upload does not accept a build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:95:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:99:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no matching live assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:104:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unexpected build assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:109:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session unavailable"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:115:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 115 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session changed"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:122:16: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open), nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> 123 | std::string(drvPath), assignId}}; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:122:43: error: use designated initializer list to initialize 'Prepared' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open), nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .session= .open= nix-grpc-store-clang-tidy-0.2.2> 123 | std::string(drvPath), assignId}}; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .drvPath= .assignId= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:33:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 33 | struct Prepared nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:185:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 185 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:189:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 189 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:193:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 193 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:197:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 197 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned build route"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:202:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 202 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound build assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:214:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 214 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:218:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 218 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:222:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 222 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned upload route"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:227:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 227 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:233:11: error: member 'auth' of type 'Auth &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 233 | Auth &auth; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:234:22: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 234 | ReverseRegistry ®istry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:44:71: error: 128 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:82:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | auto it = sessions.find(std::string(workerId)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:92:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 92 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:107:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:130:30: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 130 | for (auto & [id, session] : sessions) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:32:38: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | [[nodiscard]] auto open(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:51:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 51 | auto it = streams.find(frame.stream_id()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | if (!cancelled.contains(frame.stream_id())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:101: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | auto pending = [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::_Deque_iterator nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | std::ranges::find_if queue nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:111:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | auto it = pending(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:135:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:168:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | [[nodiscard]] auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:171:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 171 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:34:84: error: the parameter 'first' of type 'nix::remote::UploadBuildInputsChunk' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 34 | const Read & read, nix::remote::UploadBuildInputsChunk first) const -> grpc::Status nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:37:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 37 | || !first.has_chunk() || first.drv_path().empty() || first.assign_id() == 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 38 | return {grpc::StatusCode::INVALID_ARGUMENT, "invalid build-input upload header"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:40:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 40 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:41:108: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 42 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload session unavailable"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:44:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:45:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 45 | auto const id = session->transport->nextStreamId.fetch_add(1); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:46:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 46 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:48:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 48 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:49:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | if (!selection.prepared || selection.prepared->session != session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 50 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload worker changed during selection"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:55:66: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 55 | || selection.prepared->assignId != first.assign_id()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 56 | return {grpc::StatusCode::PERMISSION_DENIED, "invalid delegated upload"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:57:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "upload client cancelled"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:60:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 60 | if (!status.ok()) return status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:61:16: error: class 'Release' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 61 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:61:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 61 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> 62 | ReverseTransport & transport; nix-grpc-store-clang-tidy-0.2.2> 63 | uint64_t id; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> | {} nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:62:32: error: member 'transport' of type 'ReverseTransport &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | ReverseTransport & transport; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:66:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 66 | if (!completed) (void) transport.outgoing.cancel(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:70:18: error: use designated initializer list to initialize 'struct Release' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 70 | } release{transport, id}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .transport=.id= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:61:9: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 61 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:75:37: error: variable name 'cv' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | std::condition_variable_any cv; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:76:9: error: variable 'monitor' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 76 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:76:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 76 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:76:50: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 76 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:87:67: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:87:72: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:90:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 90 | auto const live = [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:95:66: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:97:76: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:99:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast((wire.size() >> (8 * i)) & 0xff); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:99:52: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast((wire.size() >> (8 * i)) & 0xff); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:99:93: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast((wire.size() >> (8 * i)) & 0xff); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:99:103: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast((wire.size() >> (8 * i)) & 0xff); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:100:87: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:101:98: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 102 | if (!live() || !transport.outgoing.waitData(id, nix-grpc-store-clang-tidy-0.2.2> 103 | std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes), wake.get_token())) return false; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:103:112: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 103 | std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes), wake.get_token())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:106:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 106 | if (!send(first)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:109:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | if (!ReverseUpload::next(next)) return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload continuation"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:110:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 110 | if (!send(next)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:113:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 113 | if (!live() || !transport.outgoing.halfClose(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 114 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload closed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:116:86: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 117 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload session ended"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:118:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 118 | if (!response.has_finish()) return {grpc::StatusCode::DATA_LOSS, "unexpected upload response data"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:119:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:120:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 120 | if (!transport.responses.finished(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 121 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload response stream lost"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:127:22: error: member 'gateway' of type 'ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 127 | ReverseGateway & gateway; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:128:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 128 | ReverseRegistry & registry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | if (failed || bytes.empty() || !consume) return fail(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:53:37: error: result of a `data()` call may not be null terminated, provide size information to the callee to prevent potential issues [bugprone-suspicious-stringview-data-usage,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | buffer.append(bytes.data(), count); nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~^~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | for (unsigned i = 0; i < 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:58:90: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:58:100: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 59 | if (length == 0 || length > maxChunkBytes) return fail(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast(*expected)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 66 | return fail(); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:14:7: error: class 'ClientService' can be moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 14 | class ClientService final : public nix::remote::NixRemote::Service nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:17:30: error: member 'gateway' of type 'nixgrpc::ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 17 | nixgrpc::ReverseGateway &gateway; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:18:14: error: no header providing "nixgrpc::ReverseRegistry" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 12 | #include "reverse-upload-relay.hh" nix-grpc-store-clang-tidy-0.2.2> 13 | nix-grpc-store-clang-tidy-0.2.2> 14 | class ClientService final : public nix::remote::NixRemote::Service nix-grpc-store-clang-tidy-0.2.2> 15 | { nix-grpc-store-clang-tidy-0.2.2> 16 | public: nix-grpc-store-clang-tidy-0.2.2> 17 | nixgrpc::ReverseGateway &gateway; nix-grpc-store-clang-tidy-0.2.2> 18 | nixgrpc::ReverseRegistry ®istry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:18:31: error: member 'registry' of type 'nixgrpc::ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 18 | nixgrpc::ReverseRegistry ®istry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:19:10: error: no header providing "std::string" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 9 | nix-grpc-store-clang-tidy-0.2.2> 10 | #include "nix_remote.grpc.pb.h" nix-grpc-store-clang-tidy-0.2.2> 11 | #include "reverse-gateway.hh" nix-grpc-store-clang-tidy-0.2.2> 12 | #include "reverse-upload-relay.hh" nix-grpc-store-clang-tidy-0.2.2> 13 | nix-grpc-store-clang-tidy-0.2.2> 14 | class ClientService final : public nix::remote::NixRemote::Service nix-grpc-store-clang-tidy-0.2.2> 15 | { nix-grpc-store-clang-tidy-0.2.2> 16 | public: nix-grpc-store-clang-tidy-0.2.2> 17 | nixgrpc::ReverseGateway &gateway; nix-grpc-store-clang-tidy-0.2.2> 18 | nixgrpc::ReverseRegistry ®istry; nix-grpc-store-clang-tidy-0.2.2> 19 | std::string worker; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:20:11: error: no header providing "grpc::Status" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | grpc::Status last; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:21:10: error: no header providing "std::optional" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 9 | nix-grpc-store-clang-tidy-0.2.2> 10 | #include "nix_remote.grpc.pb.h" nix-grpc-store-clang-tidy-0.2.2> 11 | #include "reverse-gateway.hh" nix-grpc-store-clang-tidy-0.2.2> 12 | #include "reverse-upload-relay.hh" nix-grpc-store-clang-tidy-0.2.2> 13 | nix-grpc-store-clang-tidy-0.2.2> 14 | class ClientService final : public nix::remote::NixRemote::Service nix-grpc-store-clang-tidy-0.2.2> 15 | { nix-grpc-store-clang-tidy-0.2.2> 16 | public: nix-grpc-store-clang-tidy-0.2.2> 17 | nixgrpc::ReverseGateway &gateway; nix-grpc-store-clang-tidy-0.2.2> 18 | nixgrpc::ReverseRegistry ®istry; nix-grpc-store-clang-tidy-0.2.2> 19 | std::string worker; nix-grpc-store-clang-tidy-0.2.2> 20 | grpc::Status last; nix-grpc-store-clang-tidy-0.2.2> 21 | std::optional prepared; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:24:5: error: no header providing "uint64_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | uint64_t assignId = 0; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:25:5: error: no header providing "uint32_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 25 | uint32_t buildMode = 0; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:30:5: error: no header providing "size_t" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | size_t resolverCalls = 0; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:33:61: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 9 | : gateway(gateway), registry(registry), worker(std::move(worker)) {} nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:36:60: error: no header providing "nix::remote::UploadBuildInputsChunk" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 11 | grpc::ServerReader * reader, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:37:41: error: no header providing "nix::remote::AddMultipleReply" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 37 | nix::remote::AddMultipleReply *) -> grpc::Status override nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:37:59: error: all parameters should be named in a function [readability-named-parameter,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 37 | nix::remote::AddMultipleReply *) -> grpc::Status override nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | /*response*/ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:39:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 39 | if (!uploadRelayEnabled) return {grpc::StatusCode::UNIMPLEMENTED, "test upload disabled"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:39:48: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 39 | if (!uploadRelayEnabled) return {grpc::StatusCode::UNIMPLEMENTED, "test upload disabled"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:41:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 41 | if (!reader->Read(&first)) return {grpc::StatusCode::INVALID_ARGUMENT, "empty upload"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:44:9: error: variable 'relay' of type 'nixgrpc::ReverseUploadRelay' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | nixgrpc::ReverseUploadRelay relay(gateway, registry); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:45:33: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 45 | return relay.call(*ctx, [&, drv, assignId](uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> Result nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:45:61: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 45 | return relay.call(*ctx, [&, drv, assignId](uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:46:62: error: no header providing "std::string_view" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 9 | return gateway.prepareBuildInputs(*ctx, [&](std::string_view drv, uint64_t assign) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:48:75: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 48 | if (*assignmentLive && drv == "assigned.drv" && assign == 42) return worker; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:48:78: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 48 | if (*assignmentLive && drv == "assigned.drv" && assign == 42) return worker; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:49:29: error: no header providing "std::nullopt" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | return std::nullopt; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:51:12: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 51 | }, [&] { return *assignmentLive; }, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:52:9: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 52 | [&](nix::remote::UploadBuildInputsChunk & chunk) { return reader->Read(&chunk); }, std::move(first)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:52:97: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 52 | [&](nix::remote::UploadBuildInputsChunk & chunk) { return reader->Read(&chunk); }, std::move(first)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:55:65: error: no header providing "nix::remote::StoreInfoRequest" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 55 | auto StoreInfo(grpc::ServerContext *ctx, const nix::remote::StoreInfoRequest *, nix::remote::StoreInfoReply *reply) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:55:83: error: all parameters should be named in a function [readability-named-parameter,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 55 | auto StoreInfo(grpc::ServerContext *ctx, const nix::remote::StoreInfoRequest *, nix::remote::StoreInfoReply *reply) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | /*request*/ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:55:98: error: no header providing "nix::remote::StoreInfoReply" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 55 | auto StoreInfo(grpc::ServerContext *ctx, const nix::remote::StoreInfoRequest *, nix::remote::StoreInfoReply *reply) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:59:97: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 59 | ? gateway.prepareBuildInputs(*ctx, [&](std::string_view drv, uint64_t id) -> std::optional { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:61:68: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 61 | if (drv == "assigned.drv" && id == 42) return worker; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:61:71: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 61 | if (drv == "assigned.drv" && id == 42) return worker; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:64:29: error: conditional operator is used as sub-expression of parent conditional operator, refrain from using nested conditional operators [readability-avoid-nested-conditional-operator,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | : schedulerRoute nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:58:23: note: parent conditional operator here nix-grpc-store-clang-tidy-0.2.2> 58 | auto result = uploadRoute nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:65:91: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | ? gateway.prepareBuild(*ctx, [&](std::string_view drv, uint64_t id) -> std::optional { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:67:68: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | if (drv == "assigned.drv" && id == 42) return worker; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:67:71: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | if (drv == "assigned.drv" && id == 42) return worker; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:72:25: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 72 | prepared = std::move(result.prepared); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:75:37: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 11 | auto decoded = nixgrpc::ReverseCapability::authorizeOpen(prepared->session->sessionKey, prepared->open, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:78:65: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 10 | reply->set_trusted(decoded->caller.role == nixgrpc::Role::trusted); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:84:5: error: an exception may be thrown in function 'main' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | int main(int argc, char **argv) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/acl.hh:82:13: note: frame #0: unhandled exception of type 'nix::Error' may be thrown in function 'addRule' here nix-grpc-store-clang-tidy-0.2.2> 82 | throw nix::Error("--allow must be 'cn-pattern=role', got '%s'", std::string(spec)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:102:9: note: frame #1: function 'main' calls function 'addRule' here nix-grpc-store-clang-tidy-0.2.2> 102 | auth.acl.addRule("localhost=read-only"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:84:5: error: use a trailing return type for this function [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | int main(int argc, char **argv) nix-grpc-store-clang-tidy-0.2.2> | ~~~ ^ nix-grpc-store-clang-tidy-0.2.2> | auto -> int nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:97:25: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 97 | auto session = *registry.registerWorker(worker, worker, [] {}, *key, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> 98 | std::make_shared()); nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:97:65: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 97 | auto session = *registry.registerWorker(worker, worker, [] {}, *key, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:98:75: error: no header providing "nixgrpc::ReverseTransport" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 12 | std::make_shared()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:99:18: error: no header providing "nixgrpc::Auth" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 10 | nixgrpc::Auth auth; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:100:38: error: no header providing "nixgrpc::oidc::Verifier" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 11 | std::optional oidc; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:105:42: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | [&](std::string_view selected, std::string_view drv, uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> 106 | { return assigned && selected == worker && drv == "assigned.drv" && id == 42; }); nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:105:104: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | [&](std::string_view selected, std::string_view drv, uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:106:116: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 106 | { return assigned && selected == worker && drv == "assigned.drv" && id == 42; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:112:55: error: no header providing "grpc::InsecureServerCredentials" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | builder.AddListeningPort("127.0.0.1:0", grpc::InsecureServerCredentials(), &port); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:113:15: error: no header providing "grpc::SslServerCredentialsOptions" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 113 | grpc::SslServerCredentialsOptions tls; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:114:56: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 114 | tls.pem_root_certs = nix::readFile(std::string(argv[1]) + "/server.crt"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:115:42: error: use designated initializer list to initialize 'value_type' (aka 'grpc::SslServerCredentialsOptions::PemKeyCertPair') [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 115 | tls.pem_key_cert_pairs.push_back({nix::readFile(std::string(argv[1]) + "/server.key"), tls.pem_root_certs}); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .private_key= .cert_chain= nix-grpc-store-clang-tidy-0.2.2> /nix/store/jiwg78779483yvcsn3nsv79d8nkncb9r-grpc-1.84.0/include/grpcpp/security/server_credentials.h:48:3: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 48 | struct PemKeyCertPair { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:115:69: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 115 | tls.pem_key_cert_pairs.push_back({nix::readFile(std::string(argv[1]) + "/server.key"), tls.pem_root_certs}); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:116:42: error: no header providing "GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | tls.client_certificate_request = GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:117:55: error: no header providing "grpc::SslServerCredentials" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 117 | builder.AddListeningPort("127.0.0.1:0", grpc::SslServerCredentials(tls), &tlsPort); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:122:53: error: no header providing "std::to_string" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 122 | grpc::CreateChannel("127.0.0.1:" + std::to_string(port), grpc::InsecureChannelCredentials())); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:122:76: error: no header providing "grpc::InsecureChannelCredentials" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | grpc::CreateChannel("127.0.0.1:" + std::to_string(port), grpc::InsecureChannelCredentials())); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:125:13: error: variable 'req' of type 'nix::remote::StoreInfoRequest' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 125 | nix::remote::StoreInfoRequest req; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:140:19: error: no header providing "grpc::SslCredentialsOptions" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 140 | grpc::SslCredentialsOptions clientTls; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:145:83: error: no header providing "grpc::SslCredentials" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | grpc::CreateChannel("localhost:" + std::to_string(tlsPort), grpc::SslCredentials(clientTls))); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:150:26: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 150 | nix::remote::ReverseFarmMsg queued; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:158:26: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 158 | nix::remote::ReverseOpen ackOpen; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:178:41: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 178 | assert(gateway.enqueue(std::move(tampered), 2).error_code() == grpc::StatusCode::PERMISSION_DENIED); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:188:32: error: 41 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 188 | service.assignId = 41; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:195:32: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 195 | service.assignId = 42; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:205:32: error: 41 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 205 | service.assignId = 41; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:211:32: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 211 | service.assignId = 42; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:243:60: error: no header providing "nix::bmRepair" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 4 | service.buildMode = static_cast(nix::bmRepair); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:263:32: error: 43 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 263 | service.assignId = 43; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:266:32: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 266 | service.assignId = 42; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:274:64: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 274 | session = *registry.registerWorker(worker, worker, [] {}, *newKey, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:291:33: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 291 | auto rejectUpload = [&](nix::remote::NixRemote::Stub & client, grpc::StatusCode expected) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:293:51: error: no header providing "std::chrono::system_clock" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 2 | context.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:293:86: error: no header providing "std::chrono::seconds" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 293 | context.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:293:94: error: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 293 | context.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:298:38: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 298 | header.set_assign_id(42); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:309:37: error: performing an implicit widening conversion to type 'size_type' (aka 'unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 309 | std::string const large(96 * 1024, 'x'); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:309:37: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 2 | std::string const large(96 * 1024, 'x'); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:309:37: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 309 | std::string const large(96 * 1024, 'x'); nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:311:18: error: no header providing "std::jthread" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 9 | std::jthread uploadWorker([&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:311:39: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 311 | std::jthread uploadWorker([&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:318:26: error: no header providing "nixgrpc::ReverseUpload" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 13 | nixgrpc::ReverseUpload::Decoder decoder(*delegated); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:322:25: error: side effect in assert() condition discarded in release builds [bugprone-assert-side-effect,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 322 | assert(decoder.feed(frame.data().data(), [&](nix::remote::UploadBuildInputsChunk && chunk) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:322:32: error: side effects in the 1st macro argument '__VA_ARGS__' are repeated in macro expansion [bugprone-macro-repeated-side-effects,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 322 | assert(decoder.feed(frame.data().data(), [&](nix::remote::UploadBuildInputsChunk && chunk) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> /nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:137:13: note: macro 'assert' defined here nix-grpc-store-clang-tidy-0.2.2> 137 | # define assert(...) \ nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:322:66: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 322 | assert(decoder.feed(frame.data().data(), [&](nix::remote::UploadBuildInputsChunk && chunk) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> /nix/store/2gh2kjj22acjw1354if79dgr6l73y3sl-glibc-2.44-57-dev/include/assert.h:138:8: note: expanded from macro 'assert' nix-grpc-store-clang-tidy-0.2.2> 138 | ((__VA_ARGS__) \ nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:322:109: error: rvalue reference parameter 'chunk' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 322 | assert(decoder.feed(frame.data().data(), [&](nix::remote::UploadBuildInputsChunk && chunk) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:327:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 327 | } else if (frame.half_close()) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 328 | else assert(false); nix-grpc-store-clang-tidy-0.2.2> | } nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:327:51: error: statement should have braces [readability-inconsistent-ifelse-braces,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 327 | } else if (frame.half_close()) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 328 | else assert(false); nix-grpc-store-clang-tidy-0.2.2> | } nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:328:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 328 | else assert(false); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:328:25: error: statement should have braces [readability-inconsistent-ifelse-braces,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 328 | else assert(false); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:331:30: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 331 | nix::remote::ReverseWorkerMsg reply; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:335:66: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 335 | assert(session->transport->responses.accept(std::move(reply))); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:338:92: error: 20 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 338 | uploadCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(20)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:344:39: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 344 | firstUpload.set_assign_id(42); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/reverse-gateway-test.cc:349:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 349 | for (size_t i = 0; i < uploadChunks; ++i) assert(uploader->Write(nextUpload)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/client/build.cc nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:86:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 86 | for (auto const & drvPath : drvPaths) evalStore.computeFSClosure(drvPath, missing); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:126:37: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 126 | for (auto & [info, nar] : sources) paths.emplace_back(info, ReplayableNar(std::move(nar), spool, info.narSize)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:154:17: error: function 'buildAssigned' has cognitive complexity of 27 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 154 | auto GrpcStore::buildAssigned(const Job & job, const nixgrpc::exec::Placement & where, BuildMode buildMode, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:168:52: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 168 | auto headers = routingFor(job.drv, where.reverse ? "" : where.addr, where.system); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:169:3: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 169 | if (where.reverse) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:175:3: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 175 | if (status.error_code() == grpc::StatusCode::NOT_FOUND) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:180:5: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 180 | if (where.reverse && !config->reverseUploads) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:180:23: note: +1 nix-grpc-store-clang-tidy-0.2.2> 180 | if (where.reverse && !config->reverseUploads) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:184:50: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 184 | where.reverse ? std::optional(std::pair{job.drvPath, where.assignId}) : std::nullopt); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:185:5: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 185 | if (!upload.ok()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:187:41: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 187 | checkStatus(upload, where.reverse ? "UploadBuildInputs" : "AddMultipleToStore"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:195:3: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 195 | if (!status.ok()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:198:3: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 198 | switch (status.error_code()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:200:5: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 200 | if (!missing.empty()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:209:5: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 209 | if (status.error_code() != grpc::StatusCode::ABORTED) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:210:7: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 210 | printError("%s: %s, asking the scheduler again", job.drvPath.to_string(), firstLine(status.error_message())); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> /nix/store/3qkblpvm8iqndnnav082hsxrmjvw5dfn-nix-util-2.36.0pre20261025_d99b7516-dev/include/nix/util/logging.hh:365:29: note: expanded from macro 'printError' nix-grpc-store-clang-tidy-0.2.2> 365 | #define printError(args...) printMsg(lvlError, args) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> /nix/store/3qkblpvm8iqndnnav082hsxrmjvw5dfn-nix-util-2.36.0pre20261025_d99b7516-dev/include/nix/util/logging.hh:363:34: note: expanded from macro 'printMsg' nix-grpc-store-clang-tidy-0.2.2> 363 | #define printMsg(level, args...) printMsgUsing(logger, level, args) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> /nix/store/3qkblpvm8iqndnnav082hsxrmjvw5dfn-nix-util-2.36.0pre20261025_d99b7516-dev/include/nix/util/logging.hh:357:5: note: expanded from macro 'printMsgUsing' nix-grpc-store-clang-tidy-0.2.2> 357 | do { \ nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:210:7: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 210 | printError("%s: %s, asking the scheduler again", job.drvPath.to_string(), firstLine(status.error_message())); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> /nix/store/3qkblpvm8iqndnnav082hsxrmjvw5dfn-nix-util-2.36.0pre20261025_d99b7516-dev/include/nix/util/logging.hh:365:29: note: expanded from macro 'printError' nix-grpc-store-clang-tidy-0.2.2> 365 | #define printError(args...) printMsg(lvlError, args) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> /nix/store/3qkblpvm8iqndnnav082hsxrmjvw5dfn-nix-util-2.36.0pre20261025_d99b7516-dev/include/nix/util/logging.hh:363:34: note: expanded from macro 'printMsg' nix-grpc-store-clang-tidy-0.2.2> 363 | #define printMsg(level, args...) printMsgUsing(logger, level, args) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> /nix/store/3qkblpvm8iqndnnav082hsxrmjvw5dfn-nix-util-2.36.0pre20261025_d99b7516-dev/include/nix/util/logging.hh:359:9: note: expanded from macro 'printMsgUsing' nix-grpc-store-clang-tidy-0.2.2> 359 | if (__lvl <= nix::verbosity) { \ nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:216:3: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 216 | if (!res) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/build.cc:382:63: error: 250 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 382 | std::this_thread::sleep_for(std::chrono::milliseconds(250)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:327:14: error: variable 'extra' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 327 | char extra; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | = 0 nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:330:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:336:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 336 | if (out.pos != 0) throw nix::Error("trailing decompressed upload data"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:338:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 338 | if (zin.pos != zin.size) throw nix::Error("trailing compressed upload data"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/client/transfer.cc nix-grpc-store-clang-tidy-0.2.2> ../src/client/transfer.cc:231:16: error: no header providing "std::optional" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 11 | const std::optional> & reverseAssignment) -> grpc::Status nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/transfer.cc:245:62: error: member 'writer' of type 'grpc::ClientWriter &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 245 | grpc::ClientWriter & writer; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/transfer.cc:258:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 258 | if (!writer->Write(first)) throw Error("reverse upload closed before header"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/client/transfer.cc:258:42: error: no header providing "nix::Error" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 11 | if (!writer->Write(first)) throw Error("reverse upload closed before header"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/client/transfer.cc:273:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 273 | if (status.ok()) throw; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:327:14: error: variable 'extra' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 327 | char extra; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | = 0 nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:330:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:336:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 336 | if (out.pos != 0) throw nix::Error("trailing decompressed upload data"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:338:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 338 | if (zin.pos != zin.size) throw nix::Error("trailing compressed upload data"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/daemon/auth.cc nix-grpc-store-clang-tidy-0.2.2> [1/1] (1/3) Processing file /build/source/src/daemon/auth.cc. nix-grpc-store-clang-tidy-0.2.2> [1/1] (2/3) Processing file /build/source/src/daemon/auth.cc. nix-grpc-store-clang-tidy-0.2.2> [1/1] (3/3) Processing file /build/source/src/daemon/auth.cc. nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:519:10: error: function 'doVerify' has cognitive complexity of 49 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 519 | auto doVerify(const std::string & token, std::chrono::system_clock::time_point now) -> Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:522:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 522 | if (!parsed) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:525:47: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 525 | auto const iss = parsed->has_issuer() ? parsed->get_issuer() : ""; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:526:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 526 | for (size_t idx = 0; idx < config.providers.size(); ++idx) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:528:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 528 | if (provider.issuer != iss) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:531:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 531 | if (!parsed->has_expires_at()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:535:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 535 | for (auto & verifier : candidates(provider, keys.at(idx), *parsed, now)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:538:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 538 | if (!err) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:542:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 542 | if (err) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:547:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 547 | if (sub.empty() || sub.contains('\0')) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:547:29: note: +1 nix-grpc-store-clang-tidy-0.2.2> 547 | if (sub.empty() || sub.contains('\0')) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:552:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 552 | if (auto const * namespaceClaim = lookupClaim(claims, "kubernetes.io.namespace"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:32: note: +1 nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:82: note: +1 nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:67: note: +1 nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:66: note: +1 nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:91: note: +1 nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:65: note: +1 nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:569:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 569 | if (auto const aud = claims.find("aud"); aud != claims.end()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:570:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 570 | if (aud->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:572:24: note: +1, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:572:64: note: +1 nix-grpc-store-clang-tidy-0.2.2> 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:577:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 577 | if (parsed->has_issued_at()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:580:68: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 580 | return {.identity = std::move(identity), .error = role ? "" : "no rule matched"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/daemon/scheduler-service.cc nix-grpc-store-clang-tidy-0.2.2> [1/1] (1/2) Processing file /build/source/src/daemon/scheduler-service.cc. nix-grpc-store-clang-tidy-0.2.2> [1/1] (2/2) Processing file /build/source/src/daemon/scheduler-service.cc. nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 12 | #include nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> 13 | #include nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 90 | std::chrono::system_clock::time_point credentialExpiresAt{}; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:519:10: error: function 'doVerify' has cognitive complexity of 49 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 519 | auto doVerify(const std::string & token, std::chrono::system_clock::time_point now) -> Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:522:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 522 | if (!parsed) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:525:47: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 525 | auto const iss = parsed->has_issuer() ? parsed->get_issuer() : ""; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:526:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 526 | for (size_t idx = 0; idx < config.providers.size(); ++idx) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:528:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 528 | if (provider.issuer != iss) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:531:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 531 | if (!parsed->has_expires_at()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:535:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 535 | for (auto & verifier : candidates(provider, keys.at(idx), *parsed, now)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:538:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 538 | if (!err) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:542:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 542 | if (err) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:547:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 547 | if (sub.empty() || sub.contains('\0')) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:547:29: note: +1 nix-grpc-store-clang-tidy-0.2.2> 547 | if (sub.empty() || sub.contains('\0')) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:552:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 552 | if (auto const * namespaceClaim = lookupClaim(claims, "kubernetes.io.namespace"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:32: note: +1 nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:82: note: +1 nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:67: note: +1 nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:66: note: +1 nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:91: note: +1 nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:65: note: +1 nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:569:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 569 | if (auto const aud = claims.find("aud"); aud != claims.end()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:570:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 570 | if (aud->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:572:24: note: +1, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:572:64: note: +1 nix-grpc-store-clang-tidy-0.2.2> 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:577:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 577 | if (parsed->has_issued_at()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:580:68: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 580 | return {.identity = std::move(identity), .error = role ? "" : "no rule matched"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/options.hh:45:50: error: 600 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 45 | std::chrono::seconds reverseMaxTokenLifetime{600}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (RAND_bytes(reinterpret_cast(key.data()), static_cast(key.size())) != 1) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:62:95: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:96:61: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | result.push_back(static_cast(size >> (i * 8))); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:46: error: 2 adjacent parameters of 'verify' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:183:107: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:250:9: error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 250 | unsigned char mac[EVP_MAX_MD_SIZE]; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast(key.size()), nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | ( nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | == nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:86: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 258 | return std::string(reinterpret_cast(mac), macBytes); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto data(uint64_t id, std::string_view bytes) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | if (size > limit) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | cv.wait(lock, stop, [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | auto const it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto acknowledge(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!enqueue(std::move(msg))) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | if (streams.contains(id) && acknowledged.contains(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 150 | if (removed) cv.notify_all(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | void acknowledgementSent(uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 208 | auto terminal(uint64_t id, bool abort) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:63:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 63 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:65:14: error: variable 'minRole' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | Role minRole; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:81:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | return {{grpc::StatusCode::UNIMPLEMENTED, "unknown reverse method"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:85:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 85 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:91:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 91 | return {{grpc::StatusCode::INVALID_ARGUMENT, "upload does not accept a build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:95:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:99:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no matching live assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:104:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unexpected build assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:109:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session unavailable"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:115:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 115 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session changed"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:122:16: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open), nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> 123 | std::string(drvPath), assignId}}; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:122:43: error: use designated initializer list to initialize 'Prepared' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open), nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .session= .open= nix-grpc-store-clang-tidy-0.2.2> 123 | std::string(drvPath), assignId}}; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .drvPath= .assignId= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:33:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 33 | struct Prepared nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:185:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 185 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:189:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 189 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:193:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 193 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:197:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 197 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned build route"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:202:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 202 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound build assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:214:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 214 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:218:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 218 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:222:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 222 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned upload route"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:227:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 227 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:233:11: error: member 'auth' of type 'Auth &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 233 | Auth &auth; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:234:22: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 234 | ReverseRegistry ®istry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:43:24: error: function 'accept' has cognitive complexity of 27 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg &frame) -> std::optional nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:45:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 45 | if (closed || frame.generation() != 0 || !frame.session_key().empty() || frame.stream_id() == 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:45:79: note: +1 nix-grpc-store-clang-tidy-0.2.2> 45 | if (closed || frame.generation() != 0 || !frame.session_key().empty() || frame.stream_id() == 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:47:32: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 47 | rejection = closed ? "session closed" : "bad frame header"; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:51:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 51 | if (frame.has_open()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:53:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 53 | if (id <= lastId || streams.size() >= ReverseFrames::maxStreams) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:53:30: note: +1 nix-grpc-store-clang-tidy-0.2.2> 53 | if (id <= lastId || streams.size() >= ReverseFrames::maxStreams) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:55:42: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 55 | rejection = id <= lastId ? "stream id not increasing" : "too many streams"; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 59 | if (!caller) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:69:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 69 | if (it == streams.end()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 73 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel() nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:17: note: +1 nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:79:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 79 | if (frame.has_data()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 81 | if (it->second || frame.data().data().empty() || frame.data().data().size() > ReverseFrames::maxFrameBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:81:59: note: +1 nix-grpc-store-clang-tidy-0.2.2> 81 | if (it->second || frame.data().data().empty() || frame.data().data().size() > ReverseFrames::maxFrameBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:88:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 88 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kHalfClose && frame.half_close() && !it->second) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:88:97: note: +1 nix-grpc-store-clang-tidy-0.2.2> 88 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kHalfClose && frame.half_close() && !it->second) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:93:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 93 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:93:72: note: +1 nix-grpc-store-clang-tidy-0.2.2> 93 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:95:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 95 | if (cancelledIds.size() >= maxCancelled) { closed = true; rejection = "too many cancels"; return std::nullopt; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:50:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 50 | auto const id = frame.stream_id(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:68:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 68 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != 0u) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 75 | return Event{.kind = Event::Kind::cancel, .streamId = id}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:109:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | if (cancelledIds.erase(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | if (cancelledIds.erase(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (!streams.erase(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | == 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (!streams.erase(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:44:71: error: 128 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:82:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | auto it = sessions.find(std::string(workerId)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:92:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 92 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:107:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:130:30: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 130 | for (auto & [id, session] : sessions) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:43:24: error: function 'call' has cognitive complexity of 101 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | [[nodiscard]] auto call(grpc::ServerContext & context, const Select & select, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:49:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:49:21: note: +1 nix-grpc-store-clang-tidy-0.2.2> 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:56:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 56 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:57:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:59:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:59:22: note: +1 nix-grpc-store-clang-tidy-0.2.2> 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:60:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:60:27: note: +1 nix-grpc-store-clang-tidy-0.2.2> 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:62:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:64:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 64 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:65:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 65 | if (!selection.prepared || selection.prepared->session != session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:65:33: note: +1 nix-grpc-store-clang-tidy-0.2.2> 65 | if (!selection.prepared || selection.prepared->session != session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:67:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 67 | if (request.ByteSizeLong() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:70:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 70 | if (bytes.size() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:72:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:75:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 75 | if (!status.ok()) return status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:81:13: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 81 | ~Release() { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:84:17: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 84 | if (!completed) (void) transport.outgoing.cancel(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:98:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 98 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:99:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:100:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:100:44: note: +1 nix-grpc-store-clang-tidy-0.2.2> 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:100:62: note: +1 nix-grpc-store-clang-tidy-0.2.2> 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:102:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:105:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:111:30: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 111 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:113:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 113 | while (!stop.stop_requested()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:114:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 114 | if (context.IsCancelled() || std::chrono::system_clock::now() >= deadline || !registry.current(session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:115:22: note: +1 nix-grpc-store-clang-tidy-0.2.2> 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:115:60: note: +1 nix-grpc-store-clang-tidy-0.2.2> 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:115:80: note: +1 nix-grpc-store-clang-tidy-0.2.2> 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:119:76: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:125:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 125 | while (transport.responses.waitTake(id, frame, wake.get_token())) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:126:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:44: note: +1 nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:82: note: +1 nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:102: note: +1 nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:129:47: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:130:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 130 | if (frame.has_finish()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:131:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:131:55: note: +1 nix-grpc-store-clang-tidy-0.2.2> 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:131:75: note: +1 nix-grpc-store-clang-tidy-0.2.2> 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:133:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:133:38: note: +1 nix-grpc-store-clang-tidy-0.2.2> 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:134:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 134 | if (resultReceived && resultReceived()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:134:36: note: +1 nix-grpc-store-clang-tidy-0.2.2> 134 | if (resultReceived && resultReceived()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:135:21: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 135 | if (beforeAck) beforeAck(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:136:21: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 136 | if (!transport.outgoing.acknowledge(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:143:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 143 | while (true) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:144:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 144 | if (!expected) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:145:21: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 145 | if (pending.size() < 4) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:147:21: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 147 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:149:21: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:153:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 153 | if (pending.size() < *expected) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:154:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 154 | if (!receive(std::string_view(pending).substr(0, *expected))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:159:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:161:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:162:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:163:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:163:47: note: +1 nix-grpc-store-clang-tidy-0.2.2> 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:163:67: note: +1 nix-grpc-store-clang-tidy-0.2.2> 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:49:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:56:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:57:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:59:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:60:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:61:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 61 | auto const id = session->transport->nextStreamId.fetch_add(1); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:62:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:64:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:65:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | if (!selection.prepared || selection.prepared->session != session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 66 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker changed during selection"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:67:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | if (request.ByteSizeLong() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 68 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:70:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 70 | if (bytes.size() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 71 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:72:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:75:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (!status.ok()) return status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:77:16: error: class 'Release' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:77:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> 78 | ReverseTransport & transport; nix-grpc-store-clang-tidy-0.2.2> 79 | uint64_t id; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> | {} nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:78:32: error: member 'transport' of type 'ReverseTransport &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 78 | ReverseTransport & transport; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:84:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | if (!completed) (void) transport.outgoing.cancel(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:86: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:96: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:99:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:100:83: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 101 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker or assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:102:115: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 103 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request queue full"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:105:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:111:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:119:71: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:119:76: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:126:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:125: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 128 | return {grpc::StatusCode::UNAVAILABLE, nix-grpc-store-clang-tidy-0.2.2> 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:131:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 132 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:133:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:135:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 135 | if (beforeAck) beforeAck(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:136:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 136 | if (!transport.outgoing.acknowledge(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 137 | return {grpc::StatusCode::UNAVAILABLE, "cannot acknowledge reverse result"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:145:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | if (pending.size() < 4) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:147:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 147 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:148:91: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:148:101: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:149:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:153:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 153 | if (pending.size() < *expected) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:154:78: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 154 | if (!receive(std::string_view(pending).substr(0, *expected))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 155 | return {grpc::StatusCode::DATA_LOSS, "invalid or rejected reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:159:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:161:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:162:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:163:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 164 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:169:22: error: member 'gateway' of type 'ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 169 | ReverseGateway & gateway; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:170:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 170 | ReverseRegistry & registry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:46:24: error: function 'accept' has cognitive complexity of 40 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 46 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg & frame) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:52:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 52 | if (!event) { rejection = inbound.lastRejection(); return false; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:54:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 54 | switch (event->kind) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:56:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 56 | if (!event->caller) { rejection = "open without caller"; return false; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 59 | if (frame.open().method() == "UploadBuildInputs") { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:61:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:61:30: note: +1 nix-grpc-store-clang-tidy-0.2.2> 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:66:21: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 73 | if (frame.open().method() != "BuildDerivation") { rejection = "method not served"; return false; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:77:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 77 | if (auto it = uploads.find(id); it != uploads.end()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 81 | if (pending.wire.size() > ReverseRelay::maxRequestBytes + 4 nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:82:17: note: +1 nix-grpc-store-clang-tidy-0.2.2> 82 | || size > ReverseRelay::maxRequestBytes + 4 - pending.wire.size()) { rejection = "request too large"; return false; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:84:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 84 | if (!pending.length && pending.wire.size() >= 4) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:84:33: note: +1 nix-grpc-store-clang-tidy-0.2.2> 84 | if (!pending.length && pending.wire.size() >= 4) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:86:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 86 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:88:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 88 | if (length > ReverseRelay::maxRequestBytes) { rejection = "request too large"; return false; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:91:36: note: +1 nix-grpc-store-clang-tidy-0.2.2> 91 | return !pending.length || pending.wire.size() <= static_cast(*pending.length) + 4; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:94:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:96:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:96:60: note: +1 nix-grpc-store-clang-tidy-0.2.2> 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:108:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 108 | if (auto it = uploads.find(id); it != uploads.end()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:112:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:112:29: note: +1 nix-grpc-store-clang-tidy-0.2.2> 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:114:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 114 | if (ready && ready->id == id) ready.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:114:23: note: +1 nix-grpc-store-clang-tidy-0.2.2> 114 | if (ready && ready->id == id) ready.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:48:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 48 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:53:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto const id = event->streamId; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:66:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:77:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | if (auto it = uploads.find(id); it != uploads.end()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:77:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | if (auto it = uploads.find(id); it != uploads.end()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 78 | return it->second->feed(frame.data().data()); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:86:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 86 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 87 | length |= static_cast(static_cast(pending.wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:87:92: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | length |= static_cast(static_cast(pending.wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:87:102: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | length |= static_cast(static_cast(pending.wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:94:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:94:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:95:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | auto it = requests.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:108:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 108 | if (auto it = uploads.find(id); it != uploads.end()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:112:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:114:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 114 | if (ready && ready->id == id) ready.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:121:64: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 121 | [[nodiscard]] auto lastRejection() const -> const char * { std::scoped_lock lock(mutex); return rejection; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:123:62: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 123 | [[nodiscard]] auto takeReady() -> std::optional { std::scoped_lock lock(mutex); return std::exchange(ready, std::nullopt); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:124:69: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 124 | [[nodiscard]] auto takeUploadReady() -> std::optional { std::scoped_lock lock(mutex); return std::exchange(uploadReady, std::nullopt); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:130:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 130 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:131:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:131:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:141:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 141 | [[nodiscard]] auto finished(uint64_t id) -> bool { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:142:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 142 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:148:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:149:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:149:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:32:38: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | [[nodiscard]] auto open(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:51:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 51 | auto it = streams.find(frame.stream_id()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | if (!cancelled.contains(frame.stream_id())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:101: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | auto pending = [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::_Deque_iterator nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | std::ranges::find_if queue nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:111:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | auto it = pending(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:135:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:168:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | [[nodiscard]] auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:171:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 171 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:20: error: variable name 'ok' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:45: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:88: error: rvalue reference parameter 'frame' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 33 | if (assigned && !assigned()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:35:13: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 35 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 42 | if (!ok) cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:49:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 68 | if (closed) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 79 | if (ended || !chunks.empty()) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:80:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 80 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | if (chunks.empty()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:92:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 92 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:103:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 103 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 113 | if (!ended || closed || !chunks.empty()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:120:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 120 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:129:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 129 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | if (failed || bytes.empty() || !consume) return fail(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:53:37: error: result of a `data()` call may not be null terminated, provide size information to the callee to prevent potential issues [bugprone-suspicious-stringview-data-usage,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | buffer.append(bytes.data(), count); nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~^~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | for (unsigned i = 0; i < 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:58:90: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:58:100: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 59 | if (length == 0 || length > maxChunkBytes) return fail(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast(*expected)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 66 | return fail(); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler-service.cc:20:74: error: no header providing "nixgrpc::IdleTracker" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 14 | #include "logfmt.hh" nix-grpc-store-clang-tidy-0.2.2> 15 | #include "sched-reactor.hh" nix-grpc-store-clang-tidy-0.2.2> 16 | #include "worker-identity.hh" nix-grpc-store-clang-tidy-0.2.2> 17 | nix-grpc-store-clang-tidy-0.2.2> 18 | namespace nixgrpc { nix-grpc-store-clang-tidy-0.2.2> 19 | nix-grpc-store-clang-tidy-0.2.2> 20 | SchedulerService::SchedulerService(Dispatcher & dispatcher, Auth & auth, IdleTracker & idle) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler-service.cc:28:14: error: no header providing "grpc::ServerBidiReactor" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 4 | -> grpc::ServerBidiReactor * nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler-service.cc:28:45: error: no header providing "nix::remote::ClientMsgs" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 15 | #include "sched-reactor.hh" nix-grpc-store-clang-tidy-0.2.2> 16 | #include "worker-identity.hh" nix-grpc-store-clang-tidy-0.2.2> 17 | nix-grpc-store-clang-tidy-0.2.2> 18 | namespace nixgrpc { nix-grpc-store-clang-tidy-0.2.2> 19 | nix-grpc-store-clang-tidy-0.2.2> 20 | SchedulerService::SchedulerService(Dispatcher & dispatcher, Auth & auth, IdleTracker & idle) nix-grpc-store-clang-tidy-0.2.2> 21 | : dispatcher(&dispatcher) nix-grpc-store-clang-tidy-0.2.2> 22 | , auth(&auth) nix-grpc-store-clang-tidy-0.2.2> 23 | , idle(&idle) nix-grpc-store-clang-tidy-0.2.2> 24 | { nix-grpc-store-clang-tidy-0.2.2> 25 | } nix-grpc-store-clang-tidy-0.2.2> 26 | nix-grpc-store-clang-tidy-0.2.2> 27 | auto SchedulerService::Schedule(grpc::CallbackServerContext * context) nix-grpc-store-clang-tidy-0.2.2> 28 | -> grpc::ServerBidiReactor * nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler-service.cc:28:70: error: no header providing "nix::remote::SchedMsgs" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 28 | -> grpc::ServerBidiReactor * nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler-service.cc:34:65: error: no header providing "nixgrpc::Role" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1 | if (auto const status = Auth::authorize(caller, "Schedule", Role::write); !status.ok()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler-service.cc:41:45: error: no header providing "nix::remote::WorkerMsgs" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 41 | -> grpc::ServerBidiReactor * nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler-service.cc:41:70: error: no header providing "nix::remote::SchedCmds" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 41 | -> grpc::ServerBidiReactor * nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler-service.cc:50:9: error: implicit conversion 'WorkerIdentity *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 50 | if (reverseIdentity) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != nullptr nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler-service.cc:61:17: error: variable 'token' of type 'std::string_view' (aka 'basic_string_view') can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 61 | std::string_view token(first->second.data(), first->second.size()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler-service.cc:81:20: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 4 | {grpc::StatusCode::UNAUTHENTICATED, "reverse control session requires a TLS client certificate"}); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler-service.cc:89:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 89 | renew = [identity = reverseIdentity, podId = verifiedPodId](const std::string & token) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::optional nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:323:61: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 323 | lastAssignId = (static_cast(entropy()) << 32) | entropy(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 371 | auto const it = workerIds.find(std::string(addr)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:20:22: error: member 'verifier' of type 'oidc::Verifier &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 20 | oidc::Verifier & verifier; // configured with a tunnel-only audience nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:29:86: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:29:103: error: parameter name 'c' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:43:22: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | if (i == 8 || i == 13 || i == 18 || i == 23) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:43:32: error: 13 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | if (i == 8 || i == 13 || i == 18 || i == 23) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:43:43: error: 18 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | if (i == 8 || i == 13 || i == 18 || i == 23) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:43:54: error: 23 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | if (i == 8 || i == 13 || i == 18 || i == 23) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:44:24: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (uid[i] != '-') { nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:47:24: error: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) { nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | < || > && < || > nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:47:30: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) { nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:47:47: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) { nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:47:66: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) { nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:47:83: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) { nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:96:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto const & id = *result.identity; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:107:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | if (maxLifetime.count() <= 0 || !id.issuedAt || *id.expiresAt - *id.issuedAt > maxLifetime nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:108:17: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 108 | || *id.expiresAt > std::chrono::system_clock::now() + maxLifetime + skew) { nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:111:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | auto const boundId = "pod:" + nameSpace + ":" + *id.podUid; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:112:57: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | return Bound{.workerId = boundId, .expiresAt = *id.expiresAt}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/tests/oidc-test.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 12 | #include nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> 13 | #include nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 90 | std::chrono::system_clock::time_point credentialExpiresAt{}; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/options.hh:45:50: error: 600 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 45 | std::chrono::seconds reverseMaxTokenLifetime{600}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (RAND_bytes(reinterpret_cast(key.data()), static_cast(key.size())) != 1) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:62:95: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:96:61: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | result.push_back(static_cast(size >> (i * 8))); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:46: error: 2 adjacent parameters of 'verify' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:183:107: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:250:9: error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 250 | unsigned char mac[EVP_MAX_MD_SIZE]; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast(key.size()), nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | ( nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | == nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:86: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 258 | return std::string(reinterpret_cast(mac), macBytes); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto data(uint64_t id, std::string_view bytes) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | if (size > limit) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | cv.wait(lock, stop, [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | auto const it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto acknowledge(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!enqueue(std::move(msg))) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | if (streams.contains(id) && acknowledged.contains(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 150 | if (removed) cv.notify_all(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | void acknowledgementSent(uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 208 | auto terminal(uint64_t id, bool abort) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:63:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 63 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:65:14: error: variable 'minRole' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | Role minRole; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:81:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | return {{grpc::StatusCode::UNIMPLEMENTED, "unknown reverse method"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:85:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 85 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:91:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 91 | return {{grpc::StatusCode::INVALID_ARGUMENT, "upload does not accept a build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:95:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:99:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no matching live assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:104:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unexpected build assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:109:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session unavailable"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:115:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 115 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session changed"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:122:16: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open), nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> 123 | std::string(drvPath), assignId}}; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:122:43: error: use designated initializer list to initialize 'Prepared' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open), nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .session= .open= nix-grpc-store-clang-tidy-0.2.2> 123 | std::string(drvPath), assignId}}; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .drvPath= .assignId= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:33:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 33 | struct Prepared nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:185:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 185 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:189:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 189 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:193:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 193 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:197:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 197 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned build route"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:202:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 202 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound build assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:214:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 214 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:218:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 218 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:222:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 222 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned upload route"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:227:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 227 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:233:11: error: member 'auth' of type 'Auth &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 233 | Auth &auth; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:234:22: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 234 | ReverseRegistry ®istry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:50:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 50 | auto const id = frame.stream_id(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:68:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 68 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != 0u) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 75 | return Event{.kind = Event::Kind::cancel, .streamId = id}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:109:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | if (cancelledIds.erase(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | if (cancelledIds.erase(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (!streams.erase(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | == 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (!streams.erase(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:44:71: error: 128 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:82:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | auto it = sessions.find(std::string(workerId)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:92:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 92 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:107:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:130:30: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 130 | for (auto & [id, session] : sessions) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:49:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:56:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:57:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:59:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:60:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:61:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 61 | auto const id = session->transport->nextStreamId.fetch_add(1); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:62:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:64:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:65:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | if (!selection.prepared || selection.prepared->session != session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 66 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker changed during selection"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:67:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | if (request.ByteSizeLong() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 68 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:70:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 70 | if (bytes.size() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 71 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:72:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:75:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (!status.ok()) return status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:77:16: error: class 'Release' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:77:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> 78 | ReverseTransport & transport; nix-grpc-store-clang-tidy-0.2.2> 79 | uint64_t id; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> | {} nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:78:32: error: member 'transport' of type 'ReverseTransport &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 78 | ReverseTransport & transport; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:84:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | if (!completed) (void) transport.outgoing.cancel(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:86: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:96: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:99:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:100:83: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 101 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker or assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:102:115: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 103 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request queue full"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:105:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:111:9: error: variable 'monitor' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:111:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:111:50: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:119:71: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:119:76: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:126:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:125: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 128 | return {grpc::StatusCode::UNAVAILABLE, nix-grpc-store-clang-tidy-0.2.2> 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:131:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 132 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:133:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:135:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 135 | if (beforeAck) beforeAck(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:136:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 136 | if (!transport.outgoing.acknowledge(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 137 | return {grpc::StatusCode::UNAVAILABLE, "cannot acknowledge reverse result"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:145:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | if (pending.size() < 4) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:147:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 147 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:148:91: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:148:101: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:149:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:153:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 153 | if (pending.size() < *expected) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:154:78: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 154 | if (!receive(std::string_view(pending).substr(0, *expected))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 155 | return {grpc::StatusCode::DATA_LOSS, "invalid or rejected reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:159:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:161:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:162:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:163:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 164 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:169:22: error: member 'gateway' of type 'ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 169 | ReverseGateway & gateway; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:170:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 170 | ReverseRegistry & registry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:48:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 48 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:53:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto const id = event->streamId; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:66:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:77:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | if (auto it = uploads.find(id); it != uploads.end()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:77:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | if (auto it = uploads.find(id); it != uploads.end()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 78 | return it->second->feed(frame.data().data()); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:86:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 86 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 87 | length |= static_cast(static_cast(pending.wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:87:92: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | length |= static_cast(static_cast(pending.wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:87:102: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | length |= static_cast(static_cast(pending.wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:94:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:94:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:95:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | auto it = requests.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:108:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 108 | if (auto it = uploads.find(id); it != uploads.end()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:112:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:114:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 114 | if (ready && ready->id == id) ready.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:121:64: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 121 | [[nodiscard]] auto lastRejection() const -> const char * { std::scoped_lock lock(mutex); return rejection; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:123:62: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 123 | [[nodiscard]] auto takeReady() -> std::optional { std::scoped_lock lock(mutex); return std::exchange(ready, std::nullopt); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:124:69: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 124 | [[nodiscard]] auto takeUploadReady() -> std::optional { std::scoped_lock lock(mutex); return std::exchange(uploadReady, std::nullopt); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:130:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 130 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:131:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:131:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:141:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 141 | [[nodiscard]] auto finished(uint64_t id) -> bool { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:142:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 142 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:148:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:149:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:149:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:32:38: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | [[nodiscard]] auto open(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:51:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 51 | auto it = streams.find(frame.stream_id()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | if (!cancelled.contains(frame.stream_id())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:101: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | auto pending = [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::_Deque_iterator nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | std::ranges::find_if queue nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:111:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | auto it = pending(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:135:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:168:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | [[nodiscard]] auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:171:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 171 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:42:17: error: implicit conversion 'grpc::ServerContext *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 42 | if (context) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != nullptr nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:54:22: error: member 'identity' of type 'WorkerIdentity &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 54 | WorkerIdentity & identity; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:55:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 55 | ReverseRegistry & registry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:56:12: error: member 'workerAuth' of type 'Auth &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | Auth & workerAuth; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:104:9: error: variable 'value' of type 'std::string_view' (aka 'basic_string_view') can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | std::string_view value(first->second.data(), first->second.size()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:134:47: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 134 | bound->workerId, msg.worker_id(), [cancellation] { cancellation->cancel(); }, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:139:9: error: variable 'cleanup' of type 'struct Cleanup' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 139 | struct Cleanup nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:139:16: error: class 'Cleanup' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 139 | struct Cleanup nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:141:31: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 141 | ReverseRegistry & registry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:149:18: error: use designated initializer list to initialize 'struct Cleanup' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | } cleanup{registry, *handle, cancellation}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .registry=.handle= .cancellation= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:139:9: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 139 | struct Cleanup nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:156:37: error: variable name 'cv' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | std::condition_variable_any cv; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:158:9: error: variable 'expiry' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 158 | std::jthread expiry([&, cancellation](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:158:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 158 | std::jthread expiry([&, cancellation](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:158:63: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 158 | std::jthread expiry([&, cancellation](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:161:53: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 161 | cv.wait_until(lock, stop, deadline, [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:177:9: error: variable 'writer' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 177 | std::jthread writer([&, cancellation](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:177:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 177 | std::jthread writer([&, cancellation](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:177:63: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 177 | std::jthread writer([&, cancellation](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:184:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 184 | if (frame.acknowledged()) transport->outgoing.acknowledgementSent(frame.stream_id()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:20: error: variable name 'ok' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:45: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:88: error: rvalue reference parameter 'frame' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 33 | if (assigned && !assigned()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:35:13: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 35 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 42 | if (!ok) cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:49:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 68 | if (closed) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 79 | if (ended || !chunks.empty()) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:80:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 80 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | if (chunks.empty()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:92:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 92 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:103:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 103 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 113 | if (!ended || closed || !chunks.empty()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:120:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 120 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:129:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 129 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | if (failed || bytes.empty() || !consume) return fail(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:53:37: error: result of a `data()` call may not be null terminated, provide size information to the callee to prevent potential issues [bugprone-suspicious-stringview-data-usage,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | buffer.append(bytes.data(), count); nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~^~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | for (unsigned i = 0; i < 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:58:90: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:58:100: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 59 | if (length == 0 || length > maxChunkBytes) return fail(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast(*expected)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 66 | return fail(); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:323:61: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 323 | lastAssignId = (static_cast(entropy()) << 32) | entropy(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 371 | auto const it = workerIds.find(std::string(addr)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:20:22: error: member 'verifier' of type 'oidc::Verifier &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 20 | oidc::Verifier & verifier; // configured with a tunnel-only audience nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:29:86: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:29:103: error: parameter name 'c' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:43:22: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | if (i == 8 || i == 13 || i == 18 || i == 23) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:43:32: error: 13 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | if (i == 8 || i == 13 || i == 18 || i == 23) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:43:43: error: 18 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | if (i == 8 || i == 13 || i == 18 || i == 23) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:43:54: error: 23 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | if (i == 8 || i == 13 || i == 18 || i == 23) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:44:24: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (uid[i] != '-') { nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:47:24: error: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) { nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | < || > && < || > nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:47:30: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) { nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:47:47: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) { nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:47:66: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) { nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:47:83: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) { nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:96:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto const & id = *result.identity; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:107:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | if (maxLifetime.count() <= 0 || !id.issuedAt || *id.expiresAt - *id.issuedAt > maxLifetime nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:108:17: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 108 | || *id.expiresAt > std::chrono::system_clock::now() + maxLifetime + skew) { nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:111:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | auto const boundId = "pod:" + nameSpace + ":" + *id.podUid; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:112:57: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | return Bound{.workerId = boundId, .expiresAt = *id.expiresAt}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:4:1: error: included header atomic is not used directly [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 4 | #include nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> 5 | #include nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:243:53: error: no header providing "nix::remote::NixRemote" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 41 | class BuildRouteService final : public nix::remote::NixRemote::Service nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:245:31: error: member 'gateway' of type 'nixgrpc::ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 245 | nixgrpc::ReverseGateway & gateway; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:246:27: error: member 'dispatcher' of type 'nixgrpc::Dispatcher &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 246 | nixgrpc::Dispatcher & dispatcher; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:250:17: error: member variable 'drvPath' has public visibility [cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 250 | std::string drvPath; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:251:14: error: member variable 'assignId' has public visibility [cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 251 | uint64_t assignId = 0; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:252:17: error: member variable 'selectedPod' has public visibility [cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 252 | std::string selectedPod; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:253:10: error: member variable 'relayEnabled' has public visibility [cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | bool relayEnabled = false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:254:10: error: member variable 'buildRelayEnabled' has public visibility [cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 254 | bool buildRelayEnabled = false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:256:67: error: no header providing "nixgrpc::ReverseRegistry" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 42 | BuildRouteService(nixgrpc::ReverseGateway & gateway, nixgrpc::ReverseRegistry & registry, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:260:70: error: no header providing "nix::remote::StoreInfoRequest" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 41 | auto StoreInfo(grpc::ServerContext * context, const nix::remote::StoreInfoRequest * request, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:261:33: error: no header providing "nix::remote::StoreInfoReply" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 261 | nix::remote::StoreInfoReply * reply) -> grpc::Status override nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:261:66: error: no header providing "grpc::Status" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 10 | nix::remote::StoreInfoReply * reply) -> grpc::Status override nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:264:41: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 264 | return relay.call(*context, [&](uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> Result nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:264:54: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 264 | return relay.call(*context, [&](uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:266:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 266 | [this](std::string_view drv, uint64_t assign) { return dispatcher.assignmentPod(drv, assign); }, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::optional nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:268:26: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 268 | }, *request, [&](std::string_view data) { return reply->ParseFromArray(data.data(), static_cast(data.size())); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:271:23: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 271 | *context, [this](std::string_view drv, uint64_t id) { return dispatcher.assignmentPod(drv, id); }, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::optional nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:271:61: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 271 | *context, [this](std::string_view drv, uint64_t id) { return dispatcher.assignmentPod(drv, id); }, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:277:76: error: no header providing "nix::remote::BuildDerivationRequest" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 277 | auto BuildDerivation(grpc::ServerContext * context, const nix::remote::BuildDerivationRequest * request, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:278:58: error: no header providing "nix::remote::BuildDerivationChunk" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 278 | grpc::ServerWriter * writer) -> grpc::Status override nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:280:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 280 | if (!buildRelayEnabled) return {grpc::StatusCode::UNIMPLEMENTED, "test build relay disabled"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:280:47: error: no header providing "grpc::StatusCode" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 280 | if (!buildRelayEnabled) return {grpc::StatusCode::UNIMPLEMENTED, "test build relay disabled"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:282:44: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 282 | auto status = relay.call(*context, [&](uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> Result nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:282:57: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 282 | auto status = relay.call(*context, [&](uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:284:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 284 | [this](std::string_view drv, uint64_t assign) { return dispatcher.assignmentPod(drv, assign); }, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::optional nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:286:22: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 286 | }, *request, [&](std::string_view data) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:289:88: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 289 | chunk.event_case() == nix::remote::BuildDerivationChunk::EVENT_NOT_SET) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:292:12: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 292 | }, [this, drv = request->drv_path(), assign = request->assign_id()] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:457:59: error: 42 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 457 | check(!verifier.verify(ecKey.sign(claims({{"sub", 42}}))).identity, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:507:26: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 507 | projectedAudience["aud"] = {"grpc://worker-tunnel"}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:513:20: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 513 | replacement["kubernetes.io"]["pod"]["name"] = "worker-pod-2"; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:513:37: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 513 | replacement["kubernetes.io"]["pod"]["name"] = "worker-pod-2"; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:513:44: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 513 | replacement["kubernetes.io"]["pod"]["name"] = "worker-pod-2"; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:514:9: error: 'const auto replacementId' can be declared as 'const auto *const replacementId' [readability-qualified-auto,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 514 | auto const replacementId = "pod:staging:12345678-1234-1234-1234-123456789abd"; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | const auto *const nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:519:22: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 519 | otherAudience["aud"] = "grpc://cache"; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:522:22: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 522 | mixedAudience["aud"] = {"grpc://worker-tunnel", "grpc://cache"}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:526:23: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 526 | wrongNamespace["kubernetes.io"]["namespace"] = "production"; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:526:40: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 526 | wrongNamespace["kubernetes.io"]["namespace"] = "production"; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:529:16: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 529 | wrongSa["kubernetes.io"]["serviceaccount"]["name"] = "client"; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:529:33: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 529 | wrongSa["kubernetes.io"]["serviceaccount"]["name"] = "client"; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:529:51: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 529 | wrongSa["kubernetes.io"]["serviceaccount"]["name"] = "client"; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:532:14: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 532 | noUid["kubernetes.io"]["pod"].erase("uid"); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:532:31: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 532 | noUid["kubernetes.io"]["pod"].erase("uid"); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:536:14: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 536 | noPod["kubernetes.io"].erase("pod"); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:539:13: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 539 | noSa["kubernetes.io"].erase("serviceaccount"); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:542:16: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 542 | expired["exp"] = now() - longAgo; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:548:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 548 | longLived["exp"] = now() + 3600; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:548:36: error: 3600 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 548 | longLived["exp"] = now() + 3600; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:551:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 551 | backdated["iat"] = now() - 3000; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:551:36: error: 3000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 551 | backdated["iat"] = now() - 3000; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:552:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 552 | backdated["exp"] = now() + 3000; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:552:36: error: 3000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 552 | backdated["exp"] = now() + 3000; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:555:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 555 | futureIat["iat"] = now() + 1200; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:555:36: error: 1200 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 555 | futureIat["iat"] = now() + 1200; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:556:18: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | futureIat["exp"] = now() + 1500; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:556:36: error: 1500 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | futureIat["exp"] = now() + 1500; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:564:14: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | later["exp"] = now() + validFor + 60; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:564:43: error: 60 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | later["exp"] = now() + validFor + 60; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:576:18: error: no header providing "nixgrpc::Auth" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 38 | nixgrpc::Auth registrationAuth; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:579:15: error: no header providing "grpc::SslServerCredentialsOptions" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 10 | grpc::SslServerCredentialsOptions tls; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:581:42: error: no header providing "GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 10 | tls.client_certificate_request = GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:582:42: error: use designated initializer list to initialize 'value_type' (aka 'grpc::SslServerCredentialsOptions::PemKeyCertPair') [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 582 | tls.pem_key_cert_pairs.push_back({nix::readFile(dir + "/server.key"), nix::readFile(dir + "/server.crt")}); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .private_key= .cert_chain= nix-grpc-store-clang-tidy-0.2.2> /nix/store/jiwg78779483yvcsn3nsv79d8nkncb9r-grpc-1.84.0/include/grpcpp/security/server_credentials.h:48:3: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 48 | struct PemKeyCertPair { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:586:55: error: no header providing "grpc::SslServerCredentials" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 586 | builder.AddListeningPort("127.0.0.1:0", grpc::SslServerCredentials(tls), &port); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:587:55: error: no header providing "grpc::InsecureServerCredentials" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 587 | builder.AddListeningPort("127.0.0.1:0", grpc::InsecureServerCredentials(), &insecurePort); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:595:15: error: no header providing "grpc::SslCredentialsOptions" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 10 | grpc::SslCredentialsOptions roots; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:600:87: error: no header providing "grpc::SslCredentials" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 600 | auto channel = grpc::CreateChannel("localhost:" + std::to_string(port), grpc::SslCredentials(workerTls)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:601:34: error: no header providing "nix::remote::ReverseSession" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 601 | auto stub = nix::remote::ReverseSession::NewStub(channel); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:609:26: error: no header providing "nix::remote::ReverseWorkerMsg" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 609 | nix::remote::ReverseWorkerMsg registration; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:613:26: error: no header providing "nix::remote::ReverseFarmMsg" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 613 | nix::remote::ReverseFarmMsg ack; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:618:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 618 | auto open = [&](grpc::ClientContext &ctx, const std::string &credential, const std::string &claim) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> 619 | { nix-grpc-store-clang-tidy-0.2.2> | -> std::pair>, unsigned long> nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:618:51: error: 2 adjacent parameters of 'operator()' of similar type ('const std::string &') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 618 | auto open = [&](grpc::ClientContext &ctx, const std::string &credential, const std::string &claim) nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:618:70: note: the first parameter in the range is 'credential' nix-grpc-store-clang-tidy-0.2.2> 618 | auto open = [&](grpc::ClientContext &ctx, const std::string &credential, const std::string &claim) nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:618:101: note: the last parameter in the range is 'claim' nix-grpc-store-clang-tidy-0.2.2> 618 | auto open = [&](grpc::ClientContext &ctx, const std::string &credential, const std::string &claim) nix-grpc-store-clang-tidy-0.2.2> | ^~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:630:13: error: variable 'accepted' of type 'bool' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 630 | bool accepted = stream->Read(&ack); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:632:25: error: no header providing "std::pair" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 16 | return std::pair{std::move(stream), accepted ? ack.generation() : uint64_t{0}}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:632:35: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 632 | return std::pair{std::move(stream), accepted ? ack.generation() : uint64_t{0}}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:659:88: error: no header providing "grpc::InsecureChannelCredentials" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 659 | grpc::CreateChannel("127.0.0.1:" + std::to_string(insecurePort), grpc::InsecureChannelCredentials())); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:749:33: error: 99 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 749 | extra.set_stream_id(99); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:760:86: error: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 760 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:766:44: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 41 | auto capability = nixgrpc::ReverseCapability::mint( nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:768:30: error: no header providing "nixgrpc::Caller" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 768 | nixgrpc::Caller{.name = "read-client", .role = Role::readOnly, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:770:30: error: no header providing "nix::remote::ReverseOpen" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 770 | nix::remote::ReverseOpen start; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:772:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 772 | if (capability) start.set_capability(*capability); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:773:100: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 773 | check(capability && transport.responses.open(1) && transport.outgoing.open(1, std::move(start)) && nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:788:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 788 | if (secondCapability) secondStart.set_capability(*secondCapability); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:828:91: error: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 828 | firstCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:840:92: error: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 840 | secondCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:853:91: error: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 853 | otherCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:868:90: error: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 868 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:870:21: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 870 | soon["exp"] = now() + 2; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:880:90: error: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 880 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:882:21: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 882 | soon["exp"] = now() + 2; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:900:90: error: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 900 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:924:14: error: no header providing "std::optional" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 12 | std::optional noClientOidc; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:931:13: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 931 | [&dispatcher](std::string_view pod, std::string_view drv, uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:931:80: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 931 | [&dispatcher](std::string_view pod, std::string_view drv, uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:934:18: error: no header providing "nixgrpc::IdleTracker" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 40 | nixgrpc::IdleTracker idle; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:941:49: error: no header providing "GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 941 | controlTls.client_certificate_request = GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:942:49: error: use designated initializer list to initialize 'value_type' (aka 'grpc::SslServerCredentialsOptions::PemKeyCertPair') [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 942 | controlTls.pem_key_cert_pairs.push_back({nix::readFile(dir + "/server.key"), nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .private_key= nix-grpc-store-clang-tidy-0.2.2> 943 | nix::readFile(dir + "/server.crt")}); nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .cert_chain= nix-grpc-store-clang-tidy-0.2.2> /nix/store/jiwg78779483yvcsn3nsv79d8nkncb9r-grpc-1.84.0/include/grpcpp/security/server_credentials.h:48:3: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 48 | struct PemKeyCertPair { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:952:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 952 | if (!controlServer) return check.result(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:958:41: error: no header providing "nix::remote::Scheduler" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 958 | auto controlStub = nix::remote::Scheduler::NewStub(controlChannel); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:963:26: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 963 | auto sendHello = [&](grpc::ClientContext &ctx, std::string_view claim, std::string_view addr) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::unique_ptr< ::grpc::ClientReaderWriter< ::nix::remote::WorkerMsgs, ::nix::remote::SchedCmds>> nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:963:56: error: 2 adjacent parameters of 'operator()' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 963 | auto sendHello = [&](grpc::ClientContext &ctx, std::string_view claim, std::string_view addr) { nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:963:73: note: the first parameter in the range is 'claim' nix-grpc-store-clang-tidy-0.2.2> 963 | auto sendHello = [&](grpc::ClientContext &ctx, std::string_view claim, std::string_view addr) { nix-grpc-store-clang-tidy-0.2.2> | ^~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:963:97: note: the last parameter in the range is 'addr' nix-grpc-store-clang-tidy-0.2.2> 963 | auto sendHello = [&](grpc::ClientContext &ctx, std::string_view claim, std::string_view addr) { nix-grpc-store-clang-tidy-0.2.2> | ^~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:965:26: error: no header providing "nix::remote::WorkerMsgs" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 965 | nix::remote::WorkerMsgs messages; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:988:26: error: no header providing "nix::remote::SchedCmds" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 988 | nix::remote::SchedCmds commands; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1033:86: error: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1033 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1036:52: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1036 | auto client = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {}); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1036:74: error: no header providing "nix::remote::SchedMsg" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1036 | auto client = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {}); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1036:104: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1036 | auto client = dispatcher.connectClient([](const nix::remote::SchedMsg &) { return true; }, [] {}); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1037:26: error: no header providing "nix::remote::ClientMsgs" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1037 | nix::remote::ClientMsgs want; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1046:28: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1046 | auto const id = commands.msgs(0).expect().assign_id(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1074:23: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1074 | auto reauth = [](std::string tokenValue) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> nix::remote::WorkerMsgs nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1076:67: error: no header providing "std::move" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1076 | messages.add_msgs()->mutable_reauth()->set_token(std::move(tokenValue)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1080:28: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1080 | auto memberCount = [&] { return dispatcher.podConnected(workerId) ? size_t{1} : size_t{0}; }; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> size_t nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1092:86: error: 15 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1092 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(15)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1094:17: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1094 | soon["exp"] = now() + 2; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1109:86: error: 15 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1109 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(15)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1111:17: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1111 | soon["exp"] = now() + 2; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1116:71: error: 20 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1116 | std::this_thread::sleep_for(std::chrono::milliseconds(20)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1128:86: error: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1128 | ctx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1132:90: error: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1132 | dataCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1147:52: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1147 | auto client = dispatcher.connectClient([&](const nix::remote::SchedMsg &msg) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1153:16: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1153 | }, [] {}); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1165:28: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1165 | auto const id = commands.msgs(0).expect().assign_id(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1177:17: error: variable 'routeReq' of type 'nix::remote::StoreInfoRequest' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1177 | nix::remote::StoreInfoRequest routeReq; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1182:40: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1182 | std::jthread responder([&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1189:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1189 | if (!selected) return; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1194:55: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1194 | if (requestFrame.half_close()) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1208:55: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1208 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast((payload.size() >> shift) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1208:68: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1208 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast((payload.size() >> shift) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1208:70: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1208 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast((payload.size() >> shift) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1208:135: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1208 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast((payload.size() >> shift) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1217:95: error: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1217 | relayCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1224:45: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1224 | std::jthread buildResponder([&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1226:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1226 | if (!dataStream->Read(&frame)) return; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1228:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1228 | if (!selected) return; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1234:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1234 | if (frame.half_close()) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1246:55: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1246 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast((payload.size() >> shift) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1246:68: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1246 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast((payload.size() >> shift) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1246:70: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1246 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast((payload.size() >> shift) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1246:135: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1246 | for (unsigned shift = 0; shift != 32; shift += 8) encoded.push_back(static_cast((payload.size() >> shift) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1257:95: error: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1257 | buildCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1275:101: error: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1275 | replacementCtx.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(10)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1297:13: error: variable 'cancelledReq' of type 'nix::remote::StoreInfoRequest' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1297 | nix::remote::StoreInfoRequest cancelledReq; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../tests/oidc-test.cc:1311:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1311 | if (!status.ok()) std::cerr << "control Finish: " << status.error_message() << "\n"; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/daemon/coordinator.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:45:1: error: included header acl.hh is not used directly [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 45 | #include "acl.hh" nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> 46 | #include "auth.hh" nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:59:1: error: included header sched-reactor.hh is not used directly [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 59 | #include "sched-reactor.hh" nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> 60 | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:63:20: error: using decl 'ClientMsgs' is unused [misc-unused-using-decls,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 63 | using nix::remote::ClientMsgs; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:63:20: note: remove the using nix-grpc-store-clang-tidy-0.2.2> 63 | using nix::remote::ClientMsgs; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> 64 | using nix::remote::SchedCmd; nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:66:20: error: using decl 'SchedMsgs' is unused [misc-unused-using-decls,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 66 | using nix::remote::SchedMsgs; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:66:20: note: remove the using nix-grpc-store-clang-tidy-0.2.2> 66 | using nix::remote::SchedMsgs; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> 67 | using nix::remote::WorkerMsg; nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:164:16: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 164 | auto const it = lck->expected.find(drvPath); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:194:13: error: implicit conversion 'std::function *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 194 | if (deferredDone) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != nullptr nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:198:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 198 | *deferredDone = [this, drvPath, assignId, outcome, outputs, reason] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:363:27: error: no header providing "nix::chomp" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 15 | auto token = nix::chomp(nix::readFile(path)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:365:19: error: no header providing "std::exception" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 11 | } catch (std::exception &) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:379:33: error: variable name 'cv' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 379 | std::condition_variable_any cv; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:382:52: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 382 | cv.wait_for(lock, stop, tokenPollInterval, [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:511:42: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 511 | reverseThread = std::jthread([this](const std::stop_token & stop) { runReverseSession(stop); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:516:19: error: function 'runReverseSession' has cognitive complexity of 168 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 516 | void Coordinator::runReverseSession(const std::stop_token & stop) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:526:5: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 526 | while (!stop.stop_requested()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:528:47: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 528 | const std::stop_callback onStop(stop, [&ctx] { ctx.TryCancel(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:535:56: note: +1 nix-grpc-store-clang-tidy-0.2.2> 535 | bool const acked = stream->Write(registration) && stream->Read(&ack); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:536:9: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 536 | if (acked && ack.protocol() != reverseProtocolVersion) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:536:19: note: +1 nix-grpc-store-clang-tidy-0.2.2> 536 | if (acked && ack.protocol() != reverseProtocolVersion) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:542:16: note: +1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 542 | } else if (acked && ack.stream_id() == 0 nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:544:13: note: +1 nix-grpc-store-clang-tidy-0.2.2> 544 | && ack.session_key().size() == ReverseCapability::keyBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:548:17: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 548 | [this](std::string_view drv, uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:549:36: note: +1 nix-grpc-store-clang-tidy-0.2.2> 549 | return builder && builder->expects(std::string(drv), id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:551:13: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 551 | if (!reverseBuild || !reverseUpload) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:551:31: note: +1 nix-grpc-store-clang-tidy-0.2.2> 551 | if (!reverseBuild || !reverseUpload) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:556:58: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 556 | const std::stop_callback cancelUploads(stop, [&requests] { requests.cancelUploads(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:564:33: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 564 | std::jthread writer([&](std::stop_token writeStop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:566:17: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 566 | while (outgoing.take(reply, writeStop)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:567:21: note: +5, including nesting penalty of 4, nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 567 | if (!stream->Write(reply)) { requests.cancelUploads(); ctx.TryCancel(); break; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:570:35: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 570 | std::jthread rotation([&](std::stop_token rotationStop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:572:21: note: nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 572 | [&](std::string token) { return outgoing.credential(std::move(token)); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:577:28: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 577 | auto execute = [&](std::stop_token workStop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:578:17: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 578 | while (!workStop.stop_requested()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:583:49: note: nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 583 | cv.wait(lock, workStop, [&] { return closed || !jobs.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:583:69: note: +1 nix-grpc-store-clang-tidy-0.2.2> 583 | cv.wait(lock, workStop, [&] { return closed || !jobs.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:584:25: note: +5, including nesting penalty of 4, nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 584 | if (closed || workStop.stop_requested()) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:584:36: note: +1 nix-grpc-store-clang-tidy-0.2.2> 584 | if (closed || workStop.stop_requested()) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:587:65: note: nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 587 | cancelled = cancellations.at(std::visit([](auto const & value) { return value.id; }, job)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:589:48: note: nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 589 | auto const id = std::visit([](auto const & value) { return value.id; }, job); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:592:21: note: +5, including nesting penalty of 4, nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 592 | if (std::holds_alternative(job) && reverseBuild && !*cancelled) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:592:92: note: +1 nix-grpc-store-clang-tidy-0.2.2> 592 | if (std::holds_alternative(job) && reverseBuild && !*cancelled) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:595:33: note: nesting level increased to 6 nix-grpc-store-clang-tidy-0.2.2> 595 | [&](const nix::remote::BuildDerivationChunk & chunk) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:597:41: note: +1 nix-grpc-store-clang-tidy-0.2.2> 597 | && outgoing.message(id, chunk, workStop, [&] { return cancelled->load(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:597:82: note: nesting level increased to 7 nix-grpc-store-clang-tidy-0.2.2> 597 | && outgoing.message(id, chunk, workStop, [&] { return cancelled->load(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:598:37: note: nesting level increased to 6 nix-grpc-store-clang-tidy-0.2.2> 598 | }, [&] { return *cancelled || workStop.stop_requested() || stop.stop_requested(); }, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:598:90: note: +1 nix-grpc-store-clang-tidy-0.2.2> 598 | }, [&] { return *cancelled || workStop.stop_requested() || stop.stop_requested(); }, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:600:27: note: +6, including nesting penalty of 5, nesting level increased to 6 nix-grpc-store-clang-tidy-0.2.2> 600 | } catch (std::exception & error) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:603:28: note: +1, nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 603 | } else if (std::holds_alternative(job) && reverseUpload && !*cancelled) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:603:101: note: +1 nix-grpc-store-clang-tidy-0.2.2> 603 | } else if (std::holds_alternative(job) && reverseUpload && !*cancelled) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:606:33: note: nesting level increased to 6 nix-grpc-store-clang-tidy-0.2.2> 606 | [&] { return *cancelled || workStop.stop_requested() || stop.stop_requested(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:606:86: note: +1 nix-grpc-store-clang-tidy-0.2.2> 606 | [&] { return *cancelled || workStop.stop_requested() || stop.stop_requested(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:607:27: note: +6, including nesting penalty of 5, nesting level increased to 6 nix-grpc-store-clang-tidy-0.2.2> 607 | } catch (std::exception & error) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:610:28: note: +1, nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 610 | } else if (*cancelled) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:613:21: note: +5, including nesting penalty of 4, nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 613 | if (auto * upload = std::get_if(&job)) upload->pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:620:21: note: +5, including nesting penalty of 4, nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 620 | if (!finished) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:621:25: note: +6, including nesting penalty of 5, nesting level increased to 6 nix-grpc-store-clang-tidy-0.2.2> 621 | if (afterFinish) afterFinish(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:625:21: note: +5, including nesting penalty of 4, nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 625 | if (!requests.finished(id)) { ctx.TryCancel(); break; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:633:13: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 633 | for (size_t i = 0; i < std::min(maxExecutors, std::max(1u, options.maxJobs)); ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:637:31: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 637 | auto const drop = [&](std::string_view why) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:641:70: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 641 | {"method", frame.has_open() ? frame.open().method() : ""}}); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:644:13: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 644 | while (!stop.stop_requested() && stream->Read(&frame)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:644:43: note: +1 nix-grpc-store-clang-tidy-0.2.2> 644 | while (!stop.stop_requested() && stream->Read(&frame)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:645:17: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 645 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kAcknowledged) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:646:21: note: +5, including nesting penalty of 4, nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 646 | if (!frame.acknowledged() || frame.stream_id() == 0 || frame.generation() != 0 nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:647:57: note: +1 nix-grpc-store-clang-tidy-0.2.2> 647 | || !frame.session_key().empty() || !outgoing.acknowledged(frame.stream_id())) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:653:17: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 653 | if (frame.has_open() && frame.open().method() != "BuildDerivation" nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:654:21: note: +1 nix-grpc-store-clang-tidy-0.2.2> 654 | && frame.open().method() != "UploadBuildInputs") { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:658:17: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 658 | if (!requests.accept(frame)) { drop(requests.lastRejection()); break; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:659:17: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 659 | if (frame.has_open()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:661:21: note: +5, including nesting penalty of 4, nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 661 | if (!cancellations.emplace(frame.stream_id(), std::make_shared>(false)).second) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:666:17: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 666 | if (frame.cancel()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:668:21: note: +5, including nesting penalty of 4, nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 668 | if (!outgoing.healthy()) { drop("too many cancelled streams"); break; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:672:25: note: +5, including nesting penalty of 4, nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 672 | if (auto it = cancellations.find(frame.stream_id()); it != cancellations.end()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:675:29: note: +6, including nesting penalty of 5, nesting level increased to 6 nix-grpc-store-clang-tidy-0.2.2> 675 | if (beforeRequest) cancellations.erase(it); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:678:21: note: +5, including nesting penalty of 4, nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 678 | if (beforeRequest && !outgoing.finish(frame.stream_id(), nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:678:39: note: +1 nix-grpc-store-clang-tidy-0.2.2> 678 | if (beforeRequest && !outgoing.finish(frame.stream_id(), nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:683:21: note: +5, including nesting penalty of 4, nesting level increased to 5 nix-grpc-store-clang-tidy-0.2.2> 683 | if (beforeRequest && !requests.finished(frame.stream_id())) { drop("cancel of unknown stream"); break; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:683:39: note: +1 nix-grpc-store-clang-tidy-0.2.2> 683 | if (beforeRequest && !requests.finished(frame.stream_id())) { drop("cancel of unknown stream"); break; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:685:17: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 685 | if (auto upload = requests.takeUploadReady()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:691:17: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 691 | if (auto ready = requests.takeReady()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:702:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 702 | for (auto & [id, flag] : cancellations) *flag = true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:712:13: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 712 | for (auto & executor : executors) executor.request_stop(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:713:13: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 713 | for (auto & executor : executors) executor.join(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:720:11: note: +1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 720 | } else { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:726:9: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 726 | if (stop.stop_requested()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:736:46: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 736 | waitCv.wait_for(lock, stop, backoff, [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:528:47: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 528 | const std::stop_callback onStop(stop, [&ctx] { ctx.TryCancel(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:547:13: error: no header providing "nixgrpc::ReverseRequest" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | ReverseRequest requests(options.reverseWorkerId, ack.generation(), ack.session_key(), nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:548:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 548 | [this](std::string_view drv, uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:548:55: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 548 | [this](std::string_view drv, uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:556:58: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | const std::stop_callback cancelUploads(stop, [&requests] { requests.cancelUploads(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:559:41: error: variable name 'cv' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 559 | std::condition_variable_any cv; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:560:18: error: no header providing "std::deque" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 11 | std::deque> jobs; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:564:33: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | std::jthread writer([&](std::stop_token writeStop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:564:53: error: the parameter 'writeStop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | std::jthread writer([&](std::stop_token writeStop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:570:35: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 570 | std::jthread rotation([&](std::stop_token rotationStop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:570:55: error: the parameter 'rotationStop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 570 | std::jthread rotation([&](std::stop_token rotationStop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:572:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 572 | [&](std::string token) { return outgoing.credential(std::move(token)); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:577:28: error: lambda has cognitive complexity of 29 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 577 | auto execute = [&](std::stop_token workStop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:578:17: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 578 | while (!workStop.stop_requested()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:583:49: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 583 | cv.wait(lock, workStop, [&] { return closed || !jobs.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:583:69: note: +1 nix-grpc-store-clang-tidy-0.2.2> 583 | cv.wait(lock, workStop, [&] { return closed || !jobs.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:584:25: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 584 | if (closed || workStop.stop_requested()) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:584:36: note: +1 nix-grpc-store-clang-tidy-0.2.2> 584 | if (closed || workStop.stop_requested()) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:587:65: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 587 | cancelled = cancellations.at(std::visit([](auto const & value) { return value.id; }, job)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:589:48: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 589 | auto const id = std::visit([](auto const & value) { return value.id; }, job); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:592:21: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 592 | if (std::holds_alternative(job) && reverseBuild && !*cancelled) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:592:92: note: +1 nix-grpc-store-clang-tidy-0.2.2> 592 | if (std::holds_alternative(job) && reverseBuild && !*cancelled) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:595:33: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 595 | [&](const nix::remote::BuildDerivationChunk & chunk) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:597:41: note: +1 nix-grpc-store-clang-tidy-0.2.2> 597 | && outgoing.message(id, chunk, workStop, [&] { return cancelled->load(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:597:82: note: nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 597 | && outgoing.message(id, chunk, workStop, [&] { return cancelled->load(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:598:37: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 598 | }, [&] { return *cancelled || workStop.stop_requested() || stop.stop_requested(); }, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:598:90: note: +1 nix-grpc-store-clang-tidy-0.2.2> 598 | }, [&] { return *cancelled || workStop.stop_requested() || stop.stop_requested(); }, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:600:27: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 600 | } catch (std::exception & error) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:603:28: note: +1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 603 | } else if (std::holds_alternative(job) && reverseUpload && !*cancelled) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:603:101: note: +1 nix-grpc-store-clang-tidy-0.2.2> 603 | } else if (std::holds_alternative(job) && reverseUpload && !*cancelled) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:606:33: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 606 | [&] { return *cancelled || workStop.stop_requested() || stop.stop_requested(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:606:86: note: +1 nix-grpc-store-clang-tidy-0.2.2> 606 | [&] { return *cancelled || workStop.stop_requested() || stop.stop_requested(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:607:27: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 607 | } catch (std::exception & error) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:610:28: note: +1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 610 | } else if (*cancelled) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:613:21: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 613 | if (auto * upload = std::get_if(&job)) upload->pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:620:21: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 620 | if (!finished) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:621:25: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 621 | if (afterFinish) afterFinish(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:625:21: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 625 | if (!requests.finished(id)) { ctx.TryCancel(); break; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:577:28: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 577 | auto execute = [&](std::stop_token workStop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:583:49: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 583 | cv.wait(lock, workStop, [&] { return closed || !jobs.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:584:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 584 | if (closed || workStop.stop_requested()) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:587:65: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 587 | cancelled = cancellations.at(std::visit([](auto const & value) { return value.id; }, job)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:589:32: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 589 | auto const id = std::visit([](auto const & value) { return value.id; }, job); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:589:48: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 589 | auto const id = std::visit([](auto const & value) { return value.id; }, job); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:595:33: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 595 | [&](const nix::remote::BuildDerivationChunk & chunk) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:597:82: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 597 | && outgoing.message(id, chunk, workStop, [&] { return cancelled->load(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:598:37: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 598 | }, [&] { return *cancelled || workStop.stop_requested() || stop.stop_requested(); }, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:606:33: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 606 | [&] { return *cancelled || workStop.stop_requested() || stop.stop_requested(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:613:83: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 613 | if (auto * upload = std::get_if(&job)) upload->pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:621:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 621 | if (afterFinish) afterFinish(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:626:21: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 626 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:633:76: error: integer literal has suffix 'u', which is not uppercase [readability-uppercase-literal-suffix,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 633 | for (size_t i = 0; i < std::min(maxExecutors, std::max(1u, options.maxJobs)); ++i) nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | U nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:633:103: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 633 | for (size_t i = 0; i < std::min(maxExecutors, std::max(1u, options.maxJobs)); ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 634 | executors.emplace_back(execute); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:637:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 637 | auto const drop = [&](std::string_view why) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:660:21: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 660 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:671:25: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 671 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:672:34: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 672 | if (auto it = cancellations.find(frame.stream_id()); it != cancellations.end()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:675:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 675 | if (beforeRequest) cancellations.erase(it); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:686:21: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 686 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:692:21: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 692 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:694:26: error: use emplace_back instead of push_back [modernize-use-emplace,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 694 | jobs.push_back(std::move(*ready)); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | emplace_back( nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:700:17: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 700 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:702:30: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 702 | for (auto & [id, flag] : cancellations) *flag = true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:702:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 702 | for (auto & [id, flag] : cancellations) *flag = true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:712:46: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 712 | for (auto & executor : executors) executor.request_stop(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:713:46: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 713 | for (auto & executor : executors) executor.join(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:736:46: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 736 | waitCv.wait_for(lock, stop, backoff, [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:741:19: error: function 'runRemoteSession' has cognitive complexity of 37 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 741 | void Coordinator::runRemoteSession(Builder & bld, const std::stop_token & stop) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:743:81: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 743 | auto const creds = schedulerCreds(options, options.reverseTokenFile.empty() ? options.schedulerTokenFile nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:751:76: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 751 | auto const target = options.schedulerAddr.starts_with(plaintextScheme) ? options.schedulerAddr.substr(plaintextScheme.size()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:756:5: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 756 | while (!stop.stop_requested()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:758:60: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 758 | auto openedWith = options.reverseTokenFile.empty() ? std::string{} : readToken(options.reverseTokenFile); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:764:21: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 764 | bld.setSend([raw, writeMutex, live](const WorkerMsg & msg) -> bool { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:768:26: note: +1 nix-grpc-store-clang-tidy-0.2.2> 768 | return *live && raw->Write(one); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:774:9: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 774 | if (helloed) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:777:47: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 777 | const std::stop_callback onStop(stop, [&ctx] -> void { ctx.TryCancel(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:779:9: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 779 | if (helloed && !options.reverseTokenFile.empty()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:779:21: note: +1 nix-grpc-store-clang-tidy-0.2.2> 779 | if (helloed && !options.reverseTokenFile.empty()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:780:37: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 780 | rotation = std::jthread([&](std::stop_token rotationStop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:781:90: note: nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 781 | forwardRotatedTokens(options.reverseTokenFile, openedWith, rotationStop, [&](std::string token) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:790:9: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 790 | while (helloed && stream->Read(&cmds)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:790:24: note: +1 nix-grpc-store-clang-tidy-0.2.2> 790 | while (helloed && stream->Read(&cmds)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:791:13: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 791 | for (const auto & cmd : cmds.msgs()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:792:17: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 792 | if (cmd.has_expect()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:794:24: note: +1, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 794 | } else if (cmd.has_revoke()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:796:24: note: +1, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 796 | } else if (cmd.has_restarting()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:800:13: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 800 | if (restarting) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:806:9: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 806 | if (rotation.joinable()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:811:9: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 811 | if (stop.stop_requested()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:814:9: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 814 | if (restarting) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:818:11: note: +1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 818 | } else { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:822:13: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 822 | if (helloed && std::chrono::steady_clock::now() - connectedAt >= stableSession) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:822:25: note: +1 nix-grpc-store-clang-tidy-0.2.2> 822 | if (helloed && std::chrono::steady_clock::now() - connectedAt >= stableSession) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:780:37: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 780 | rotation = std::jthread([&](std::stop_token rotationStop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:780:57: error: the parameter 'rotationStop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 780 | rotation = std::jthread([&](std::stop_token rotationStop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/coordinator.cc:781:90: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 781 | forwardRotatedTokens(options.reverseTokenFile, openedWith, rotationStop, [&](std::string token) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 12 | #include nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> 13 | #include nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 90 | std::chrono::system_clock::time_point credentialExpiresAt{}; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:519:10: error: function 'doVerify' has cognitive complexity of 49 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 519 | auto doVerify(const std::string & token, std::chrono::system_clock::time_point now) -> Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:522:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 522 | if (!parsed) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:525:47: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 525 | auto const iss = parsed->has_issuer() ? parsed->get_issuer() : ""; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:526:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 526 | for (size_t idx = 0; idx < config.providers.size(); ++idx) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:528:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 528 | if (provider.issuer != iss) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:531:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 531 | if (!parsed->has_expires_at()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:535:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 535 | for (auto & verifier : candidates(provider, keys.at(idx), *parsed, now)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:538:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 538 | if (!err) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:542:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 542 | if (err) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:547:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 547 | if (sub.empty() || sub.contains('\0')) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:547:29: note: +1 nix-grpc-store-clang-tidy-0.2.2> 547 | if (sub.empty() || sub.contains('\0')) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:552:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 552 | if (auto const * namespaceClaim = lookupClaim(claims, "kubernetes.io.namespace"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:32: note: +1 nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:82: note: +1 nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:67: note: +1 nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:66: note: +1 nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:91: note: +1 nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:65: note: +1 nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:569:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 569 | if (auto const aud = claims.find("aud"); aud != claims.end()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:570:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 570 | if (aud->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:572:24: note: +1, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:572:64: note: +1 nix-grpc-store-clang-tidy-0.2.2> 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:577:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 577 | if (parsed->has_issued_at()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:580:68: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 580 | return {.identity = std::move(identity), .error = role ? "" : "no rule matched"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/options.hh:45:50: error: 600 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 45 | std::chrono::seconds reverseMaxTokenLifetime{600}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (RAND_bytes(reinterpret_cast(key.data()), static_cast(key.size())) != 1) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:62:95: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:96:61: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | result.push_back(static_cast(size >> (i * 8))); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:46: error: 2 adjacent parameters of 'verify' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:183:107: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:250:9: error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 250 | unsigned char mac[EVP_MAX_MD_SIZE]; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast(key.size()), nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | ( nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | == nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:86: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 258 | return std::string(reinterpret_cast(mac), macBytes); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto data(uint64_t id, std::string_view bytes) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | if (size > limit) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | cv.wait(lock, stop, [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | auto const it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto acknowledge(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!enqueue(std::move(msg))) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | if (streams.contains(id) && acknowledged.contains(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 150 | if (removed) cv.notify_all(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | void acknowledgementSent(uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 208 | auto terminal(uint64_t id, bool abort) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:63:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 63 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:65:14: error: variable 'minRole' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | Role minRole; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:81:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | return {{grpc::StatusCode::UNIMPLEMENTED, "unknown reverse method"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:85:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 85 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:91:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 91 | return {{grpc::StatusCode::INVALID_ARGUMENT, "upload does not accept a build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:95:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:99:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no matching live assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:104:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unexpected build assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:109:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session unavailable"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:115:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 115 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session changed"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:122:16: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open), nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> 123 | std::string(drvPath), assignId}}; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:122:43: error: use designated initializer list to initialize 'Prepared' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open), nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .session= .open= nix-grpc-store-clang-tidy-0.2.2> 123 | std::string(drvPath), assignId}}; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .drvPath= .assignId= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:33:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 33 | struct Prepared nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:185:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 185 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:189:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 189 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:193:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 193 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:197:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 197 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned build route"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:202:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 202 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound build assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:214:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 214 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:218:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 218 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:222:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 222 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned upload route"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:227:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 227 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:233:11: error: member 'auth' of type 'Auth &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 233 | Auth &auth; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:234:22: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 234 | ReverseRegistry ®istry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:43:24: error: function 'accept' has cognitive complexity of 27 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg &frame) -> std::optional nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:45:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 45 | if (closed || frame.generation() != 0 || !frame.session_key().empty() || frame.stream_id() == 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:45:79: note: +1 nix-grpc-store-clang-tidy-0.2.2> 45 | if (closed || frame.generation() != 0 || !frame.session_key().empty() || frame.stream_id() == 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:47:32: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 47 | rejection = closed ? "session closed" : "bad frame header"; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:51:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 51 | if (frame.has_open()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:53:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 53 | if (id <= lastId || streams.size() >= ReverseFrames::maxStreams) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:53:30: note: +1 nix-grpc-store-clang-tidy-0.2.2> 53 | if (id <= lastId || streams.size() >= ReverseFrames::maxStreams) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:55:42: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 55 | rejection = id <= lastId ? "stream id not increasing" : "too many streams"; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 59 | if (!caller) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:69:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 69 | if (it == streams.end()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 73 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel() nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:17: note: +1 nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:79:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 79 | if (frame.has_data()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 81 | if (it->second || frame.data().data().empty() || frame.data().data().size() > ReverseFrames::maxFrameBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:81:59: note: +1 nix-grpc-store-clang-tidy-0.2.2> 81 | if (it->second || frame.data().data().empty() || frame.data().data().size() > ReverseFrames::maxFrameBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:88:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 88 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kHalfClose && frame.half_close() && !it->second) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:88:97: note: +1 nix-grpc-store-clang-tidy-0.2.2> 88 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kHalfClose && frame.half_close() && !it->second) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:93:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 93 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:93:72: note: +1 nix-grpc-store-clang-tidy-0.2.2> 93 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:95:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 95 | if (cancelledIds.size() >= maxCancelled) { closed = true; rejection = "too many cancels"; return std::nullopt; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:50:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 50 | auto const id = frame.stream_id(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:68:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 68 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != 0u) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 75 | return Event{.kind = Event::Kind::cancel, .streamId = id}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:109:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | if (cancelledIds.erase(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | if (cancelledIds.erase(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (!streams.erase(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | == 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (!streams.erase(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:44:71: error: 128 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:82:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | auto it = sessions.find(std::string(workerId)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:92:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 92 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:107:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:130:30: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 130 | for (auto & [id, session] : sessions) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:43:24: error: function 'call' has cognitive complexity of 101 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | [[nodiscard]] auto call(grpc::ServerContext & context, const Select & select, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:49:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:49:21: note: +1 nix-grpc-store-clang-tidy-0.2.2> 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:56:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 56 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:57:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:59:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:59:22: note: +1 nix-grpc-store-clang-tidy-0.2.2> 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:60:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:60:27: note: +1 nix-grpc-store-clang-tidy-0.2.2> 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:62:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:64:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 64 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:65:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 65 | if (!selection.prepared || selection.prepared->session != session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:65:33: note: +1 nix-grpc-store-clang-tidy-0.2.2> 65 | if (!selection.prepared || selection.prepared->session != session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:67:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 67 | if (request.ByteSizeLong() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:70:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 70 | if (bytes.size() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:72:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:75:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 75 | if (!status.ok()) return status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:81:13: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 81 | ~Release() { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:84:17: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 84 | if (!completed) (void) transport.outgoing.cancel(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:98:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 98 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:99:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:100:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:100:44: note: +1 nix-grpc-store-clang-tidy-0.2.2> 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:100:62: note: +1 nix-grpc-store-clang-tidy-0.2.2> 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:102:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:105:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:111:30: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 111 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:113:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 113 | while (!stop.stop_requested()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:114:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 114 | if (context.IsCancelled() || std::chrono::system_clock::now() >= deadline || !registry.current(session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:115:22: note: +1 nix-grpc-store-clang-tidy-0.2.2> 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:115:60: note: +1 nix-grpc-store-clang-tidy-0.2.2> 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:115:80: note: +1 nix-grpc-store-clang-tidy-0.2.2> 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:119:76: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:125:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 125 | while (transport.responses.waitTake(id, frame, wake.get_token())) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:126:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:44: note: +1 nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:82: note: +1 nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:102: note: +1 nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:129:47: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:130:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 130 | if (frame.has_finish()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:131:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:131:55: note: +1 nix-grpc-store-clang-tidy-0.2.2> 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:131:75: note: +1 nix-grpc-store-clang-tidy-0.2.2> 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:133:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:133:38: note: +1 nix-grpc-store-clang-tidy-0.2.2> 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:134:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 134 | if (resultReceived && resultReceived()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:134:36: note: +1 nix-grpc-store-clang-tidy-0.2.2> 134 | if (resultReceived && resultReceived()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:135:21: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 135 | if (beforeAck) beforeAck(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:136:21: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 136 | if (!transport.outgoing.acknowledge(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:143:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 143 | while (true) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:144:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 144 | if (!expected) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:145:21: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 145 | if (pending.size() < 4) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:147:21: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 147 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:149:21: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:153:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 153 | if (pending.size() < *expected) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:154:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 154 | if (!receive(std::string_view(pending).substr(0, *expected))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:159:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:161:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:162:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:163:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:163:47: note: +1 nix-grpc-store-clang-tidy-0.2.2> 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:163:67: note: +1 nix-grpc-store-clang-tidy-0.2.2> 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:49:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:56:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:57:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:59:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:60:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:61:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 61 | auto const id = session->transport->nextStreamId.fetch_add(1); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:62:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:64:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:65:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | if (!selection.prepared || selection.prepared->session != session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 66 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker changed during selection"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:67:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | if (request.ByteSizeLong() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 68 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:70:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 70 | if (bytes.size() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 71 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:72:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:75:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (!status.ok()) return status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:77:16: error: class 'Release' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:77:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> 78 | ReverseTransport & transport; nix-grpc-store-clang-tidy-0.2.2> 79 | uint64_t id; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> | {} nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:78:32: error: member 'transport' of type 'ReverseTransport &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 78 | ReverseTransport & transport; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:84:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | if (!completed) (void) transport.outgoing.cancel(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:86: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:96: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:99:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:100:83: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 101 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker or assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:102:115: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 103 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request queue full"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:105:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:111:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:119:71: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:119:76: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:126:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:125: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 128 | return {grpc::StatusCode::UNAVAILABLE, nix-grpc-store-clang-tidy-0.2.2> 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:131:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 132 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:133:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:135:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 135 | if (beforeAck) beforeAck(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:136:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 136 | if (!transport.outgoing.acknowledge(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 137 | return {grpc::StatusCode::UNAVAILABLE, "cannot acknowledge reverse result"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:145:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | if (pending.size() < 4) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:147:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 147 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:148:91: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:148:101: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:149:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:153:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 153 | if (pending.size() < *expected) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:154:78: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 154 | if (!receive(std::string_view(pending).substr(0, *expected))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 155 | return {grpc::StatusCode::DATA_LOSS, "invalid or rejected reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:159:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:161:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:162:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:163:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 164 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:169:22: error: member 'gateway' of type 'ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 169 | ReverseGateway & gateway; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:170:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 170 | ReverseRegistry & registry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:24:12: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 24 | struct Ready nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> 25 | { nix-grpc-store-clang-tidy-0.2.2> 26 | uint64_t id; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> | {} nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:46:24: error: function 'accept' has cognitive complexity of 40 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 46 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg & frame) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:52:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 52 | if (!event) { rejection = inbound.lastRejection(); return false; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:54:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 54 | switch (event->kind) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:56:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 56 | if (!event->caller) { rejection = "open without caller"; return false; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 59 | if (frame.open().method() == "UploadBuildInputs") { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:61:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:61:30: note: +1 nix-grpc-store-clang-tidy-0.2.2> 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:66:21: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 73 | if (frame.open().method() != "BuildDerivation") { rejection = "method not served"; return false; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:77:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 77 | if (auto it = uploads.find(id); it != uploads.end()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 81 | if (pending.wire.size() > ReverseRelay::maxRequestBytes + 4 nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:82:17: note: +1 nix-grpc-store-clang-tidy-0.2.2> 82 | || size > ReverseRelay::maxRequestBytes + 4 - pending.wire.size()) { rejection = "request too large"; return false; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:84:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 84 | if (!pending.length && pending.wire.size() >= 4) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:84:33: note: +1 nix-grpc-store-clang-tidy-0.2.2> 84 | if (!pending.length && pending.wire.size() >= 4) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:86:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 86 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:88:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 88 | if (length > ReverseRelay::maxRequestBytes) { rejection = "request too large"; return false; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:91:36: note: +1 nix-grpc-store-clang-tidy-0.2.2> 91 | return !pending.length || pending.wire.size() <= static_cast(*pending.length) + 4; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:94:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:96:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:96:60: note: +1 nix-grpc-store-clang-tidy-0.2.2> 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:108:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 108 | if (auto it = uploads.find(id); it != uploads.end()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:112:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:112:29: note: +1 nix-grpc-store-clang-tidy-0.2.2> 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:114:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 114 | if (ready && ready->id == id) ready.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:114:23: note: +1 nix-grpc-store-clang-tidy-0.2.2> 114 | if (ready && ready->id == id) ready.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:48:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 48 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:53:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto const id = event->streamId; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:66:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:77:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | if (auto it = uploads.find(id); it != uploads.end()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:77:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | if (auto it = uploads.find(id); it != uploads.end()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 78 | return it->second->feed(frame.data().data()); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:86:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 86 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 87 | length |= static_cast(static_cast(pending.wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:87:92: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | length |= static_cast(static_cast(pending.wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:87:102: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | length |= static_cast(static_cast(pending.wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:94:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:94:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:95:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | auto it = requests.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:108:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 108 | if (auto it = uploads.find(id); it != uploads.end()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:112:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:114:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 114 | if (ready && ready->id == id) ready.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:121:64: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 121 | [[nodiscard]] auto lastRejection() const -> const char * { std::scoped_lock lock(mutex); return rejection; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:123:62: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 123 | [[nodiscard]] auto takeReady() -> std::optional { std::scoped_lock lock(mutex); return std::exchange(ready, std::nullopt); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:124:69: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 124 | [[nodiscard]] auto takeUploadReady() -> std::optional { std::scoped_lock lock(mutex); return std::exchange(uploadReady, std::nullopt); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:130:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 130 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:131:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:131:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:141:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 141 | [[nodiscard]] auto finished(uint64_t id) -> bool { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:142:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 142 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:148:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:149:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:149:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:32:38: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | [[nodiscard]] auto open(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:51:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 51 | auto it = streams.find(frame.stream_id()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | if (!cancelled.contains(frame.stream_id())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:101: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | auto pending = [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::_Deque_iterator nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | std::ranges::find_if queue nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:111:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | auto it = pending(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:135:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:168:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | [[nodiscard]] auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:171:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 171 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:20: error: variable name 'ok' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:45: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:88: error: rvalue reference parameter 'frame' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 33 | if (assigned && !assigned()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:35:13: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 35 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 42 | if (!ok) cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:49:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 68 | if (closed) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 79 | if (ended || !chunks.empty()) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:80:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 80 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | if (chunks.empty()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:92:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 92 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:103:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 103 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 113 | if (!ended || closed || !chunks.empty()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:120:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 120 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:129:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 129 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | if (failed || bytes.empty() || !consume) return fail(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:53:37: error: result of a `data()` call may not be null terminated, provide size information to the callee to prevent potential issues [bugprone-suspicious-stringview-data-usage,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | buffer.append(bytes.data(), count); nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~^~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | for (unsigned i = 0; i < 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:58:90: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:58:100: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 59 | if (length == 0 || length > maxChunkBytes) return fail(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast(*expected)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 66 | return fail(); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:26:41: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 26 | [[nodiscard]] auto message(uint64_t id, const nix::remote::BuildDerivationChunk & chunk, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:27:48: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 27 | std::stop_token stop, const std::function & cancelled = {}) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:30:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | if (size > ReverseRelay::maxMessageBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:32:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | if (wire.size() > ReverseRelay::maxMessageBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:36:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 36 | for (unsigned i = 0; i < 4; ++i) bytes.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:36:88: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 36 | for (unsigned i = 0; i < 4; ++i) bytes.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:36:98: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 36 | for (unsigned i = 0; i < 4; ++i) bytes.push_back(static_cast((length >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:42:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 42 | if (!push(std::move(frame), stop, cancelled)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:47:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | [[nodiscard]] auto finish(uint64_t id, const grpc::Status & status, std::stop_token stop, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:53:78: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | frame.mutable_finish()->set_message(status.error_message().substr(0, 1024)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:56:39: error: parameter 'stop' of type 'std::stop_token' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 16 | return push(std::move(frame), stop, {}, waitForSpace, std::move(afterAck)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | std::move( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:67:84: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | [[nodiscard]] auto take(nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:70:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 70 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:71:62: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 71 | if (closed || stop.stop_requested() || queue.empty()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:79:46: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 79 | [[nodiscard]] auto acknowledged(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:83:13: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | auto it = afterAcks.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:85:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 85 | if (it == afterAcks.end()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:89:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 89 | if (completion) completion(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:95:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:108:13: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 108 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:111:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | for (auto & [id, complete] : pending) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:117:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 117 | void cancel(uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:119:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:134:19: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 134 | } else ++it; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:134:19: error: statement should have braces [readability-inconsistent-ifelse-braces,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 134 | } else ++it; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:141:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 141 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:146:82: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 146 | [[nodiscard]] auto push(nix::remote::ReverseWorkerMsg frame, std::stop_token stop, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:151:51: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 151 | if (size > ReverseFrames::maxFrameBytes + 1024) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:151:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 151 | if (size > ReverseFrames::maxFrameBytes + 1024) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:155:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 155 | && (!cancelled || !cancelled())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 156 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:156:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:159:43: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | || (cancelled && cancelled())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-worker.hh:162:86: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 162 | || !afterAcks.emplace(frame.stream_id(), std::move(afterAck)).second) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:323:61: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 323 | lastAssignId = (static_cast(entropy()) << 32) | entropy(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 371 | auto const it = workerIds.find(std::string(addr)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> >>> /nix/store/m9zvn43wg674597zl3hpphg9w1pf1p18-clang-tools-22.1.8/bin/clang-tidy --use-color -quiet -p /build/source/build /build/source/src/daemon/main.cc nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:13:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 12 | #include nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> 13 | #include nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/dispatcher.hh:90:66: error: initializer for member 'credentialExpiresAt' is redundant [readability-redundant-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 90 | std::chrono::system_clock::time_point credentialExpiresAt{}; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:354:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 354 | [&coord](std::string_view pod, std::string_view drv, uint64_t assignment) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:367:35: error: no header providing "std::function" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 15 | const std::function & cancelled, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:378:79: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 378 | nixgrpc::Role::write, request.build_mode()); !status.ok()) return status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:382:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 382 | if (stopSignal != 0) return {grpc::StatusCode::UNAVAILABLE, "worker draining"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:383:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 383 | if (cancelled()) return {grpc::StatusCode::CANCELLED, "reverse build cancelled"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:384:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 384 | if (!coord.builder) return {grpc::StatusCode::FAILED_PRECONDITION, "not a builder"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:387:13: error: variable 'drvPath' of type 'nix::StorePath' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 387 | nix::StorePath drvPath(request.drv_path()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:391:34: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 391 | auto const sendLog = [&](nixgrpc::BuildEvent event) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:392:98: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 392 | if (!emit(nixgrpc::toChunk(std::move(event)))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 393 | throw nixgrpc::CancelledWait("reverse build response closed"); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:401:47: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 401 | auto const retireUnacknowledged = [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:402:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 402 | if (afterFinish) std::exchange(afterFinish, nullptr)(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:414:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 414 | if (status.ok() && !emit(chunk)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 415 | status = {grpc::StatusCode::CANCELLED, "reverse response closed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:416:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 416 | if (!status.ok()) retireUnacknowledged(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:421:10: error: function 'reverseUpload' has cognitive complexity of 31 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 421 | auto reverseUpload(const nixgrpc::ReverseRequest::Upload & call, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:424:24: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 424 | return guarded([&] -> grpc::Status { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:425:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 425 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:425:32: note: +1 nix-grpc-store-clang-tidy-0.2.2> 425 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:428:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 428 | if (auto status = nixgrpc::Auth::authorize(call.delegated.caller, "UploadBuildInputs", nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:430:31: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 430 | auto const live = [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:432:21: note: +1 nix-grpc-store-clang-tidy-0.2.2> 432 | && coord.builder->expects(call.delegated.drvPath, call.delegated.assignId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:434:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 434 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment no longer live"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:436:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 436 | if (!call.pipe->Read(&first) || !nixgrpc::ReverseCapability::permitsImport(call.delegated, first) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:437:17: note: +1 nix-grpc-store-clang-tidy-0.2.2> 437 | || !live()) return {grpc::StatusCode::FAILED_PRECONDITION, "invalid or interrupted upload"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:438:48: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 438 | auto const repair = first.repair() ? nix::Repair : nix::NoRepair; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:439:55: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 439 | auto const checkSigs = first.check_sigs() ? nix::CheckSigs : nix::NoCheckSigs; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:458:17: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 458 | CheckedSource(nix::Source & inner, std::function valid) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:464:17: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 464 | auto read(char * data, size_t length) -> size_t override { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:465:21: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 465 | if (!valid()) throw nix::Error("reverse upload assignment revoked"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:471:21: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 471 | if (!valid()) throw nix::Error("reverse upload assignment revoked"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:449:19: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 449 | class CheckedSource : public nix::Source { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:449:19: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:449:19: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:449:19: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:449:19: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:483:68: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 483 | call.delegated.caller.role == nixgrpc::Role::write ? nix::NoRepair : repair, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:484:68: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 484 | call.delegated.caller.role == nixgrpc::Role::write ? nix::CheckSigs : checkSigs, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:485:17: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 485 | [&] { return !live(); }, imported, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:486:17: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 486 | [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:493:21: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 493 | if (!call.pipe->endWithoutTrailingData() || !live()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:493:62: note: +1 nix-grpc-store-clang-tidy-0.2.2> 493 | if (!call.pipe->endWithoutTrailingData() || !live()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:497:56: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 497 | coord.cache.publish(*localStore, imported, [&] { return !live(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:498:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 498 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:425:45: error: no header providing "nixgrpc::ReverseCapability" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 85 | if (!coord.builder || !nixgrpc::ReverseCapability::matchesBuildInputs(call.delegated, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:426:70: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 426 | call.delegated.drvPath, call.delegated.assignId)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 427 | return {grpc::StatusCode::PERMISSION_DENIED, "invalid delegated upload"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:429:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 429 | nixgrpc::Role::write); !status.ok()) return status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:430:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 430 | auto const live = [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:434:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 434 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment no longer live"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:437:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 437 | || !live()) return {grpc::StatusCode::FAILED_PRECONDITION, "invalid or interrupted upload"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:441:48: error: no header providing "nixgrpc::ReverseUploadPipe" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 89 | nixgrpc::ZstdReaderSource source( nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:450:31: error: member 'inner' of type 'nix::Source &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 450 | nix::Source & inner; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:465:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 465 | if (!valid()) throw nix::Error("reverse upload assignment revoked"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:471:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 471 | if (!valid()) throw nix::Error("reverse upload assignment revoked"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:485:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 485 | [&] { return !live(); }, imported, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:486:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 486 | [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:493:73: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 493 | if (!call.pipe->endWithoutTrailingData() || !live()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 494 | throw nix::Error("reverse upload incomplete or assignment changed"); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:497:56: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 497 | coord.cache.publish(*localStore, imported, [&] { return !live(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:498:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 498 | if (!live()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:641:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 641 | if (beforeApply) beforeApply(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:650:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 650 | if (beforeApply) beforeApply(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:652:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 652 | if (beforeApply) beforeApply(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:716:94: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 716 | if (!reverseUploadRelay || !reverseGateway || !coord.dispatcher || coord.builder) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 717 | return {grpc::StatusCode::FAILED_PRECONDITION, "upload requires a scheduler-only gateway"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:719:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 719 | if (!reader->Read(&first)) return {grpc::StatusCode::INVALID_ARGUMENT, "empty build-input upload"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:722:49: error: no header providing "nixgrpc::ReverseUpload" is directly included [misc-include-cleaner,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | if (first.ByteSizeLong() > nixgrpc::ReverseUpload::maxChunkBytes || !first.has_chunk() nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:723:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 723 | || drv.empty() || assignment == 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 724 | return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload header"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:726:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 726 | if (caller.kind != nixgrpc::Caller::Kind::named) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 727 | return {grpc::StatusCode::UNAUTHENTICATED, "reverse upload requires an authenticated client"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:729:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 729 | !status.ok()) return status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:731:22: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 731 | if (!pod) return {grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:732:35: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 732 | auto const assigned = [this, pod = *pod, drv, assignment] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:736:17: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 736 | [&](uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> Result nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:736:30: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 736 | [&](uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:738:25: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 738 | [this](std::string_view path, uint64_t assignId) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::optional nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:741:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 741 | }, assigned, [&](nix::remote::UploadBuildInputsChunk & frame) { return reader->Read(&frame); }, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1011:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1011 | if (cancelled()) return {grpc::StatusCode::CANCELLED, "build cancelled before admission"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1108:37: error: implicit conversion 'std::string *' (aka 'basic_string *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1108 | if (!missing.empty() && missingInput) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1167:10: error: function 'BuildDerivation' has cognitive complexity of 34 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1167 | auto BuildDerivation( nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1172:24: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 1172 | return guarded([&] -> grpc::Status { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1176:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 1176 | if (request->protocol() != nixcompat::kBuildProtocolWire nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1177:17: note: +1 nix-grpc-store-clang-tidy-0.2.2> 1177 | || request->build_mode() > static_cast(nix::bmCheck)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1184:17: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 1184 | ? coord.dispatcher->assignmentPod(request->drv_path(), request->assign_id()) : std::nullopt; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1183:51: note: +1 nix-grpc-store-clang-tidy-0.2.2> 1183 | auto const selectedPod = reverseRelay && coord.dispatcher nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1185:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 1185 | if (selectedPod) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1188:21: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 1188 | [&](uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1190:29: note: nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 1190 | [this](std::string_view drv, uint64_t assignment) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1193:34: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 1193 | }, *request, [&](std::string_view wire) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1195:25: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 1195 | if (!chunk.ParseFromArray(wire.data(), static_cast(wire.size())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1196:103: note: +1 nix-grpc-store-clang-tidy-0.2.2> 1196 | || chunk.event_case() == nix::remote::BuildDerivationChunk::EVENT_NOT_SET || receivedDone.load()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1198:25: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 1198 | if (!writer->Write(chunk)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1199:25: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 1199 | if (chunk.has_done()) receivedDone = true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1201:24: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 1201 | }, [this, drv = request->drv_path(), assignment = request->assign_id(), nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1204:24: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 1204 | }, [&] { return receivedDone.load(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1206:21: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 1206 | ? grpc::Status{grpc::StatusCode::DATA_LOSS, "reverse build completed without a result"} : status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1205:36: note: +1 nix-grpc-store-clang-tidy-0.2.2> 1205 | return status.ok() && !receivedDone.load() nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1212:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 1212 | if (!coord.builder) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1217:38: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 1217 | auto const sendLogLine = [&](nixgrpc::BuildEvent event) -> void { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1231:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 1231 | for (auto & [name, path] : staticOutputs(*localStore, drv)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1239:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 1239 | if (auto const status = nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1240:27: note: nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 1240 | build([&] { return context->IsCancelled(); }, *localStore, drvPath, drv, mode, limits, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1243:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 1243 | if (!missingInput.empty()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1188:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1188 | [&](uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> Result nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1188:34: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1188 | [&](uint64_t id) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1190:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1190 | [this](std::string_view drv, uint64_t assignment) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::optional nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1193:34: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1193 | }, *request, [&](std::string_view wire) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1196:126: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1196 | || chunk.event_case() == nix::remote::BuildDerivationChunk::EVENT_NOT_SET || receivedDone.load()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 1197 | return false; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1198:51: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1198 | if (!writer->Write(chunk)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1199:46: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1199 | if (chunk.has_done()) receivedDone = true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1201:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1201 | }, [this, drv = request->drv_path(), assignment = request->assign_id(), nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> 1202 | pod = *selectedPod] { nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1204:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1204 | }, [&] { return receivedDone.load(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1240:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1240 | build([&] { return context->IsCancelled(); }, *localStore, drvPath, drv, mode, limits, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1498:31: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1498 | coord.setReverseBuild([&service](auto const & call, auto const & emit, auto const & cancelled, auto & afterFinish) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/main.cc:1501:32: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 1501 | coord.setReverseUpload([&service](auto const & call, auto const & cancelled) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:519:10: error: function 'doVerify' has cognitive complexity of 49 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 519 | auto doVerify(const std::string & token, std::chrono::system_clock::time_point now) -> Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:522:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 522 | if (!parsed) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:525:47: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 525 | auto const iss = parsed->has_issuer() ? parsed->get_issuer() : ""; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:526:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 526 | for (size_t idx = 0; idx < config.providers.size(); ++idx) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:528:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 528 | if (provider.issuer != iss) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:531:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 531 | if (!parsed->has_expires_at()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:535:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 535 | for (auto & verifier : candidates(provider, keys.at(idx), *parsed, now)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:538:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 538 | if (!err) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:542:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 542 | if (err) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:547:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 547 | if (sub.empty() || sub.contains('\0')) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:547:29: note: +1 nix-grpc-store-clang-tidy-0.2.2> 547 | if (sub.empty() || sub.contains('\0')) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:552:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 552 | if (auto const * namespaceClaim = lookupClaim(claims, "kubernetes.io.namespace"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:32: note: +1 nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:82: note: +1 nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:67: note: +1 nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:66: note: +1 nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:91: note: +1 nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:65: note: +1 nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:569:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 569 | if (auto const aud = claims.find("aud"); aud != claims.end()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:570:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 570 | if (aud->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:572:24: note: +1, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:572:64: note: +1 nix-grpc-store-clang-tidy-0.2.2> 572 | } else if (aud->is_array() && aud->size() == 1 && aud->front().is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:577:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 577 | if (parsed->has_issued_at()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:580:68: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 580 | return {.identity = std::move(identity), .error = role ? "" : "no rule matched"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:553:17: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 553 | namespaceClaim && namespaceClaim->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:556:78: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 556 | if (auto const * pod = lookupClaim(claims, "kubernetes.io.pod"); pod && pod->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:557:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 557 | if (auto it = pod->find("name"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:560:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 560 | if (auto it = pod->find("uid"); it != pod->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:30: error: variable name 'sa' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:564:88: error: implicit conversion 'const Json *' (aka 'const basic_json<> *') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 564 | if (auto const * sa = lookupClaim(claims, "kubernetes.io.serviceaccount"); sa && sa->is_object()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/oidc.hh:565:26: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 565 | if (auto it = sa->find("name"); it != sa->end() && it->is_string()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/options.hh:45:50: error: 600 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 45 | std::chrono::seconds reverseMaxTokenLifetime{600}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:44:24: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (RAND_bytes(reinterpret_cast(key.data()), static_cast(key.size())) != 1) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:62:95: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | caller.kind != Caller::Kind::named || caller.name.empty() || caller.name.size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:96:61: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | result.push_back(static_cast(size >> (i * 8))); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:46: error: 2 adjacent parameters of 'verify' of similar type ('std::string_view') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:63: note: the first parameter in the range is 'token' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:156:87: note: the last parameter in the range is 'workerId' nix-grpc-store-clang-tidy-0.2.2> 156 | static auto verify(std::string_view key, std::string_view token, std::string_view workerId, uint64_t generation, nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:75: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:168:89: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | size |= static_cast(static_cast(token[i])) << (i * 8); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:71: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:176:75: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 176 | if (!expected || CRYPTO_memcmp(expected->data(), token.data() + 4 + size, macBytes) != 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:183:107: error: 256 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 183 | payload.method() != method || payload.caller_name().empty() || payload.caller_name().size() > 256 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:215:57: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 215 | if (drv.empty() || assign == 0 || mode != 0) return std::nullopt; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:250:9: error: do not declare C-style arrays, use 'std::array' instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 250 | unsigned char mac[EVP_MAX_MD_SIZE]; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:252:14: error: implicit conversion 'unsigned char *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 252 | if (!HMAC(EVP_sha256(), key.data(), static_cast(key.size()), nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | ( nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | == nullptr) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:19: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:253:86: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 253 | reinterpret_cast(data.data()), data.size(), mac, &length) || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-capability.hh:258:28: error: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 258 | return std::string(reinterpret_cast(mac), macBytes); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:23:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 23 | static constexpr size_t maxFrameBytes = 64 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:24:46: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 24 | static constexpr size_t maxQueuedBytes = 4 * 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:30:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 30 | auto open(uint64_t id, nix::remote::ReverseOpen start) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:53:24: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto data(uint64_t id, std::string_view bytes) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:67:73: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | return enqueue(std::move(msg), maxQueuedBytes - maxFrameBytes - 1024); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:73:72: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 73 | auto waitData(uint64_t id, std::string_view bytes, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:75:59: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (bytes.empty() || bytes.size() > maxFrameBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:81:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | if (size > limit) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:83:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 83 | cv.wait(lock, stop, [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:84:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:87:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | auto const it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:88:82: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 88 | if (closed || stop.stop_requested() || it == streams.end() || it->second) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:93:29: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 93 | auto halfClose(uint64_t id) -> bool { return terminal(id, false); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:94:26: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | auto cancel(uint64_t id) -> bool { return terminal(id, true); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:96:31: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto acknowledge(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:101:74: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | if (closed || !streams.contains(id) || acknowledged.contains(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:105:38: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!enqueue(std::move(msg))) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:128:70: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 128 | auto waitTake(nix::remote::ReverseFarmMsg & msg, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:131:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | cv.wait(lock, stop, [&] { return closed || !queue.empty(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:145:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:148:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | if (streams.contains(id) && acknowledged.contains(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:150:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 150 | if (removed) cv.notify_all(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:156:39: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | void acknowledgementSent(uint64_t id) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:159:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (acknowledged.erase(id)) streams.erase(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:196:37: error: 1024 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 196 | if (bytes > maxFrameBytes + 1024 || queuedBytes > limit || bytes > limit - queuedBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-frames.hh:208:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 208 | auto terminal(uint64_t id, bool abort) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:63:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 63 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:65:14: error: variable 'minRole' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | Role minRole; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:81:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 81 | return {{grpc::StatusCode::UNIMPLEMENTED, "unknown reverse method"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:85:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 85 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:91:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 91 | return {{grpc::StatusCode::INVALID_ARGUMENT, "upload does not accept a build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:95:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:99:24: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no matching live assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:104:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unexpected build assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:109:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session unavailable"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:115:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 115 | return {{grpc::StatusCode::UNAVAILABLE, "selected worker session changed"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:122:16: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open), nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> 123 | std::string(drvPath), assignId}}; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:122:43: error: use designated initializer list to initialize 'Prepared' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 122 | return {grpc::Status::OK, Prepared{std::move(session), std::move(open), nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .session= .open= nix-grpc-store-clang-tidy-0.2.2> 123 | std::string(drvPath), assignId}}; nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .drvPath= .assignId= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:33:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 33 | struct Prepared nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:185:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 185 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:189:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 189 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:193:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 193 | return {{grpc::StatusCode::INVALID_ARGUMENT, "unsupported build mode"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:197:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 197 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned build route"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:202:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 202 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound build assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:214:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 214 | return {{grpc::StatusCode::UNAUTHENTICATED, "reverse calls require an authenticated client"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:218:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 218 | return {status, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status=.prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:222:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 222 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no scheduler-owned upload route"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:227:20: error: use designated initializer list to initialize 'Result' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 227 | return {{grpc::StatusCode::FAILED_PRECONDITION, "no live pod-bound upload assignment"}, {}}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .status= .prepared= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:41:5: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 41 | struct Result nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:233:11: error: member 'auth' of type 'Auth &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 233 | Auth &auth; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-gateway.hh:234:22: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 234 | ReverseRegistry ®istry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:43:24: error: function 'accept' has cognitive complexity of 27 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg &frame) -> std::optional nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:45:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 45 | if (closed || frame.generation() != 0 || !frame.session_key().empty() || frame.stream_id() == 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:45:79: note: +1 nix-grpc-store-clang-tidy-0.2.2> 45 | if (closed || frame.generation() != 0 || !frame.session_key().empty() || frame.stream_id() == 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:47:32: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 47 | rejection = closed ? "session closed" : "bad frame header"; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:51:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 51 | if (frame.has_open()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:53:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 53 | if (id <= lastId || streams.size() >= ReverseFrames::maxStreams) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:53:30: note: +1 nix-grpc-store-clang-tidy-0.2.2> 53 | if (id <= lastId || streams.size() >= ReverseFrames::maxStreams) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:55:42: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 55 | rejection = id <= lastId ? "stream id not increasing" : "too many streams"; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 59 | if (!caller) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:69:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 69 | if (it == streams.end()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 73 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel() nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:17: note: +1 nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:79:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 79 | if (frame.has_data()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 81 | if (it->second || frame.data().data().empty() || frame.data().data().size() > ReverseFrames::maxFrameBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:81:59: note: +1 nix-grpc-store-clang-tidy-0.2.2> 81 | if (it->second || frame.data().data().empty() || frame.data().data().size() > ReverseFrames::maxFrameBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:88:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 88 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kHalfClose && frame.half_close() && !it->second) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:88:97: note: +1 nix-grpc-store-clang-tidy-0.2.2> 88 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kHalfClose && frame.half_close() && !it->second) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:93:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 93 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:93:72: note: +1 nix-grpc-store-clang-tidy-0.2.2> 93 | if (frame.frame_case() == nix::remote::ReverseFarmMsg::kCancel && frame.cancel()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:95:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 95 | if (cancelledIds.size() >= maxCancelled) { closed = true; rejection = "too many cancels"; return std::nullopt; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:50:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 50 | auto const id = frame.stream_id(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:68:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 68 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:20: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | ( != 0u) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:74:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 74 | && finishedIds.erase(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 75 | return Event{.kind = Event::Kind::cancel, .streamId = id}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:109:28: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:111:13: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | if (cancelledIds.erase(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:111:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | if (cancelledIds.erase(id)) return true; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:112:14: error: implicit conversion 'size_type' (aka 'unsigned long') -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (!streams.erase(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ~^ nix-grpc-store-clang-tidy-0.2.2> | == 0u nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-inbound.hh:112:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (!streams.erase(id)) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:44:71: error: 128 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (peerId.empty() || peerId != workerId || workerId.size() > 128 || workerId.contains('\0') || !cancel) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:82:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | auto it = sessions.find(std::string(workerId)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:92:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 92 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:107:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | auto it = sessions.find(handle->workerId); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-registry.hh:130:30: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 130 | for (auto & [id, session] : sessions) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:43:24: error: function 'call' has cognitive complexity of 101 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | [[nodiscard]] auto call(grpc::ServerContext & context, const Select & select, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:49:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:49:21: note: +1 nix-grpc-store-clang-tidy-0.2.2> 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:56:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 56 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:57:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:59:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:59:22: note: +1 nix-grpc-store-clang-tidy-0.2.2> 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:60:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:60:27: note: +1 nix-grpc-store-clang-tidy-0.2.2> 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:62:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:64:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 64 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:65:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 65 | if (!selection.prepared || selection.prepared->session != session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:65:33: note: +1 nix-grpc-store-clang-tidy-0.2.2> 65 | if (!selection.prepared || selection.prepared->session != session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:67:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 67 | if (request.ByteSizeLong() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:70:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 70 | if (bytes.size() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:72:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:75:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 75 | if (!status.ok()) return status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:81:13: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 81 | ~Release() { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:84:17: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 84 | if (!completed) (void) transport.outgoing.cancel(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:98:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 98 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:99:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:100:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:100:44: note: +1 nix-grpc-store-clang-tidy-0.2.2> 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:100:62: note: +1 nix-grpc-store-clang-tidy-0.2.2> 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:102:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:105:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:111:30: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 111 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:113:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 113 | while (!stop.stop_requested()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:114:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 114 | if (context.IsCancelled() || std::chrono::system_clock::now() >= deadline || !registry.current(session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:115:22: note: +1 nix-grpc-store-clang-tidy-0.2.2> 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:115:60: note: +1 nix-grpc-store-clang-tidy-0.2.2> 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:115:80: note: +1 nix-grpc-store-clang-tidy-0.2.2> 115 | || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:119:76: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:125:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 125 | while (transport.responses.waitTake(id, frame, wake.get_token())) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:126:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:44: note: +1 nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:82: note: +1 nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:102: note: +1 nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:129:47: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:130:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 130 | if (frame.has_finish()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:131:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:131:55: note: +1 nix-grpc-store-clang-tidy-0.2.2> 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:131:75: note: +1 nix-grpc-store-clang-tidy-0.2.2> 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:133:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:133:38: note: +1 nix-grpc-store-clang-tidy-0.2.2> 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:134:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 134 | if (resultReceived && resultReceived()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:134:36: note: +1 nix-grpc-store-clang-tidy-0.2.2> 134 | if (resultReceived && resultReceived()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:135:21: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 135 | if (beforeAck) beforeAck(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:136:21: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 136 | if (!transport.outgoing.acknowledge(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:143:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 143 | while (true) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:144:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 144 | if (!expected) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:145:21: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 145 | if (pending.size() < 4) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:147:21: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 147 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:149:21: note: +4, including nesting penalty of 3, nesting level increased to 4 nix-grpc-store-clang-tidy-0.2.2> 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:153:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 153 | if (pending.size() < *expected) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:154:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 154 | if (!receive(std::string_view(pending).substr(0, *expected))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:159:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:161:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:162:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:163:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:163:47: note: +1 nix-grpc-store-clang-tidy-0.2.2> 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:163:67: note: +1 nix-grpc-store-clang-tidy-0.2.2> 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:49:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | if (!select || !receive) return {grpc::StatusCode::INTERNAL, "reverse relay not configured"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:56:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:57:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (!selection.prepared) return {grpc::StatusCode::INTERNAL, "missing selected reverse session"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:59:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 59 | if (!session || !session->transport) return {grpc::StatusCode::UNAVAILABLE, "reverse session unavailable"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:60:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 60 | if (stillAssigned && !stillAssigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:61:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 61 | auto const id = session->transport->nextStreamId.fetch_add(1); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:62:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:64:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:65:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | if (!selection.prepared || selection.prepared->session != session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 66 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker changed during selection"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:67:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 67 | if (request.ByteSizeLong() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 68 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:70:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 70 | if (bytes.size() > maxRequestBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 71 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request too large"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:72:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 72 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:75:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | if (!status.ok()) return status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:77:16: error: class 'Release' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:77:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> 78 | ReverseTransport & transport; nix-grpc-store-clang-tidy-0.2.2> 79 | uint64_t id; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> | {} nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:78:32: error: member 'transport' of type 'ReverseTransport &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 78 | ReverseTransport & transport; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:84:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 84 | if (!completed) (void) transport.outgoing.cancel(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:86: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:96:96: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | for (unsigned i = 0; i != 4; ++i) wire.push_back(static_cast((size >> (8 * i)) & 0xff)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:99:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:100:83: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 100 | if (!registry.current(session) || (stillAssigned && !stillAssigned())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 101 | return {grpc::StatusCode::UNAVAILABLE, "reverse worker or assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:102:115: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 102 | if (!transport.outgoing.data(id, std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 103 | return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse request queue full"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:105:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | if (!transport.outgoing.halfClose(id)) return {grpc::StatusCode::UNAVAILABLE, "reverse request closed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:111:9: error: variable 'monitor' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:111:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:111:50: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:119:71: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:119:76: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | waitCv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:126:39: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 126 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:127:125: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 127 | if (!registry.current(session) || (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived()))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 128 | return {grpc::StatusCode::UNAVAILABLE, nix-grpc-store-clang-tidy-0.2.2> 129 | registry.current(session) ? "reverse call reassigned" : "reverse worker displaced"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:131:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 132 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:133:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 133 | if (!pending.empty() || expected) return {grpc::StatusCode::DATA_LOSS, "incomplete reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:135:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 135 | if (beforeAck) beforeAck(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:136:61: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 136 | if (!transport.outgoing.acknowledge(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 137 | return {grpc::StatusCode::UNAVAILABLE, "cannot acknowledge reverse result"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:145:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 145 | if (pending.size() < 4) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:147:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 147 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:148:91: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:148:101: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | length |= static_cast(static_cast(pending[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:149:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | if (length > maxMessageBytes) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:153:48: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 153 | if (pending.size() < *expected) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:154:78: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 154 | if (!receive(std::string_view(pending).substr(0, *expected))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 155 | return {grpc::StatusCode::DATA_LOSS, "invalid or rejected reverse response"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:159:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 159 | if (pending.size() > maxMessageBytes + 4) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse response too large"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:161:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 161 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "client cancelled reverse call"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:162:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 162 | if (std::chrono::system_clock::now() >= deadline) return {grpc::StatusCode::DEADLINE_EXCEEDED, "reverse call timed out"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:163:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 163 | if (stillAssigned && !stillAssigned() && (!resultReceived || !resultReceived())) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 164 | return {grpc::StatusCode::FAILED_PRECONDITION, "build assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:169:22: error: member 'gateway' of type 'ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 169 | ReverseGateway & gateway; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-relay.hh:170:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 170 | ReverseRegistry & registry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:46:24: error: function 'accept' has cognitive complexity of 40 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 46 | [[nodiscard]] auto accept(const nix::remote::ReverseFarmMsg & frame) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:52:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 52 | if (!event) { rejection = inbound.lastRejection(); return false; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:54:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 54 | switch (event->kind) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:56:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 56 | if (!event->caller) { rejection = "open without caller"; return false; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:59:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 59 | if (frame.open().method() == "UploadBuildInputs") { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:61:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:61:30: note: +1 nix-grpc-store-clang-tidy-0.2.2> 61 | if (!expects || !expects(delegated.drvPath, delegated.assignId)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:66:21: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:73:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 73 | if (frame.open().method() != "BuildDerivation") { rejection = "method not served"; return false; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:77:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 77 | if (auto it = uploads.find(id); it != uploads.end()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:81:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 81 | if (pending.wire.size() > ReverseRelay::maxRequestBytes + 4 nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:82:17: note: +1 nix-grpc-store-clang-tidy-0.2.2> 82 | || size > ReverseRelay::maxRequestBytes + 4 - pending.wire.size()) { rejection = "request too large"; return false; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:84:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 84 | if (!pending.length && pending.wire.size() >= 4) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:84:33: note: +1 nix-grpc-store-clang-tidy-0.2.2> 84 | if (!pending.length && pending.wire.size() >= 4) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:86:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 86 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:88:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 88 | if (length > ReverseRelay::maxRequestBytes) { rejection = "request too large"; return false; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:91:36: note: +1 nix-grpc-store-clang-tidy-0.2.2> 91 | return !pending.length || pending.wire.size() <= static_cast(*pending.length) + 4; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:94:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:96:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:96:60: note: +1 nix-grpc-store-clang-tidy-0.2.2> 96 | if (it == requests.end() || !it->second.length || it->second.wire.size() != *it->second.length + 4) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:108:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 108 | if (auto it = uploads.find(id); it != uploads.end()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:112:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:112:29: note: +1 nix-grpc-store-clang-tidy-0.2.2> 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:114:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 114 | if (ready && ready->id == id) ready.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:114:23: note: +1 nix-grpc-store-clang-tidy-0.2.2> 114 | if (ready && ready->id == id) ready.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:48:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 48 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:53:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | auto const id = event->streamId; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:66:21: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 66 | [check = expects, drv = delegated.drvPath, assign = delegated.assignId] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:77:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | if (auto it = uploads.find(id); it != uploads.end()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:77:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 77 | if (auto it = uploads.find(id); it != uploads.end()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 78 | return it->second->feed(frame.data().data()); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:86:50: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 86 | for (unsigned i = 0; i != 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 87 | length |= static_cast(static_cast(pending.wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:87:92: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | length |= static_cast(static_cast(pending.wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:87:102: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | length |= static_cast(static_cast(pending.wire[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:94:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:94:65: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 94 | if (auto it = uploads.find(id); it != uploads.end()) return it->second->finish(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:95:18: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | auto it = requests.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:108:22: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 108 | if (auto it = uploads.find(id); it != uploads.end()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:112:54: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | if (uploadReady && uploadReady->id == id) uploadReady.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:114:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 114 | if (ready && ready->id == id) ready.reset(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:121:64: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 121 | [[nodiscard]] auto lastRejection() const -> const char * { std::scoped_lock lock(mutex); return rejection; } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:123:62: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 123 | [[nodiscard]] auto takeReady() -> std::optional { std::scoped_lock lock(mutex); return std::exchange(ready, std::nullopt); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:124:69: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 124 | [[nodiscard]] auto takeUploadReady() -> std::optional { std::scoped_lock lock(mutex); return std::exchange(uploadReady, std::nullopt); } nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:130:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 130 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:131:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:131:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 131 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:141:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 141 | [[nodiscard]] auto finished(uint64_t id) -> bool { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:142:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 142 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:148:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 148 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:149:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-request.hh:149:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | for (auto & [id, pipe] : uploads) pipe->cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:32:38: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | [[nodiscard]] auto open(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:51:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 51 | auto it = streams.find(frame.stream_id()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:56:56: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | if (!cancelled.contains(frame.stream_id())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:57:34: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (frame.has_data()) return !frame.data().data().empty() && frame.data().data().size() <= ReverseFrames::maxFrameBytes; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:101:101: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | [[nodiscard]] auto waitTake(uint64_t id, nix::remote::ReverseWorkerMsg & frame, std::stop_token stop) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:104:24: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | auto pending = [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> std::_Deque_iterator nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:20: error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | std::ranges::find_if queue nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:105:61: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 105 | return std::find_if(queue.begin(), queue.end(), [id](auto const & next) { return next.stream_id() == id; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> auto nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:107:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | cv.wait(lock, stop, [&] { return closed || !streams.contains(id) || pending() != queue.end(); }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:111:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | auto it = pending(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:135:40: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 135 | [[nodiscard]] auto cancel(uint64_t id, bool sent = true) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:155:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 155 | if (sent && !finishAlreadyQueued) cancelled.insert(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:168:42: error: parameter name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 168 | [[nodiscard]] auto finished(uint64_t id) -> bool nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-responses.hh:171:14: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 171 | auto it = streams.find(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:42:17: error: implicit conversion 'grpc::ServerContext *' -> 'bool' [readability-implicit-bool-conversion,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 42 | if (context) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | != nullptr nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:54:22: error: member 'identity' of type 'WorkerIdentity &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 54 | WorkerIdentity & identity; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:55:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 55 | ReverseRegistry & registry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:56:12: error: member 'workerAuth' of type 'Auth &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 56 | Auth & workerAuth; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:66:10: error: function 'Register' has cognitive complexity of 46 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 66 | auto Register( nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:75:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 75 | if (!auth) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:79:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 79 | if (transports.size() != 1 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:79:36: note: +1 nix-grpc-store-clang-tidy-0.2.2> 79 | if (transports.size() != 1 || nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:80:94: note: +1 nix-grpc-store-clang-tidy-0.2.2> 80 | (std::string_view(transports.front().data(), transports.front().size()) != "ssl" && nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:90:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 90 | if (caller.kind != Caller::Kind::named) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:93:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 93 | if (auto const status = Auth::authorize(caller, "ReverseSession", Role::trusted); !status.ok()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:100:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 100 | if (first == last || std::next(first) != last) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:100:27: note: +1 nix-grpc-store-clang-tidy-0.2.2> 100 | if (first == last || std::next(first) != last) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:105:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 105 | if (!value.starts_with(prefix) || value.size() <= prefix.size()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:105:40: note: +1 nix-grpc-store-clang-tidy-0.2.2> 105 | if (!value.starts_with(prefix) || value.size() <= prefix.size()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:111:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 111 | if (!stream->Read(&msg)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:114:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 114 | if (msg.stream_id() != 0 || msg.frame_case() != nix::remote::ReverseWorkerMsg::FRAME_NOT_SET nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:115:13: note: +1 nix-grpc-store-clang-tidy-0.2.2> 115 | || !msg.credential().empty()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:118:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 118 | if (msg.protocol() != reverseProtocolVersion) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:122:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 122 | if (!bound) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:128:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 128 | if (!sessionKey) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:134:47: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 134 | bound->workerId, msg.worker_id(), [cancellation] { cancellation->cancel(); }, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:136:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 136 | if (!handle) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:144:13: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 144 | ~Cleanup() nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:139:16: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 139 | struct Cleanup nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:139:16: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:158:29: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 158 | std::jthread expiry([&, cancellation](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:160:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 160 | while (!stop.stop_requested() && std::chrono::system_clock::now() < deadline) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:160:43: note: +1 nix-grpc-store-clang-tidy-0.2.2> 160 | while (!stop.stop_requested() && std::chrono::system_clock::now() < deadline) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:161:53: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 161 | cv.wait_until(lock, stop, deadline, [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:163:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 163 | if (!stop.stop_requested()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:171:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 171 | if (!registry.current(*handle) || !stream->Write(ack)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:171:40: note: +1 nix-grpc-store-clang-tidy-0.2.2> 171 | if (!registry.current(*handle) || !stream->Write(ack)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:177:29: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 177 | std::jthread writer([&, cancellation](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:179:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 179 | while (transport->outgoing.waitTake(frame, stop)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:180:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 180 | if (!registry.current(*handle) || !stream->Write(frame)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:180:48: note: +1 nix-grpc-store-clang-tidy-0.2.2> 180 | if (!registry.current(*handle) || !stream->Write(frame)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:184:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 184 | if (frame.acknowledged()) transport->outgoing.acknowledgementSent(frame.stream_id()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:187:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 187 | while (stream->Read(&msg)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:188:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 188 | if (!msg.credential().empty()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:191:21: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 191 | ? identity.renew(msg.credential(), bound->workerId) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:190:52: note: +1 nix-grpc-store-clang-tidy-0.2.2> 190 | && msg.worker_id().empty() && registry.current(*handle) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:193:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 193 | if (!renewed) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:205:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 205 | if (!registry.current(*handle) || !transport->responses.accept(std::move(msg))) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:205:44: note: +1 nix-grpc-store-clang-tidy-0.2.2> 205 | if (!registry.current(*handle) || !transport->responses.accept(std::move(msg))) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:104:9: error: variable 'value' of type 'std::string_view' (aka 'basic_string_view') can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 104 | std::string_view value(first->second.data(), first->second.size()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:134:47: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 134 | bound->workerId, msg.worker_id(), [cancellation] { cancellation->cancel(); }, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:139:9: error: variable 'cleanup' of type 'struct Cleanup' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 139 | struct Cleanup nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:139:16: error: class 'Cleanup' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 139 | struct Cleanup nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:141:31: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 141 | ReverseRegistry & registry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:149:18: error: use designated initializer list to initialize 'struct Cleanup' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 149 | } cleanup{registry, *handle, cancellation}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .registry=.handle= .cancellation= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:139:9: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 139 | struct Cleanup nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:156:37: error: variable name 'cv' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 156 | std::condition_variable_any cv; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:158:9: error: variable 'expiry' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 158 | std::jthread expiry([&, cancellation](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:158:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 158 | std::jthread expiry([&, cancellation](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:158:63: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 158 | std::jthread expiry([&, cancellation](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:161:53: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 161 | cv.wait_until(lock, stop, deadline, [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:177:9: error: variable 'writer' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 177 | std::jthread writer([&, cancellation](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:177:29: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 177 | std::jthread writer([&, cancellation](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:177:63: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 177 | std::jthread writer([&, cancellation](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-session.hh:184:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 184 | if (frame.acknowledged()) transport->outgoing.acknowledgementSent(frame.stream_id()); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:20: error: variable name 'ok' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:45: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:32:88: error: rvalue reference parameter 'frame' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 32 | auto const ok = decoder.feed(bytes, [&](nix::remote::UploadBuildInputsChunk && frame) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:33:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 33 | if (assigned && !assigned()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:35:13: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 35 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:36:97: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 36 | if (closed || ended || size > maxQueuedBytes || queuedBytes > maxQueuedBytes - size) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:42:17: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 42 | if (!ok) cancel(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:49:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:68:24: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 68 | if (closed) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:79:42: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 79 | if (ended || !chunks.empty()) break; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:80:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 80 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:82:28: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 82 | if (chunks.empty()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:92:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 92 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:103:57: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 103 | cv.wait_for(lock, std::chrono::milliseconds(25)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:113:49: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 113 | if (!ended || closed || !chunks.empty()) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:120:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 120 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-pipe.hh:129:9: error: variable 'lock' of type 'std::scoped_lock' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 129 | std::scoped_lock lock(mutex); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:33:24: error: function 'call' has cognitive complexity of 53 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 33 | [[nodiscard]] auto call(grpc::ServerContext & context, const Select & select, const Assigned & assigned, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:36:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 36 | if (!select || !assigned || !read || first.ByteSizeLong() > ReverseUpload::maxChunkBytes nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:37:63: note: +1 nix-grpc-store-clang-tidy-0.2.2> 37 | || !first.has_chunk() || first.drv_path().empty() || first.assign_id() == 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:40:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 40 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:41:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:41:65: note: +1 nix-grpc-store-clang-tidy-0.2.2> 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:44:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 44 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:46:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 46 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:48:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 48 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:49:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 49 | if (!selection.prepared || selection.prepared->session != session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:49:33: note: +1 nix-grpc-store-clang-tidy-0.2.2> 49 | if (!selection.prepared || selection.prepared->session != session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:53:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 53 | if (!delegated || !ReverseUpload::first(*delegated, first) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:55:13: note: +1 nix-grpc-store-clang-tidy-0.2.2> 55 | || selection.prepared->assignId != first.assign_id()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:57:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 57 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "upload client cancelled"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:60:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 60 | if (!status.ok()) return status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:65:13: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 65 | ~Release() { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:66:17: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 66 | if (!completed) (void) transport.outgoing.cancel(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:76:30: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 76 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:78:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 78 | while (!stop.stop_requested()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:79:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 79 | if (context.IsCancelled() || std::chrono::system_clock::now() >= deadline || !registry.current(session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:80:21: note: +1 nix-grpc-store-clang-tidy-0.2.2> 80 | || !assigned()) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:87:72: note: nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:90:27: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 90 | auto const live = [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:91:98: note: +1 nix-grpc-store-clang-tidy-0.2.2> 91 | return !wake.stop_requested() && !context.IsCancelled() && registry.current(session) && assigned(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:93:21: note: nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 93 | auto send = [&](const nix::remote::UploadBuildInputsChunk & chunk) -> bool { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:95:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:95:27: note: +1 nix-grpc-store-clang-tidy-0.2.2> 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:97:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:97:30: note: +1 nix-grpc-store-clang-tidy-0.2.2> 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:99:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast((wire.size() >> (8 * i)) & 0xff); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:100:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:100:25: note: +1 nix-grpc-store-clang-tidy-0.2.2> 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:101:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 101 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:102:17: note: +3, including nesting penalty of 2, nesting level increased to 3 nix-grpc-store-clang-tidy-0.2.2> 102 | if (!live() || !transport.outgoing.waitData(id, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:102:29: note: +1 nix-grpc-store-clang-tidy-0.2.2> 102 | if (!live() || !transport.outgoing.waitData(id, nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:106:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 106 | if (!send(first)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:108:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 108 | while (read(next)) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:109:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 109 | if (!ReverseUpload::next(next)) return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload continuation"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:110:13: note: +2, including nesting penalty of 1, nesting level increased to 2 nix-grpc-store-clang-tidy-0.2.2> 110 | if (!send(next)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:113:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 113 | if (!live() || !transport.outgoing.halfClose(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:113:21: note: +1 nix-grpc-store-clang-tidy-0.2.2> 113 | if (!live() || !transport.outgoing.halfClose(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:116:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:116:75: note: +1 nix-grpc-store-clang-tidy-0.2.2> 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:118:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 118 | if (!response.has_finish()) return {grpc::StatusCode::DATA_LOSS, "unexpected upload response data"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:119:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 119 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:120:9: note: +1, including nesting penalty of 0, nesting level increased to 1 nix-grpc-store-clang-tidy-0.2.2> 120 | if (!transport.responses.finished(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:34:84: error: the parameter 'first' of type 'nix::remote::UploadBuildInputsChunk' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 34 | const Read & read, nix::remote::UploadBuildInputsChunk first) const -> grpc::Status nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:37:89: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 37 | || !first.has_chunk() || first.drv_path().empty() || first.assign_id() == 0) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 38 | return {grpc::StatusCode::INVALID_ARGUMENT, "invalid build-input upload header"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:40:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 40 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:41:108: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 41 | if (!selection.prepared || !selection.prepared->session || !selection.prepared->session->transport) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 42 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload session unavailable"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:44:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:45:20: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 45 | auto const id = session->transport->nextStreamId.fetch_add(1); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:46:21: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 46 | if (id == 0) return {grpc::StatusCode::RESOURCE_EXHAUSTED, "reverse stream IDs exhausted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:48:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 48 | if (!selection.status.ok()) return selection.status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:49:75: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | if (!selection.prepared || selection.prepared->session != session) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 50 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload worker changed during selection"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:55:66: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 55 | || selection.prepared->assignId != first.assign_id()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 56 | return {grpc::StatusCode::PERMISSION_DENIED, "invalid delegated upload"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:57:35: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | if (context.IsCancelled()) return {grpc::StatusCode::CANCELLED, "upload client cancelled"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:60:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 60 | if (!status.ok()) return status; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:61:16: error: class 'Release' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 61 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:61:16: error: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 61 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> 62 | ReverseTransport & transport; nix-grpc-store-clang-tidy-0.2.2> 63 | uint64_t id; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> | {} nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:62:32: error: member 'transport' of type 'ReverseTransport &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 62 | ReverseTransport & transport; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:66:32: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 66 | if (!completed) (void) transport.outgoing.cancel(id); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:70:18: error: use designated initializer list to initialize 'struct Release' [modernize-use-designated-initializers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 70 | } release{transport, id}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | .transport=.id= nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:61:9: note: aggregate type is defined here nix-grpc-store-clang-tidy-0.2.2> 61 | struct Release { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:75:37: error: variable name 'cv' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 75 | std::condition_variable_any cv; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:76:9: error: variable 'monitor' of type 'std::jthread' can be declared 'const' [misc-const-correctness,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 76 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:76:30: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 76 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> void nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:76:50: error: the parameter 'stop' of type 'std::stop_token' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 76 | std::jthread monitor([&](std::stop_token stop) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | const & nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:87:67: error: 25 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:87:72: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 87 | cv.wait_for(lock, stop, std::chrono::milliseconds(25), [] { return false; }); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:90:27: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 90 | auto const live = [&] { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:95:66: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 95 | if (size == 0 || size > ReverseUpload::maxChunkBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:97:76: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 97 | if (wire.empty() || wire.size() > ReverseUpload::maxChunkBytes) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:99:45: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast((wire.size() >> (8 * i)) & 0xff); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:99:52: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast((wire.size() >> (8 * i)) & 0xff); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:99:93: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast((wire.size() >> (8 * i)) & 0xff); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:99:103: error: 0xff is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 99 | for (unsigned i = 0; i < 4; ++i) prefix[i] = static_cast((wire.size() >> (8 * i)) & 0xff); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:100:87: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 100 | if (!live() || !transport.outgoing.waitData(id, prefix, wake.get_token())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:101:98: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 101 | for (size_t offset = 0; offset < wire.size(); offset += ReverseFrames::maxFrameBytes) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 102 | if (!live() || !transport.outgoing.waitData(id, nix-grpc-store-clang-tidy-0.2.2> 103 | std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes), wake.get_token())) return false; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:103:112: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 103 | std::string_view(wire).substr(offset, ReverseFrames::maxFrameBytes), wake.get_token())) return false; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:106:26: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 106 | if (!send(first)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:109:44: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 109 | if (!ReverseUpload::next(next)) return {grpc::StatusCode::INVALID_ARGUMENT, "invalid upload continuation"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:110:29: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 110 | if (!send(next)) return {grpc::StatusCode::UNAVAILABLE, "reverse upload interrupted"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:113:58: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 113 | if (!live() || !transport.outgoing.halfClose(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 114 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload closed"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:116:86: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 116 | if (!transport.responses.waitTake(id, response, wake.get_token()) || !live()) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 117 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload session ended"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:118:36: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 118 | if (!response.has_finish()) return {grpc::StatusCode::DATA_LOSS, "unexpected upload response data"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:119:25: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 119 | if (!assigned()) return {grpc::StatusCode::FAILED_PRECONDITION, "upload assignment changed"}; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:120:47: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 120 | if (!transport.responses.finished(id)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 121 | return {grpc::StatusCode::UNAVAILABLE, "reverse upload response stream lost"}; nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:127:22: error: member 'gateway' of type 'ReverseGateway &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 127 | ReverseGateway & gateway; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload-relay.hh:128:23: error: member 'registry' of type 'ReverseRegistry &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 128 | ReverseRegistry & registry; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: error: performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: note: make conversion explicit to silence this warning nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:22:45: note: perform multiplication in a wider type nix-grpc-store-clang-tidy-0.2.2> 22 | static constexpr size_t maxChunkBytes = 1024 * 1024; nix-grpc-store-clang-tidy-0.2.2> | ^~~~ nix-grpc-store-clang-tidy-0.2.2> | static_cast( ) nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:49:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 49 | if (failed || bytes.empty() || !consume) return fail(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:53:37: error: result of a `data()` call may not be null terminated, provide size information to the callee to prevent potential issues [bugprone-suspicious-stringview-data-usage,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 53 | buffer.append(bytes.data(), count); nix-grpc-store-clang-tidy-0.2.2> | ~~~~~~^~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:57:53: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 57 | for (unsigned i = 0; i < 4; ++i) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:58:90: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:58:100: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 58 | length |= static_cast(static_cast(buffer[i])) << (8 * i); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:59:63: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 59 | if (length == 0 || length > maxChunkBytes) return fail(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:64:61: error: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 64 | if (!frame.ParseFromArray(buffer.data() + 4, static_cast(*expected)) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/reverse-upload.hh:65:111: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 65 | || !(seenFirst ? next(frame) : first(delegated, frame)) || !consume(std::move(frame))) nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> 66 | return fail(); nix-grpc-store-clang-tidy-0.2.2> | nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:323:61: error: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 323 | lastAssignId = (static_cast(entropy()) << 32) | entropy(); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/scheduler.hh:371:20: error: variable name 'it' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 371 | auto const it = workerIds.find(std::string(addr)); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:20:22: error: member 'verifier' of type 'oidc::Verifier &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 20 | oidc::Verifier & verifier; // configured with a tunnel-only audience nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:29:86: error: use a trailing return type for this lambda [modernize-use-trailing-return-type,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | -> bool nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:29:103: error: parameter name 'c' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 29 | return !value.empty() && value.size() <= limit && std::ranges::all_of(value, [](unsigned char c) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:43:22: error: 8 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | if (i == 8 || i == 13 || i == 18 || i == 23) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:43:32: error: 13 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | if (i == 8 || i == 13 || i == 18 || i == 23) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:43:43: error: 18 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | if (i == 8 || i == 13 || i == 18 || i == 23) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:43:54: error: 23 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 43 | if (i == 8 || i == 13 || i == 18 || i == 23) { nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:44:24: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 44 | if (uid[i] != '-') { nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:47:24: error: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) { nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> | < || > && < || > nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:47:30: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) { nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:47:47: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) { nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:47:66: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) { nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:47:83: error: possibly unsafe 'operator[]', consider bounds-safe alternatives [cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 47 | } else if (!((uid[i] >= '0' && uid[i] <= '9') || (uid[i] >= 'a' && uid[i] <= 'f'))) { nix-grpc-store-clang-tidy-0.2.2> | ^~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:96:22: error: variable name 'id' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 96 | auto const & id = *result.identity; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:107:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 107 | if (maxLifetime.count() <= 0 || !id.issuedAt || *id.expiresAt - *id.issuedAt > maxLifetime nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:108:17: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 108 | || *id.expiresAt > std::chrono::system_clock::now() + maxLifetime + skew) { nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:111:58: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 111 | auto const boundId = "pod:" + nameSpace + ":" + *id.podUid; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/daemon/worker-identity.hh:112:57: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 112 | return Bound{.workerId = boundId, .expiresAt = *id.expiresAt}; nix-grpc-store-clang-tidy-0.2.2> | ^~~~~~~~~~~~ nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:327:14: error: variable 'extra' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 327 | char extra; nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | = 0 nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:330:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:336:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 336 | if (out.pos != 0) throw nix::Error("trailing decompressed upload data"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> ../src/pump.hh:338:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] nix-grpc-store-clang-tidy-0.2.2> 338 | if (zin.pos != zin.size) throw nix::Error("trailing compressed upload data"); nix-grpc-store-clang-tidy-0.2.2> | ^ nix-grpc-store-clang-tidy-0.2.2> | { nix-grpc-store-clang-tidy-0.2.2> Errors encountered while running clang-tidy nix-grpc-store-clang-tidy-0.2.2> FAILED: [code=1] meson-internal__clang-tidy nix-grpc-store-clang-tidy-0.2.2> /nix/store/4mm6h8v69a4mg9sxwsancrf2zsfg5gv2-meson-1.12.1/bin/meson --internal clangtidy /build/source /build/source/build --color always nix-grpc-store-clang-tidy-0.2.2> ninja: build stopped: subcommand failed. error: Cannot build '/nix/store/pck1ja5yd8r7f3gv8d5hvic3j3q861xh-nix-grpc-store-clang-tidy-0.2.2.drv'. Reason: builder failed with exit code 1. Output paths: /nix/store/ml60fvw8mvyi9rj57qj0x366djw0x04c-nix-grpc-store-clang-tidy-0.2.2 Last 25 log lines: > 111 | auto const boundId = "pod:" + nameSpace + ":" + *id.podUid; > | ^~~~~~~~~ > ../src/daemon/worker-identity.hh:112:57: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors] > 112 | return Bound{.workerId = boundId, .expiresAt = *id.expiresAt}; > | ^~~~~~~~~~~~ > ../src/pump.hh:327:14: error: variable 'extra' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors] > 327 | char extra; > | ^ > | = 0 > ../src/pump.hh:330:41: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] > 330 | if (!reader->Read(&msg)) throw nix::EndOfFile("incomplete zstd frame"); > | ^ > | { > ../src/pump.hh:336:30: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] > 336 | if (out.pos != 0) throw nix::Error("trailing decompressed upload data"); > | ^ > | { > ../src/pump.hh:338:33: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors] > 338 | if (zin.pos != zin.size) throw nix::Error("trailing compressed upload data"); > | ^ > | { > Errors encountered while running clang-tidy > FAILED: [code=1] meson-internal__clang-tidy > /nix/store/4mm6h8v69a4mg9sxwsancrf2zsfg5gv2-meson-1.12.1/bin/meson --internal clangtidy /build/source /build/source/build --color always > ninja: build stopped: subcommand failed. For full logs, run: nix log /nix/store/pck1ja5yd8r7f3gv8d5hvic3j3q861xh-nix-grpc-store-clang-tidy-0.2.2.drv