Skip to content

Commit

Permalink
Merge pull request #1986 from justusranvier/develop
Browse files Browse the repository at this point in the history
upgrade ci check from iwyu-0.18 to iwyu-0.19
  • Loading branch information
justusranvier committed Nov 15, 2022
2 parents e29ccd0 + 0c9b4c3 commit 480e136
Show file tree
Hide file tree
Showing 891 changed files with 2,398 additions and 1,013 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/linux.yml
Expand Up @@ -16,7 +16,7 @@ jobs:
docker: 35_2
compiler: gcc
- toolchain: gcc-12.2
docker: 37_1
docker: 37_2
compiler: gcc
- toolchain: clang-13
docker: 35_2
Expand All @@ -25,7 +25,7 @@ jobs:
docker: 36_2
compiler: clang
- toolchain: clang-15
docker: 37_1
docker: 37_2
compiler: clang
steps:
- name: Checkout opentxs
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
strategy:
fail-fast: false
env:
docker: '37_1'
docker: '37_2'
compiler: clang
preset: tidy
steps:
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
strategy:
fail-fast: false
env:
docker: '37_1'
docker: '37_2'
steps:
- name: Checkout opentxs
uses: actions/checkout@v3
Expand All @@ -109,8 +109,7 @@ jobs:
strategy:
fail-fast: false
env:
# waiting to upgrade to 37_1 / clang-15 yet until we have a resolution for https://github.com/include-what-you-use/include-what-you-use/issues/1115. Hopefully the resolution is not adding hundreds of no_forward_declare pragmas all over the place.
docker: '36_2'
docker: '37_2'
steps:
- name: Checkout opentxs
uses: actions/checkout@v3
Expand Down
2 changes: 2 additions & 0 deletions include/opentxs/api/network/Blockchain.hpp
Expand Up @@ -3,6 +3,8 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// IWYU pragma: no_forward_declare opentxs::BlockchainProfile
// IWYU pragma: no_forward_declare opentxs::blockchain::Type
// IWYU pragma: no_include "opentxs/util/BlockchainProfile.hpp"

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion include/opentxs/blockchain/Types.hpp
Expand Up @@ -3,6 +3,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// IWYU pragma: no_forward_declare opentxs::UnitType
// IWYU pragma: no_include "opentxs/core/Amount.hpp"
// IWYU pragma: no_include "opentxs/core/UnitType.hpp"
// IWYU pragma: no_include "opentxs/opentxs.hpp"
Expand Down Expand Up @@ -37,7 +38,7 @@ namespace opentxs::blockchain
{
using TypeEnum = std::uint32_t;

enum class Type : TypeEnum; // IWYU pragma: export
enum class Type : TypeEnum;

using Amount = opentxs::Amount;
using ChainHeight = std::int64_t;
Expand Down
1 change: 1 addition & 0 deletions include/opentxs/blockchain/Work.hpp
Expand Up @@ -3,6 +3,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// IWYU pragma: no_forward_declare opentxs::blockchain::Type
// IWYU pragma: no_include "opentxs/blockchain/BlockchainType.hpp"

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion include/opentxs/blockchain/bitcoin/block/Types.hpp
Expand Up @@ -15,7 +15,7 @@

namespace opentxs::blockchain::bitcoin::block
{
enum class OP : std::uint8_t; // IWYU pragma: export
enum class OP : std::uint8_t;

struct ScriptElement {
using ScriptData = Space;
Expand Down
2 changes: 1 addition & 1 deletion include/opentxs/blockchain/bitcoin/cfilter/Types.hpp
Expand Up @@ -14,7 +14,7 @@ namespace opentxs::blockchain::cfilter
{
using TypeEnum = std::uint32_t;

enum class Type : TypeEnum; // IWYU pragma: export
enum class Type : TypeEnum;

OPENTXS_EXPORT auto print(Type) noexcept -> std::string_view;
} // namespace opentxs::blockchain::cfilter
16 changes: 6 additions & 10 deletions include/opentxs/blockchain/crypto/Types.hpp
Expand Up @@ -46,10 +46,10 @@ class Generic;

namespace opentxs::blockchain::crypto
{
enum class AddressStyle : std::uint16_t; // IWYU pragma: export
enum class HDProtocol : std::uint16_t; // IWYU pragma: export
enum class SubaccountType : std::uint16_t; // IWYU pragma: export
enum class Subchain : std::uint8_t; // IWYU pragma: export
enum class AddressStyle : std::uint16_t;
enum class HDProtocol : std::uint16_t;
enum class SubaccountType : std::uint16_t;
enum class Subchain : std::uint8_t;

/// transaction id, output index
using Coin = std::pair<UnallocatedCString, std::size_t>;
Expand All @@ -58,6 +58,8 @@ using Key = std::tuple<identifier::Generic, Subchain, Bip32Index>;
using Activity = std::tuple<Coin, Key, Amount>;

OPENTXS_EXPORT auto is_notification(Subchain) noexcept -> bool;
OPENTXS_EXPORT auto operator!=(const Key& lhs, const Key& rhs) noexcept -> bool;
OPENTXS_EXPORT auto operator==(const Key& lhs, const Key& rhs) noexcept -> bool;
OPENTXS_EXPORT auto print(AddressStyle) noexcept -> std::string_view;
OPENTXS_EXPORT auto print(HDProtocol) noexcept -> std::string_view;
OPENTXS_EXPORT auto print(SubaccountType) noexcept -> std::string_view;
Expand Down Expand Up @@ -86,12 +88,6 @@ struct hash<opentxs::blockchain::crypto::Key> {

namespace opentxs
{
OPENTXS_EXPORT auto operator==(
const blockchain::crypto::Key& lhs,
const blockchain::crypto::Key& rhs) noexcept -> bool;
OPENTXS_EXPORT auto operator!=(
const blockchain::crypto::Key& lhs,
const blockchain::crypto::Key& rhs) noexcept -> bool;
auto deserialize(const ReadView in) noexcept -> blockchain::crypto::Key;
auto serialize(const blockchain::crypto::Key& in) noexcept -> Space;
} // namespace opentxs
1 change: 1 addition & 0 deletions include/opentxs/blockchain/node/Stats.hpp
Expand Up @@ -3,6 +3,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// IWYU pragma: no_forward_declare opentxs::blockchain::Type
// IWYU pragma: no_include "opentxs/blockchain/BlockchainType.hpp"

#pragma once
Expand Down
7 changes: 4 additions & 3 deletions include/opentxs/blockchain/node/Types.hpp
Expand Up @@ -17,6 +17,7 @@
#include "opentxs/Export.hpp"
#include "opentxs/blockchain/Types.hpp"
#include "opentxs/blockchain/block/Types.hpp"
#include "opentxs/core/ByteArray.hpp"
#include "opentxs/util/Container.hpp"

// NOLINTBEGIN(modernize-concat-nested-namespaces)
Expand All @@ -39,9 +40,9 @@ namespace opentxs::blockchain::node
{
using TypeEnum = std::uint32_t;

enum class SendResult : TypeEnum; // IWYU pragma: export
enum class TxoState : std::uint16_t; // IWYU pragma: export
enum class TxoTag : std::uint16_t; // IWYU pragma: export
enum class SendResult : TypeEnum;
enum class TxoState : std::uint16_t;
enum class TxoTag : std::uint16_t;

using BitcoinBlockResult =
std::shared_future<std::shared_ptr<const bitcoin::block::Block>>;
Expand Down
3 changes: 3 additions & 0 deletions include/opentxs/blockchain/p2p/Address.hpp
Expand Up @@ -3,6 +3,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// IWYU pragma: no_forward_declare opentxs::blockchain::Type
// IWYU pragma: no_forward_declare opentxs::blockchain::p2p::Network

#pragma once

#include <cstdint>
Expand Down
7 changes: 5 additions & 2 deletions include/opentxs/core/Contact.hpp
Expand Up @@ -3,12 +3,15 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#pragma once

// IWYU pragma: no_forward_declare opentxs::blockchain::Type
// IWYU pragma: no_forward_declare opentxs::blockchain::crypto::AddressStyle
// IWYU pragma: no_forward_declare opentxs::identity::wot::claim::ClaimType
// IWYU pragma: no_include "opentxs/blockchain/BlockchainType.hpp"
// IWYU pragma: no_include "opentxs/core/PaymentCode.hpp"
// IWYU pragma: no_include "opentxs/identity/wot/claim/ClaimType.hpp"

#pragma once

#include <atomic>
#include <cstdint>
#include <ctime>
Expand Down
6 changes: 3 additions & 3 deletions include/opentxs/core/Types.hpp
Expand Up @@ -18,9 +18,9 @@ struct OPENTXS_EXPORT HexType {

static constexpr auto IsHex = HexType{};

enum class AccountType : std::int8_t; // IWYU pragma: export
enum class AddressType : std::uint8_t; // IWYU pragma: export
enum class UnitType : std::uint32_t; // IWYU pragma: export
enum class AccountType : std::int8_t;
enum class AddressType : std::uint8_t;
enum class UnitType : std::uint32_t;

auto print(AccountType) noexcept -> std::string_view;
auto print(AddressType) noexcept -> std::string_view;
Expand Down
18 changes: 8 additions & 10 deletions include/opentxs/core/contract/Types.hpp
Expand Up @@ -7,19 +7,17 @@

#include <cstddef>
#include <cstdint>
#include <string_view>

#include "opentxs/Export.hpp"

namespace opentxs::contract
{
enum class ProtocolVersion : std::uint32_t; // IWYU pragma: export
enum class Type : std::uint32_t; // IWYU pragma: export
enum class UnitType : std::uint32_t; // IWYU pragma: export
} // namespace opentxs::contract
enum class ProtocolVersion : std::uint32_t;
enum class Type : std::uint32_t;
enum class UnitType : std::uint32_t;

namespace opentxs
{
OPENTXS_EXPORT auto print(contract::ProtocolVersion) noexcept -> const char*;
OPENTXS_EXPORT auto print(contract::Type) noexcept -> const char*;
OPENTXS_EXPORT auto print(contract::UnitType) noexcept -> const char*;
} // namespace opentxs
OPENTXS_EXPORT auto print(ProtocolVersion) noexcept -> std::string_view;
OPENTXS_EXPORT auto print(Type) noexcept -> std::string_view;
OPENTXS_EXPORT auto print(UnitType) noexcept -> std::string_view;
} // namespace opentxs::contract
8 changes: 4 additions & 4 deletions include/opentxs/core/contract/peer/Types.hpp
Expand Up @@ -12,8 +12,8 @@

namespace opentxs::contract::peer
{
enum class ConnectionInfoType : std::uint8_t; // IWYU pragma: export
enum class PeerObjectType : std::uint8_t; // IWYU pragma: export
enum class PeerRequestType : std::uint8_t; // IWYU pragma: export
enum class SecretType : std::uint8_t; // IWYU pragma: export
enum class ConnectionInfoType : std::uint8_t;
enum class PeerObjectType : std::uint8_t;
enum class PeerRequestType : std::uint8_t;
enum class SecretType : std::uint8_t;
} // namespace opentxs::contract::peer
2 changes: 2 additions & 0 deletions include/opentxs/core/identifier/Generic.hpp
Expand Up @@ -3,6 +3,8 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// IWYU pragma: no_forward_declare opentxs::identifier::Algorithm
// IWYU pragma: no_forward_declare opentxs::identifier::Type
// IWYU pragma: no_include "opentxs/core/identifier/Algorithm.hpp"
// IWYU pragma: no_include "opentxs/core/identifier/Type.hpp"

Expand Down
5 changes: 3 additions & 2 deletions include/opentxs/core/identifier/Types.hpp
Expand Up @@ -3,6 +3,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// IWYU pragma: no_forward_declare opentxs::contract::Type
// IWYU pragma: no_include "opentxs/core/contract/ContractType.hpp"
// IWYU pragma: no_include <opentxs/core/contract/ContractType.hpp>

Expand All @@ -16,8 +17,8 @@

namespace opentxs::identifier
{
enum class Algorithm : std::uint8_t; // IWYU pragma: export
enum class Type : std::uint16_t; // IWYU pragma: export
enum class Algorithm : std::uint8_t;
enum class Type : std::uint16_t;

OPENTXS_EXPORT auto print(Algorithm) noexcept -> std::string_view;
OPENTXS_EXPORT auto print(Type) noexcept -> std::string_view;
Expand Down
8 changes: 8 additions & 0 deletions include/opentxs/crypto/Parameters.hpp
Expand Up @@ -3,6 +3,14 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// IWYU pragma: no_forward_declare opentxs::crypto::Language
// IWYU pragma: no_forward_declare opentxs::crypto::ParameterType
// IWYU pragma: no_forward_declare opentxs::crypto::SeedStrength
// IWYU pragma: no_forward_declare opentxs::crypto::SeedStyle
// IWYU pragma: no_forward_declare opentxs::crypto::asymmetric::Algorithm
// IWYU pragma: no_forward_declare opentxs::identity::CredentialType
// IWYU pragma: no_forward_declare opentxs::identity::SourceProofType
// IWYU pragma: no_forward_declare opentxs::identity::SourceType
// IWYU pragma: no_include "opentxs/crypto/Language.hpp"
// IWYU pragma: no_include "opentxs/crypto/ParameterType.hpp"
// IWYU pragma: no_include "opentxs/crypto/SeedStrength.hpp"
Expand Down
26 changes: 14 additions & 12 deletions include/opentxs/crypto/Types.hpp
Expand Up @@ -8,24 +8,28 @@
#include <cstddef>
#include <cstdint>
#include <functional>
#include <string_view>

#include "opentxs/Export.hpp"
#include "opentxs/util/Container.hpp"

namespace opentxs::crypto
{
enum class HashType : std::uint8_t; // IWYU pragma: export
enum class Language : std::uint8_t; // IWYU pragma: export
enum class ParameterType : std::uint8_t; // IWYU pragma: export
enum class SecretStyle : std::uint8_t; // IWYU pragma: export
enum class SeedStrength : std::size_t; // IWYU pragma: export
enum class SeedStyle : std::uint8_t; // IWYU pragma: export
enum class SignatureRole : std::uint16_t; // IWYU pragma: export
enum class HashType : std::uint8_t;
enum class Language : std::uint8_t;
enum class ParameterType : std::uint8_t;
enum class SecretStyle : std::uint8_t;
enum class SeedStrength : std::size_t;
enum class SeedStyle : std::uint8_t;
enum class SignatureRole : std::uint16_t;

enum class EcdsaCurve : std::uint8_t {
invalid = 0,
secp256k1 = 1,
ed25519 = 2,
};

auto print(SeedStyle) noexcept -> std::string_view;
} // namespace opentxs::crypto

namespace opentxs
Expand All @@ -40,9 +44,7 @@ using BIP44Chain = bool;
static const BIP44Chain INTERNAL_CHAIN = true;
static const BIP44Chain EXTERNAL_CHAIN = false;

enum class Bip32Child : Bip32Index; // IWYU pragma: export
enum class Bip43Purpose : Bip32Index; // IWYU pragma: export
enum class Bip44Type : Bip32Index; // IWYU pragma: export

auto print(crypto::SeedStyle) noexcept -> UnallocatedCString;
enum class Bip32Child : Bip32Index;
enum class Bip43Purpose : Bip32Index;
enum class Bip44Type : Bip32Index;
} // namespace opentxs
4 changes: 4 additions & 0 deletions include/opentxs/crypto/asymmetric/Key.hpp
Expand Up @@ -3,6 +3,10 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// IWYU pragma: no_forward_declare opentxs::crypto::HashType
// IWYU pragma: no_forward_declare opentxs::crypto::asymmetric::Algorithm
// IWYU pragma: no_forward_declare opentxs::crypto::asymmetric::Role
// IWYU pragma: no_forward_declare opentxs::identity::NymCapability
// IWYU pragma: no_include "opentxs/crypto/HashType.hpp"
// IWYU pragma: no_include "opentxs/crypto/asymmetric/Algorithm.hpp"
// IWYU pragma: no_include "opentxs/crypto/asymmetric/Role.hpp"
Expand Down
6 changes: 3 additions & 3 deletions include/opentxs/crypto/asymmetric/Types.hpp
Expand Up @@ -12,9 +12,9 @@

namespace opentxs::crypto::asymmetric
{
enum class Algorithm : std::uint8_t; // IWYU pragma: export
enum class Mode : std::uint8_t; // IWYU pragma: export
enum class Role : std::uint8_t; // IWYU pragma: export
enum class Algorithm : std::uint8_t;
enum class Mode : std::uint8_t;
enum class Role : std::uint8_t;

OPENTXS_EXPORT auto print(Algorithm) noexcept -> std::string_view;
OPENTXS_EXPORT auto print(Mode) noexcept -> std::string_view;
Expand Down
4 changes: 3 additions & 1 deletion include/opentxs/crypto/asymmetric/key/EllipticCurve.hpp
Expand Up @@ -3,6 +3,8 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// IWYU pragma: no_forward_declare opentxs::crypto::HashType

#pragma once

#include "opentxs/Export.hpp"
Expand Down Expand Up @@ -30,8 +32,8 @@ class KeyPrivate;
} // namespace asymmetric
} // namespace crypto

class Secret;
class PasswordPrompt;
class Secret;
class Writer;
} // namespace opentxs
// NOLINTEND(modernize-concat-nested-namespaces)
Expand Down
2 changes: 2 additions & 0 deletions include/opentxs/crypto/symmetric/Key.hpp
Expand Up @@ -3,6 +3,8 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// IWYU pragma: no_forward_declare opentxs::crypto::symmetric::Algorithm

#pragma once

#include "opentxs/Export.hpp"
Expand Down

0 comments on commit 480e136

Please sign in to comment.