Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define a standardized header ordering for Azure SDK for C++ #4632

Merged
merged 6 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 17 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,26 @@ CompactNamespaces: true
Cpp11BracedListStyle: true
FixNamespaceComments: true
IndentWidth: 2
IncludeBlocks: Preserve
IncludeBlocks: Regroup
IndentCaseLabels: true
NamespaceIndentation: Inner
PointerAlignment: Left
PenaltyReturnTypeOnItsOwnLine: 300
TabWidth: 2
UseTab: Never
IncludeCategories:
- Regex: '^<windows.h>$'
Priority: 80
# Note: get_env.hpp must be included before any other Azure SDK headers.
- Regex: '^["<]get_env.hpp'
Priority: 10
- Regex: '<[[:alnum:]_.]+>'
Priority: 90
- Regex: '<Azure/.*>'
Priority: 50
- Regex: '^<azure_uamqp_c.*/(amqp_definitions_sequence_no|amqp_definitions_milliseconds|amqp_definitions_terminus_expiry_policy|amqp_definitions_terminus_durability).h>$'
Priority: 60
- Regex: '<azure_.*>'
Priority: 70
- Regex: '^".+'
Priority: 20
2 changes: 2 additions & 0 deletions samples/integration/vcpkg-all-smoke/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

#include "get_env.hpp"

#include <azure/attestation.hpp>
#include <azure/core.hpp>
#include <azure/core/internal/json/json.hpp>
Expand All @@ -18,6 +19,7 @@
#include <azure/storage/files/datalake.hpp>
#include <azure/storage/files/shares.hpp>
#include <azure/storage/queues.hpp>

#include <iostream>

using namespace Azure::Security::KeyVault::Keys;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@

#include "azure/attestation/attestation_client_models.hpp"
#include "azure/attestation/attestation_client_options.hpp"

#include <azure/core/context.hpp>
#include <azure/core/internal/tracing/service_tracing.hpp>
#include <azure/core/url.hpp>

#include <string>

