Bump clang-format to 14

Our lint ci image no longer has an available clang-format-11.
This commit is contained in:
Jason Rhinelander 2023-01-13 21:21:17 -04:00
parent a099ff651a
commit 95f632bbe9
No known key found for this signature in database
GPG Key ID: C4992CE7A88D4262
6 changed files with 12 additions and 13 deletions

View File

@ -155,7 +155,7 @@ local static_check_and_upload = [
'echo "Building on ${DRONE_STAGE_MACHINE}"',
apt_get_quiet + ' update',
apt_get_quiet + ' install -y eatmydata',
'eatmydata ' + apt_get_quiet + ' install --no-install-recommends -y git clang-format-11 jsonnet',
'eatmydata ' + apt_get_quiet + ' install --no-install-recommends -y git clang-format-14 jsonnet',
'./contrib/drone-format-verify.sh',
],
}],
@ -164,7 +164,7 @@ local static_check_and_upload = [
// Various debian builds
debian_pipeline('Debian (amd64)', docker_base + 'debian-sid', lto=true),
debian_pipeline('Debian Debug (amd64)', docker_base + 'debian-sid', build_type='Debug'),
clang(13, lto=true),
clang(14, lto=true),
debian_pipeline('Debian stable (i386)', docker_base + 'debian-stable/i386'),
debian_pipeline('Ubuntu LTS (amd64)', docker_base + 'ubuntu-lts'),
debian_pipeline('Ubuntu latest (amd64)', docker_base + 'ubuntu-rolling'),

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
test "x$IGNORE" != "x" && exit 0
repo=$(readlink -e $(dirname $0)/../)
clang-format-11 -i $(find $repo/{oxenss,unit_test} | grep -E '\.[hc](pp)?$' | grep -v 'Catch2')
clang-format-14 -i $(find $repo/{oxenss,unit_test} | grep -E '\.[hc](pp)?$' | grep -v 'Catch2')
jsonnetfmt -i $repo/.drone.jsonnet
git --no-pager diff --exit-code --color || (echo -ne '\n\n\e[31;1mLint check failed; please run ./contrib/format.sh\e[0m\n\n' ; exit 1)

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
CLANG_FORMAT_DESIRED_VERSION=11
CLANG_FORMAT_DESIRED_VERSION=14
binary=$(command -v clang-format-$CLANG_FORMAT_DESIRED_VERSION 2>/dev/null)
if [ $? -ne 0 ]; then

View File

@ -164,7 +164,9 @@ namespace {
}
#ifndef NDEBUG
constexpr bool check_ascending(std::string_view) { return true; }
constexpr bool check_ascending(std::string_view) {
return true;
}
template <typename... Args>
constexpr bool check_ascending(std::string_view a, std::string_view b, Args&&... args) {
return a < b && check_ascending(b, std::forward<Args>(args)...);

View File

@ -579,10 +579,10 @@ struct expire_msgs final : recursive {
///
/// Takes parameters of:
/// - `pubkey` -- the account
/// - `pubkey_ed25519` if provided *and* the pubkey has a type 05 (i.e. Session id) then `pubkey` will
/// be interpreted as an `x25519` pubkey derived from this given ed25519 pubkey (which must be 64
/// hex characters or 32 bytes). *This* pubkey should be used for signing, but must also convert
/// to the given `pubkey` value (without the `05` prefix).
/// - `pubkey_ed25519` if provided *and* the pubkey has a type 05 (i.e. Session id) then `pubkey`
/// will be interpreted as an `x25519` pubkey derived from this given ed25519 pubkey (which must
/// be 64 hex characters or 32 bytes). *This* pubkey should be used for signing, but must also
/// convert to the given `pubkey` value (without the `05` prefix).
/// - `subkey` (optional) allows authentication using a derived subkey. See `store` for details on
/// how subkey authentication works.
/// - `messages` -- array of message hash strings (as provided by the storage server) to update.

View File

@ -145,10 +145,7 @@ std::string computeMessageHash_old(
std::string_view data);
/// Computes a message hash using blake2b hash of various messages attributes.
std::string computeMessageHash(
const user_pubkey_t& pubkey,
namespace_id ns,
std::string_view data);
std::string computeMessageHash(const user_pubkey_t& pubkey, namespace_id ns, std::string_view data);
struct OnionRequestMetadata {
crypto::x25519_pubkey ephem_key;