namespace Azure { namespace Core { namespace Http { namespace _internal {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@

#include "azure/attestation/attestation_client_models.hpp"
#include "azure/attestation/attestation_client_options.hpp"

#include <azure/core/context.hpp>
#include <azure/core/internal/tracing/service_tracing.hpp>
#include <azure/core/url.hpp>

#include <string>

namespace Azure { namespace Core { namespace Http { namespace _internal {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
#pragma once

#include "azure/attestation/dll_import_export.hpp"

#include <azure/core/context.hpp>
#include <azure/core/http/http.hpp>
#include <azure/core/internal/extendable_enumeration.hpp>
#include <azure/core/nullable.hpp>
#include <azure/core/paged_response.hpp>
#include <azure/core/response.hpp>

#include <iostream>
#include <memory>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "azure/attestation/attestation_client_models.hpp"
#include "dll_import_export.hpp"

#include <azure/core/internal/client_options.hpp>
#include <azure/core/internal/extendable_enumeration.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
#include <get_env.hpp>

#include "attestation_collateral.hpp"

#include <azure/attestation.hpp>
#include <azure/core/base64.hpp>

#include <chrono>
#include <iostream>
#include <thread>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
#include <get_env.hpp>

#include "attestation_collateral.hpp"

#include <azure/attestation.hpp>
#include <azure/core/base64.hpp>

#include <chrono>
#include <iostream>
#include <thread>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
#include <get_env.hpp>

#include "attestation_collateral.hpp"

#include <azure/attestation.hpp>
#include <azure/core/base64.hpp>

#include <chrono>
#include <iostream>
#include <thread>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
#include <get_env.hpp>

#include "attestation_collateral.hpp"

#include <azure/attestation.hpp>
#include <azure/core/base64.hpp>

#include <chrono>
#include <iostream>
#include <thread>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
#include <get_env.hpp>

#include "attestation_collateral.hpp"

#include <azure/attestation.hpp>
#include <azure/core/base64.hpp>

#include <chrono>
#include <iostream>
#include <thread>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: MIT

#include "attestation_collateral.hpp"

#include <azure/core/base64.hpp>

// cspell:disable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include <azure/attestation.hpp>
#include <azure/identity.hpp>

#include <chrono>
#include <iostream>
#include <memory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <get_env.hpp>

#include <azure/attestation.hpp>

#include <chrono>
#include <iostream>
#include <thread>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <get_env.hpp>

#include "cryptohelpers.hpp"

#include <azure/attestation.hpp>
#include <azure/identity.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
#include <algorithm>
#include <cstring>
#include <memory>
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
#include <openssl/x509.h>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>

#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
#include <openssl/x509.h>
/**
* @brief The Cryptography class provides a set of basic cryptographic primatives required
* by the attestation samples.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <get_env.hpp>

#include "cryptohelpers.hpp"

#include <azure/attestation.hpp>
#include <azure/identity.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
#include <get_env.hpp>

#include "cryptohelpers.hpp"

#include <azure/attestation.hpp>
#include <azure/core/base64.hpp>
#include <azure/core/cryptography/hash.hpp>
#include <azure/core/internal/cryptography/sha_hash.hpp>
#include <azure/identity.hpp>

#include <chrono>
#include <iomanip>
#include <iostream>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <azure/core/cryptography/hash.hpp>
#include <azure/core/internal/cryptography/sha_hash.hpp>
#include <azure/identity.hpp>

#include <chrono>
#include <iomanip>
#include <iostream>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
#include <get_env.hpp>

#include "cryptohelpers.hpp"

#include <azure/attestation.hpp>
#include <azure/core/base64.hpp>
#include <azure/core/cryptography/hash.hpp>
#include <azure/core/internal/cryptography/sha_hash.hpp>
#include <azure/identity.hpp>

#include <cassert>
#include <chrono>
#include <iomanip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
// SPDX-License-Identifier: MIT

#include "azure/attestation/attestation_administration_client.hpp"

#include "azure/attestation/attestation_client.hpp"
#include "private/attestation_client_models_private.hpp"
#include "private/attestation_client_private.hpp"
#include "private/attestation_common_request.hpp"
#include "private/attestation_deserializers_private.hpp"
#include "private/package_version.hpp"

#include <azure/core/base64.hpp>
#include <azure/core/http/policies/policy.hpp>
#include <azure/core/internal/diagnostics/log.hpp>
#include <azure/core/internal/http/pipeline.hpp>
#include <shared_mutex>

#include <shared_mutex>
#include <string>

// cspell: words jwks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
// SPDX-License-Identifier: MIT

#include "azure/attestation/attestation_client.hpp"

#include "azure/attestation/attestation_administration_client.hpp"
#include "private/attestation_client_models_private.hpp"
#include "private/attestation_client_private.hpp"
#include "private/attestation_common_request.hpp"
#include "private/attestation_deserializers_private.hpp"
#include "private/package_version.hpp"

#include <azure/core/base64.hpp>
#include <azure/core/credentials/credentials.hpp>
#include <azure/core/http/policies/policy.hpp>
#include <azure/core/internal/diagnostics/log.hpp>
#include <azure/core/internal/http/pipeline.hpp>
#include <shared_mutex>

#include <shared_mutex>
#include <string>

using namespace Azure::Security::Attestation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

#include "azure/attestation/attestation_client_models.hpp"
#include "azure/attestation/attestation_client_options.hpp"

#include <azure/core/nullable.hpp>

#include <memory>
#include <string>
#include <vector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
*/
#include "attestation_client_models_private.hpp"
#include "crypto/inc/crypto.hpp"

#include <azure/core/internal/json/json.hpp>

#include <chrono>
#include <memory>
#include <sstream>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
#include "azure/attestation/attestation_client_options.hpp"
#include "crypto/inc/crypto.hpp"
#include "jsonhelpers_private.hpp"

#include <azure/core/base64.hpp>
#include <azure/core/diagnostics/logger.hpp>
#include <azure/core/internal/json/json.hpp>
#include <azure/core/internal/json/json_optional.hpp>

#include <chrono>
#include <memory>
#include <sstream>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
// SPDX-License-Identifier: MIT

#include "attestation_common_request.hpp"

#include <azure/core/exception.hpp>
#include <azure/core/http/http.hpp>

#include <memory>

using namespace Azure::Security::Attestation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <azure/core/http/http.hpp>
#include <azure/core/internal/http/pipeline.hpp>

#include <memory>
#include <string>
#include <vector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
*/

#include "attestation_deserializers_private.hpp"

#include "attestation_client_models_private.hpp"
#include "attestation_client_private.hpp"
#include "azure/attestation/attestation_client_models.hpp"
#include "jsonhelpers_private.hpp"

#include <azure/core/base64.hpp>
#include <azure/core/context.hpp>
#include <azure/core/http/http.hpp>
Expand All @@ -25,6 +27,7 @@
#include <azure/core/internal/json/json_serializable.hpp>
#include <azure/core/nullable.hpp>
#include <azure/core/response.hpp>

#include <memory>
#include <string>
#include <vector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
#include "attestation_client_models_private.hpp"
#include "azure/attestation/attestation_client.hpp"
#include "azure/attestation/attestation_client_models.hpp"

#include <azure/core/internal/json/json.hpp>

#include <memory>
#include <string>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
#pragma once

#include <memory>
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <stdexcept>
#include <type_traits>
#include <utility>

#include <openssl/bio.h>
#include <openssl/evp.h>

namespace Azure { namespace Security { namespace Attestation { namespace _detail {

// Helpers to provide RAII wrappers for OpenSSL types.
Expand Down
Loading