diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9c8d353ac..8363dc979 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,6 +57,7 @@ CMake version 3.13 or higher is required to build these libraries. Download and #### Third Party Dependencies - curl - libxml2 +- clang-format (min version 9) Vcpkg can be used to install the Azure SDK for CPP dependencies into a specific folder on the system instead of globally installing them. Follow [vcpkg install guide](https://github.com/microsoft/vcpkg#getting-started) to get vcpkg and install the following dependencies: diff --git a/sdk/core/azure-core/inc/azure/core/http/http.hpp b/sdk/core/azure-core/inc/azure/core/http/http.hpp index ec4256795..a6aa830d2 100644 --- a/sdk/core/azure-core/inc/azure/core/http/http.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/http.hpp @@ -508,10 +508,10 @@ namespace Azure { namespace Core { namespace Http { */ explicit Request(HttpMethod httpMethod, Url url, bool downloadViaStream) : Request( - httpMethod, - std::move(url), - NullBodyStream::GetNullBodyStream(), - downloadViaStream) + httpMethod, + std::move(url), + NullBodyStream::GetNullBodyStream(), + downloadViaStream) { } diff --git a/sdk/core/azure-core/inc/azure/core/nullable.hpp b/sdk/core/azure-core/inc/azure/core/nullable.hpp index 3aab11ebc..0e5e64cdb 100644 --- a/sdk/core/azure-core/inc/azure/core/nullable.hpp +++ b/sdk/core/azure-core/inc/azure/core/nullable.hpp @@ -48,7 +48,9 @@ namespace Azure { namespace Core { * @param initialValue A non-absent value to initialize with. */ constexpr Nullable(T initialValue) noexcept(std::is_nothrow_move_constructible::value) - : m_value(std::move(initialValue)), m_hasValue(true) {} + : m_value(std::move(initialValue)), m_hasValue(true) + { + } /// Copy constructor. Nullable(const Nullable& other) noexcept(std::is_nothrow_copy_constructible::value) diff --git a/sdk/core/azure-core/inc/azure/core/response.hpp b/sdk/core/azure-core/inc/azure/core/response.hpp index b74830950..2389164e7 100644 --- a/sdk/core/azure-core/inc/azure/core/response.hpp +++ b/sdk/core/azure-core/inc/azure/core/response.hpp @@ -57,44 +57,35 @@ namespace Azure { namespace Core { * * @return `true` If a value is contained, `false` if value is absent. */ - bool HasValue() const noexcept { - return this->m_value.HasValue(); - } + bool HasValue() const noexcept { return this->m_value.HasValue(); } /** * @brief Get a pointer to a value of a specific type. */ - const T* operator->() const { + const T* operator->() const + { return &this->m_value.GetValue(); // GetValue ensures there is a contained value } /** * @brief Get a pointer to a value of a specific type. */ - T* operator->() { - return &this->m_value.GetValue(); - } + T* operator->() { return &this->m_value.GetValue(); } /** * @brief Get value of a specific type. */ - T& operator*() { - return this->m_value.GetValue(); - } + T& operator*() { return this->m_value.GetValue(); } /** * @brief Get value of a specific type. */ - const T& operator*() const { - return this->m_value.GetValue(); - } + const T& operator*() const { return this->m_value.GetValue(); } /** * @brief Get an rvalue reference to the value of a specific type. */ - T&& ExtractValue() { - return std::move(this->m_value).GetValue(); - } + T&& ExtractValue() { return std::move(this->m_value).GetValue(); } /** * @brief Get a smart pointer rvalue reference to the value of a specific type. diff --git a/sdk/core/azure-core/inc/azure/core/version.hpp b/sdk/core/azure-core/inc/azure/core/version.hpp index 3e1b55e3d..4cc8b6ba6 100644 --- a/sdk/core/azure-core/inc/azure/core/version.hpp +++ b/sdk/core/azure-core/inc/azure/core/version.hpp @@ -52,4 +52,3 @@ namespace Azure { namespace Core { #undef AZURE_CORE_VERSION_MINOR #undef AZURE_CORE_VERSION_PATCH #undef AZURE_CORE_VERSION_PRERELEASE - diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 9364fd2c3..316a040cd 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -341,13 +341,11 @@ CURLcode CurlConnection::SendBuffer( switch (sendResult) { - case CURLE_OK: - { + case CURLE_OK: { sentBytesTotal += sentBytesPerRequest; break; } - case CURLE_AGAIN: - { + case CURLE_AGAIN: { // start polling operation with 1 min timeout auto pollUntilSocketIsReady = pollSocketUntilEventOrTimeout( context, m_curlSocket, PollSocketDirection::Write, 60000L); @@ -364,8 +362,7 @@ CURLcode CurlConnection::SendBuffer( // Ready to continue download. break; } - default: - { + default: { return sendResult; } } @@ -721,8 +718,7 @@ int64_t CurlConnection::ReadFromSocket(Context const& context, uint8_t* buffer, switch (readResult) { - case CURLE_AGAIN: - { + case CURLE_AGAIN: { // start polling operation auto pollUntilSocketIsReady = pollSocketUntilEventOrTimeout( context, m_curlSocket, PollSocketDirection::Read, 60000L); @@ -739,12 +735,10 @@ int64_t CurlConnection::ReadFromSocket(Context const& context, uint8_t* buffer, // Ready to continue download. break; } - case CURLE_OK: - { + case CURLE_OK: { break; } - default: - { + default: { // Error reading from socket throw TransportException( "Error while reading from network socket. CURLE code: " + std::to_string(readResult) diff --git a/sdk/core/azure-core/test/e2e/azure_core_with_curl_bodyStream.cpp b/sdk/core/azure-core/test/e2e/azure_core_with_curl_bodyStream.cpp index a973a45c4..82252c5f8 100644 --- a/sdk/core/azure-core/test/e2e/azure_core_with_curl_bodyStream.cpp +++ b/sdk/core/azure-core/test/e2e/azure_core_with_curl_bodyStream.cpp @@ -165,7 +165,7 @@ void printStream(Context const& context, std::unique_ptr resp } cout << static_cast::type>( - response->GetStatusCode()) + response->GetStatusCode()) << endl; cout << response->GetReasonPhrase() << endl; cout << "headers:" << endl; diff --git a/sdk/core/azure-core/test/ut/logging.cpp b/sdk/core/azure-core/test/ut/logging.cpp index 61e532c6b..5462f82b7 100644 --- a/sdk/core/azure-core/test/ut/logging.cpp +++ b/sdk/core/azure-core/test/ut/logging.cpp @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // SPDX-License-Identifier: MIT -#include #include #include #include +#include #include #include diff --git a/sdk/core/azure-core/test/ut/nullable.cpp b/sdk/core/azure-core/test/ut/nullable.cpp index 739c7d9f8..1d87ec505 100644 --- a/sdk/core/azure-core/test/ut/nullable.cpp +++ b/sdk/core/azure-core/test/ut/nullable.cpp @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // SPDX-License-Identifier: MIT -#include #include +#include #include #include @@ -123,13 +123,13 @@ TEST(Nullable, Swap) TEST(Nullable, CopyConstruction) { - //Empty + // Empty Nullable val1; Nullable val2(val1); EXPECT_FALSE(val1); EXPECT_FALSE(val2); - //Non-Empty + // Non-Empty Nullable val3(12345); Nullable val4(val3); EXPECT_TRUE(val3); @@ -137,22 +137,21 @@ TEST(Nullable, CopyConstruction) EXPECT_TRUE(val3.GetValue() == 12345); EXPECT_TRUE(val4.GetValue() == 12345); - //Literal + // Literal Nullable val5 = 54321; EXPECT_TRUE(val5); EXPECT_TRUE(val5.GetValue() == 54321); - //Value + // Value const int i = 1; Nullable val6(i); EXPECT_TRUE(val6); EXPECT_TRUE(val6.GetValue() == 1); - } TEST(Nullable, Disengage) { - Nullable val1(12345); + Nullable val1(12345); val1.Reset(); EXPECT_FALSE(val1); } @@ -170,7 +169,5 @@ TEST(Nullable, ValueOr) EXPECT_FALSE(val2); EXPECT_TRUE(val2.ValueOr(678910) == 678910); // Ensure val2 is still disengaged after call to ValueOr - EXPECT_FALSE(val2); - + EXPECT_FALSE(val2); } - diff --git a/sdk/core/azure-core/test/ut/operation.cpp b/sdk/core/azure-core/test/ut/operation.cpp index eee65274a..2341221e5 100644 --- a/sdk/core/azure-core/test/ut/operation.cpp +++ b/sdk/core/azure-core/test/ut/operation.cpp @@ -23,7 +23,7 @@ TEST(Operation, Poll) EXPECT_FALSE(operation.IsDone()); EXPECT_FALSE(operation.HasValue()); - while(!operation.IsDone()) + while (!operation.IsDone()) { EXPECT_FALSE(operation.HasValue()); EXPECT_THROW(operation.Value(), std::runtime_error); @@ -45,12 +45,12 @@ TEST(Operation, PollUntilDone) EXPECT_FALSE(operation.IsDone()); EXPECT_FALSE(operation.HasValue()); EXPECT_THROW(operation.Value(), std::runtime_error); - + auto start = std::chrono::high_resolution_clock::now(); auto response = operation.PollUntilDone(500ms); auto end = std::chrono::high_resolution_clock::now(); std::chrono::duration elapsed = end - start; - //StringOperation test code is implemented to poll 2 times + // StringOperation test code is implemented to poll 2 times EXPECT_TRUE(elapsed >= 1s); EXPECT_TRUE(operation.IsDone()); diff --git a/sdk/core/azure-core/test/ut/pipeline.cpp b/sdk/core/azure-core/test/ut/pipeline.cpp index 2018c08b1..b889a0b34 100644 --- a/sdk/core/azure-core/test/ut/pipeline.cpp +++ b/sdk/core/azure-core/test/ut/pipeline.cpp @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // SPDX-License-Identifier: MIT -#include #include #include +#include #include diff --git a/sdk/core/azure-core/test/ut/policy.cpp b/sdk/core/azure-core/test/ut/policy.cpp index 4855f6da2..b037da963 100644 --- a/sdk/core/azure-core/test/ut/policy.cpp +++ b/sdk/core/azure-core/test/ut/policy.cpp @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // SPDX-License-Identifier: MIT -#include #include #include +#include #include diff --git a/sdk/core/azure-core/test/ut/simplified_header.cpp b/sdk/core/azure-core/test/ut/simplified_header.cpp index 733594442..36a010838 100644 --- a/sdk/core/azure-core/test/ut/simplified_header.cpp +++ b/sdk/core/azure-core/test/ut/simplified_header.cpp @@ -8,8 +8,8 @@ * */ -#include #include +#include #include diff --git a/sdk/core/azure-core/test/ut/telemetry_policy.cpp b/sdk/core/azure-core/test/ut/telemetry_policy.cpp index 7aa11ba0a..98b5e40a6 100644 --- a/sdk/core/azure-core/test/ut/telemetry_policy.cpp +++ b/sdk/core/azure-core/test/ut/telemetry_policy.cpp @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // SPDX-License-Identifier: MIT -#include #include #include +#include using namespace Azure::Core; using namespace Azure::Core::Http; diff --git a/sdk/core/azure-core/test/ut/transport_adapter_base.hpp b/sdk/core/azure-core/test/ut/transport_adapter_base.hpp index a4efa7848..803011996 100644 --- a/sdk/core/azure-core/test/ut/transport_adapter_base.hpp +++ b/sdk/core/azure-core/test/ut/transport_adapter_base.hpp @@ -9,10 +9,10 @@ * */ -#include #include #include #include +#include #include #include diff --git a/sdk/core/azure-core/test/ut/uuid.cpp b/sdk/core/azure-core/test/ut/uuid.cpp index 63ac40887..a94e0d9e7 100644 --- a/sdk/core/azure-core/test/ut/uuid.cpp +++ b/sdk/core/azure-core/test/ut/uuid.cpp @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // SPDX-License-Identifier: MIT -#include #include -#include +#include #include +#include using namespace Azure::Core; @@ -14,14 +14,14 @@ TEST(Uuid, Basic) EXPECT_TRUE(uuid.GetUuidString().length() == 36); } -TEST(Uuid, Randomness) -{ +TEST(Uuid, Randomness) +{ const int size = 100000; std::set uuids; for (int i = 0; i < size; i++) { auto ret = uuids.insert(Uuid::CreateUuid().GetUuidString()); - //If the value already exists in the set then the insert will fail + // If the value already exists in the set then the insert will fail // ret.second == false means the insert failed. EXPECT_TRUE(ret.second); } diff --git a/sdk/identity/azure-identity/inc/azure/identity/version.hpp b/sdk/identity/azure-identity/inc/azure/identity/version.hpp index 2d32b1504..e33961de0 100644 --- a/sdk/identity/azure-identity/inc/azure/identity/version.hpp +++ b/sdk/identity/azure-identity/inc/azure/identity/version.hpp @@ -52,4 +52,3 @@ namespace Azure { namespace Identity { #undef AZURE_IDENTITY_VERSION_MINOR #undef AZURE_IDENTITY_VERSION_PATCH #undef AZURE_IDENTITY_VERSION_PRERELEASE - diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/protocol/blob_rest_client.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/protocol/blob_rest_client.hpp index 75f1a44eb..7b95b2ac8 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/protocol/blob_rest_client.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/protocol/blob_rest_client.hpp @@ -3332,8 +3332,8 @@ namespace Azure { namespace Storage { namespace Blobs { Storage::Details::XmlWriter& writer, const SetServicePropertiesOptions& options) { - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "StorageServiceProperties"}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "StorageServiceProperties"}); BlobServicePropertiesToXml(writer, options.Properties); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); } @@ -3362,16 +3362,16 @@ namespace Azure { namespace Storage { namespace Blobs { writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); if (options.DefaultServiceVersion.HasValue()) { - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "DefaultServiceVersion"}); - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::Text, - nullptr, - options.DefaultServiceVersion.GetValue().data()}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "DefaultServiceVersion"}); + writer.Write( + Storage::Details::XmlNode{Storage::Details::XmlNodeType::Text, + nullptr, + options.DefaultServiceVersion.GetValue().data()}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); } - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "DeleteRetentionPolicy"}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "DeleteRetentionPolicy"}); BlobRetentionPolicyToXml(writer, options.DeleteRetentionPolicy); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); writer.Write( @@ -3402,8 +3402,8 @@ namespace Azure { namespace Storage { namespace Blobs { writer.Write(Storage::Details::XmlNode{ Storage::Details::XmlNodeType::Text, nullptr, options.Write ? "true" : "false"}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "RetentionPolicy"}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "RetentionPolicy"}); BlobRetentionPolicyToXml(writer, options.RetentionPolicy); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); } @@ -3434,12 +3434,11 @@ namespace Azure { namespace Storage { namespace Blobs { writer.Write(Storage::Details::XmlNode{ Storage::Details::XmlNodeType::Text, nullptr, options.ExposedHeaders.data()}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "MaxAgeInSeconds"}); - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::Text, - nullptr, - std::to_string(options.MaxAgeInSeconds).data()}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "MaxAgeInSeconds"}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::Text, + nullptr, + std::to_string(options.MaxAgeInSeconds).data()}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); } @@ -3462,14 +3461,14 @@ namespace Azure { namespace Storage { namespace Blobs { { writer.Write( Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, "IncludeAPIs"}); - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::Text, - nullptr, - options.IncludeApis.GetValue() ? "true" : "false"}); + writer.Write( + Storage::Details::XmlNode{Storage::Details::XmlNodeType::Text, + nullptr, + options.IncludeApis.GetValue() ? "true" : "false"}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); } - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "RetentionPolicy"}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "RetentionPolicy"}); BlobRetentionPolicyToXml(writer, options.RetentionPolicy); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); } @@ -3487,10 +3486,9 @@ namespace Azure { namespace Storage { namespace Blobs { { writer.Write( Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, "Days"}); - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::Text, - nullptr, - std::to_string(options.Days.GetValue()).data()}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::Text, + nullptr, + std::to_string(options.Days.GetValue()).data()}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); } } @@ -3506,32 +3504,30 @@ namespace Azure { namespace Storage { namespace Blobs { writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); if (options.IndexDocument.HasValue()) { - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "IndexDocument"}); - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::Text, - nullptr, - options.IndexDocument.GetValue().data()}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "IndexDocument"}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::Text, + nullptr, + options.IndexDocument.GetValue().data()}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); } if (options.DefaultIndexDocumentPath.HasValue()) { - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "DefaultIndexDocumentPath"}); - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::Text, - nullptr, - options.DefaultIndexDocumentPath.GetValue().data()}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "DefaultIndexDocumentPath"}); + writer.Write( + Storage::Details::XmlNode{Storage::Details::XmlNodeType::Text, + nullptr, + options.DefaultIndexDocumentPath.GetValue().data()}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); } if (options.ErrorDocument404Path.HasValue()) { - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "ErrorDocument404Path"}); - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::Text, - nullptr, - options.ErrorDocument404Path.GetValue().data()}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "ErrorDocument404Path"}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::Text, + nullptr, + options.ErrorDocument404Path.GetValue().data()}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); } } @@ -5216,8 +5212,8 @@ namespace Azure { namespace Storage { namespace Blobs { Storage::Details::XmlWriter& writer, const SetBlobContainerAccessPolicyOptions& options) { - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "SignedIdentifiers"}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "SignedIdentifiers"}); for (const auto& i : options.SignedIdentifiers) { BlobSignedIdentifierToXml(writer, i); @@ -5229,8 +5225,8 @@ namespace Azure { namespace Storage { namespace Blobs { Storage::Details::XmlWriter& writer, const BlobSignedIdentifier& options) { - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "SignedIdentifier"}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "SignedIdentifier"}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, "Id"}); writer.Write(Storage::Details::XmlNode{ Storage::Details::XmlNodeType::Text, nullptr, options.Id.data()}); @@ -7915,10 +7911,9 @@ namespace Azure { namespace Storage { namespace Blobs { Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, "BlockList"}); for (const auto& i : options.BlockList) { - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, - BlockTypeToString(i.first).data(), - i.second.data()}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + BlockTypeToString(i.first).data(), + i.second.data()}); } writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); } diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/version.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/version.hpp index 74e6209d0..aa7f9e986 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/version.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/version.hpp @@ -59,4 +59,3 @@ namespace Azure { namespace Storage { namespace Blobs { #undef AZURE_STORAGE_BLOBS_VERSION_MINOR #undef AZURE_STORAGE_BLOBS_VERSION_PATCH #undef AZURE_STORAGE_BLOBS_VERSION_PRERELEASE - diff --git a/sdk/storage/azure-storage-blobs/src/blob_service_client.cpp b/sdk/storage/azure-storage-blobs/src/blob_service_client.cpp index ba21b5009..46cfd53ca 100644 --- a/sdk/storage/azure-storage-blobs/src/blob_service_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/blob_service_client.cpp @@ -44,7 +44,8 @@ namespace Azure { namespace Storage { namespace Blobs { { policies.emplace_back(p->Clone()); } - policies.emplace_back(std::make_unique(options.RetryOptions)); + policies.emplace_back( + std::make_unique(options.RetryOptions)); for (const auto& p : options.PerRetryPolicies) { policies.emplace_back(p->Clone()); diff --git a/sdk/storage/azure-storage-blobs/test/blob_sas_test.cpp b/sdk/storage/azure-storage-blobs/test/blob_sas_test.cpp index a2682d5b7..feb0e1d9b 100644 --- a/sdk/storage/azure-storage-blobs/test/blob_sas_test.cpp +++ b/sdk/storage/azure-storage-blobs/test/blob_sas_test.cpp @@ -167,15 +167,14 @@ namespace Azure { namespace Storage { namespace Test { } } - for (auto permissions : - {Sas::BlobSasPermissions::All, - Sas::BlobSasPermissions::Read, - Sas::BlobSasPermissions::Write, - Sas::BlobSasPermissions::Delete, - Sas::BlobSasPermissions::Add, - Sas::BlobSasPermissions::Create, - Sas::BlobSasPermissions::Tags, - Sas::BlobSasPermissions::DeleteVersion}) + for (auto permissions : {Sas::BlobSasPermissions::All, + Sas::BlobSasPermissions::Read, + Sas::BlobSasPermissions::Write, + Sas::BlobSasPermissions::Delete, + Sas::BlobSasPermissions::Add, + Sas::BlobSasPermissions::Create, + Sas::BlobSasPermissions::Tags, + Sas::BlobSasPermissions::DeleteVersion}) { blobSasBuilder.SetPermissions(permissions); auto sasToken = blobSasBuilder.GenerateSasToken(*keyCredential); @@ -267,15 +266,14 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_NO_THROW(serviceClient.ListBlobContainersSegment()); } - for (auto permissions : - {Sas::BlobContainerSasPermissions::All, - Sas::BlobContainerSasPermissions::Read, - Sas::BlobContainerSasPermissions::Write, - Sas::BlobContainerSasPermissions::Delete, - Sas::BlobContainerSasPermissions::List, - Sas::BlobContainerSasPermissions::Add, - Sas::BlobContainerSasPermissions::Create, - Sas::BlobContainerSasPermissions::Tags}) + for (auto permissions : {Sas::BlobContainerSasPermissions::All, + Sas::BlobContainerSasPermissions::Read, + Sas::BlobContainerSasPermissions::Write, + Sas::BlobContainerSasPermissions::Delete, + Sas::BlobContainerSasPermissions::List, + Sas::BlobContainerSasPermissions::Add, + Sas::BlobContainerSasPermissions::Create, + Sas::BlobContainerSasPermissions::Tags}) { containerSasBuilder.SetPermissions(permissions); auto sasToken = containerSasBuilder.GenerateSasToken(*keyCredential); diff --git a/sdk/storage/azure-storage-common/inc/azure/storage/common/version.hpp b/sdk/storage/azure-storage-common/inc/azure/storage/common/version.hpp index e2f01850a..8ded12e1a 100644 --- a/sdk/storage/azure-storage-common/inc/azure/storage/common/version.hpp +++ b/sdk/storage/azure-storage-common/inc/azure/storage/common/version.hpp @@ -59,4 +59,3 @@ namespace Azure { namespace Storage { namespace Common { #undef AZURE_STORAGE_COMMON_VERSION_MINOR #undef AZURE_STORAGE_COMMON_VERSION_PATCH #undef AZURE_STORAGE_COMMON_VERSION_PRERELEASE - diff --git a/sdk/storage/azure-storage-common/src/account_sas_builder.cpp b/sdk/storage/azure-storage-common/src/account_sas_builder.cpp index cd2c9ea2b..070e58261 100644 --- a/sdk/storage/azure-storage-common/src/account_sas_builder.cpp +++ b/sdk/storage/azure-storage-common/src/account_sas_builder.cpp @@ -94,8 +94,8 @@ namespace Azure { namespace Storage { namespace Sas { + "\n" + (IPRange.HasValue() ? IPRange.GetValue() : "") + "\n" + protocol + "\n" + Storage::Details::DefaultSasVersion + "\n"; - std::string signature - = Base64Encode(Storage::Details::HmacSha256(stringToSign, Base64Decode(credential.GetAccountKey()))); + std::string signature = Base64Encode( + Storage::Details::HmacSha256(stringToSign, Base64Decode(credential.GetAccountKey()))); Azure::Core::Http::Url builder; builder.AppendQueryParameter( diff --git a/sdk/storage/azure-storage-common/src/crypt.cpp b/sdk/storage/azure-storage-common/src/crypt.cpp index ba31183fa..d8f61d07e 100644 --- a/sdk/storage/azure-storage-common/src/crypt.cpp +++ b/sdk/storage/azure-storage-common/src/crypt.cpp @@ -2,13 +2,16 @@ // SPDX-License-Identifier: MIT #include + #include "azure/storage/common/crypt.hpp" #if defined(AZ_PLATFORM_WINDOWS) #if !defined(NOMINMAX) #define NOMINMAX #endif +// Windows needs to go before bcrypt #include + #include #elif defined(AZ_PLATFORM_POSIX) #include diff --git a/sdk/storage/azure-storage-common/src/file_io.cpp b/sdk/storage/azure-storage-common/src/file_io.cpp index ca94a8b1b..daa0bb5d5 100644 --- a/sdk/storage/azure-storage-common/src/file_io.cpp +++ b/sdk/storage/azure-storage-common/src/file_io.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: MIT #include + #include "azure/storage/common/file_io.hpp" #if defined(AZ_PLATFORM_POSIX) diff --git a/sdk/storage/azure-storage-common/src/shared_key_policy.cpp b/sdk/storage/azure-storage-common/src/shared_key_policy.cpp index 28257fdb2..20f4aa0c4 100644 --- a/sdk/storage/azure-storage-common/src/shared_key_policy.cpp +++ b/sdk/storage/azure-storage-common/src/shared_key_policy.cpp @@ -18,18 +18,17 @@ namespace Azure { namespace Storage { namespace Details { string_to_sign += Azure::Core::Http::HttpMethodToString(request.GetMethod()) + "\n"; const auto& headers = request.GetHeaders(); - for (std::string headerName : - {"Content-Encoding", - "Content-Language", - "Content-Length", - "Content-MD5", - "Content-Type", - "Date", - "If-Modified-Since", - "If-Match", - "If-None-Match", - "If-Unmodified-Since", - "Range"}) + for (std::string headerName : {"Content-Encoding", + "Content-Language", + "Content-Length", + "Content-MD5", + "Content-Type", + "Date", + "If-Modified-Since", + "If-Match", + "If-None-Match", + "If-Unmodified-Since", + "Range"}) { auto ite = headers.find(Azure::Core::Strings::ToLower(headerName)); if (ite != headers.end()) diff --git a/sdk/storage/azure-storage-common/src/storage_per_retry_policy.cpp b/sdk/storage/azure-storage-common/src/storage_per_retry_policy.cpp index 59ceb23f9..bce9341e9 100644 --- a/sdk/storage/azure-storage-common/src/storage_per_retry_policy.cpp +++ b/sdk/storage/azure-storage-common/src/storage_per_retry_policy.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: MIT #include + #include "azure/storage/common/storage_per_retry_policy.hpp" #include diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_utilities.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_utilities.hpp index fd5419519..4e1213acd 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_utilities.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_utilities.hpp @@ -8,7 +8,7 @@ #include #include -namespace Azure { namespace Storage{ namespace Files { namespace DataLake { namespace Details { +namespace Azure { namespace Storage { namespace Files { namespace DataLake { namespace Details { std::string GetBlobUriFromUri(const std::string& uri); std::string GetDfsUriFromUri(const std::string& uri); diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/version.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/version.hpp index 3ddb0fe73..8b63d1d51 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/version.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/version.hpp @@ -59,4 +59,3 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { #undef AZURE_STORAGE_FILES_DATALAKE_VERSION_MINOR #undef AZURE_STORAGE_FILES_DATALAKE_VERSION_PATCH #undef AZURE_STORAGE_FILES_DATALAKE_VERSION_PRERELEASE - diff --git a/sdk/storage/azure-storage-files-datalake/test/datalake_file_system_client_test.cpp b/sdk/storage/azure-storage-files-datalake/test/datalake_file_system_client_test.cpp index 9dcb162b2..0fc3f4377 100644 --- a/sdk/storage/azure-storage-files-datalake/test/datalake_file_system_client_test.cpp +++ b/sdk/storage/azure-storage-files-datalake/test/datalake_file_system_client_test.cpp @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // SPDX-License-Identifier: MIT -#include "azure/identity/client_secret_credential.hpp" #include "datalake_file_system_client_test.hpp" +#include "azure/identity/client_secret_credential.hpp" #include "azure/storage/common/crypt.hpp" #include "azure/storage/files/datalake/datalake_options.hpp" diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/protocol/share_rest_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/protocol/share_rest_client.hpp index 3031684b4..5f065bdde 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/protocol/share_rest_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/protocol/share_rest_client.hpp @@ -1371,10 +1371,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { writer.Write( Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, "Days"}); - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::Text, - nullptr, - std::to_string(object.Days.GetValue()).data()}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::Text, + nullptr, + std::to_string(object.Days.GetValue()).data()}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); } } @@ -1395,14 +1394,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { writer.Write( Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, "IncludeAPIs"}); - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::Text, - nullptr, - object.IncludeApis.GetValue() ? "true" : "false"}); + writer.Write( + Storage::Details::XmlNode{Storage::Details::XmlNodeType::Text, + nullptr, + object.IncludeApis.GetValue() ? "true" : "false"}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); } - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "RetentionPolicy"}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "RetentionPolicy"}); ShareRetentionPolicyToXml(writer, object.RetentionPolicy); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); } @@ -1433,12 +1432,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { writer.Write(Storage::Details::XmlNode{ Storage::Details::XmlNodeType::Text, nullptr, object.ExposedHeaders.data()}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "MaxAgeInSeconds"}); - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::Text, - nullptr, - std::to_string(object.MaxAgeInSeconds).data()}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "MaxAgeInSeconds"}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::Text, + nullptr, + std::to_string(object.MaxAgeInSeconds).data()}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); } @@ -1470,8 +1468,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Storage::Details::XmlWriter& writer, const Models::ShareProtocolSettings& object) { - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "ProtocolSettings"}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "ProtocolSettings"}); SmbSettingsToXml(writer, object.Settings); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::EndTag}); } @@ -1480,8 +1478,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Storage::Details::XmlWriter& writer, const Models::StorageServiceProperties& object) { - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "StorageServiceProperties"}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "StorageServiceProperties"}); writer.Write( Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, "HourMetrics"}); MetricsToXml(writer, object.HourMetrics); @@ -4149,8 +4147,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Storage::Details::XmlWriter& writer, const Models::SignedIdentifier& object) { - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "SignedIdentifier"}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "SignedIdentifier"}); writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, "Id"}); writer.Write(Storage::Details::XmlNode{ Storage::Details::XmlNodeType::Text, nullptr, object.Id.data()}); @@ -4163,8 +4161,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Storage::Details::XmlWriter& writer, const std::vector& object) { - writer.Write(Storage::Details::XmlNode{ - Storage::Details::XmlNodeType::StartTag, "SignedIdentifiers"}); + writer.Write(Storage::Details::XmlNode{Storage::Details::XmlNodeType::StartTag, + "SignedIdentifiers"}); for (const auto& item : object) { SignedIdentifierToXml(writer, item); diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_client.hpp index ed9a95a51..0b22d25a0 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_client.hpp @@ -72,7 +72,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { ShareClient WithSnapshot(const std::string& snapshot) const; /** - * @brief Gets the ShareDirectoryClient that's pointing to the root directory of current ShareClient + * @brief Gets the ShareDirectoryClient that's pointing to the root directory of current + * ShareClient * @return ShareDirectoryClient The root directory of the share. */ ShareDirectoryClient GetRootShareDirectoryClient() const; diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_directory_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_directory_client.hpp index 9c3a22e3e..14ecfa237 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_directory_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_directory_client.hpp @@ -47,8 +47,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const ShareClientOptions& options = ShareClientOptions()); /** - * @brief Initialize a new instance of ShareDirectoryClient using anonymous access or shared access - * signature. + * @brief Initialize a new instance of ShareDirectoryClient using anonymous access or shared + * access signature. * @param shareDirectoryUri The URI of the directory this client's request targets. * @param options Optional parameters used to initialize the client. */ @@ -64,7 +64,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string GetUri() const { return m_shareDirectoryUri.GetAbsoluteUrl(); } /** - * @brief Create a ShareDirectoryClient that's a sub directory of the current ShareDirectoryClient + * @brief Create a ShareDirectoryClient that's a sub directory of the current + * ShareDirectoryClient * @param subDirectoryName The name of the subdirectory. * @return ShareDirectoryClient A directory client that can be used to manage a share directory * resource. diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_sas_builder.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_sas_builder.hpp index fce822db6..e0840599a 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_sas_builder.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_sas_builder.hpp @@ -232,4 +232,4 @@ namespace Azure { namespace Storage { namespace Sas { std::string Permissions; }; -}}} // namespace Azure::Storage::Files::Shares +}}} // namespace Azure::Storage::Sas diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/version.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/version.hpp index 6797ceb57..e9335789e 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/version.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/version.hpp @@ -59,4 +59,3 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { #undef AZURE_STORAGE_FILES_SHARES_VERSION_MINOR #undef AZURE_STORAGE_FILES_SHARES_VERSION_PATCH #undef AZURE_STORAGE_FILES_SHARES_VERSION_PRERELEASE - diff --git a/sdk/storage/azure-storage-files-shares/src/share_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_client.cpp index 42d91bb99..1330ee8b1 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_client.cpp @@ -51,7 +51,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { policies.emplace_back(p->Clone()); } - policies.emplace_back(std::make_unique(options.RetryOptions)); + policies.emplace_back( + std::make_unique(options.RetryOptions)); for (const auto& p : options.PerRetryPolicies) { policies.emplace_back(p->Clone()); diff --git a/sdk/storage/azure-storage-files-shares/src/share_directory_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_directory_client.cpp index c3a1cb7b0..1e4c162b1 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_directory_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_directory_client.cpp @@ -90,7 +90,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { m_pipeline = std::make_shared(policies); } - ShareDirectoryClient ShareDirectoryClient::GetSubShareDirectoryClient(const std::string& subDirectoryName) const + ShareDirectoryClient ShareDirectoryClient::GetSubShareDirectoryClient( + const std::string& subDirectoryName) const { auto builder = m_shareDirectoryUri; builder.AppendPath(Storage::Details::UrlEncodePath(subDirectoryName)); @@ -104,7 +105,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { return ShareFileClient(builder, m_pipeline); } - ShareDirectoryClient ShareDirectoryClient::WithShareSnapshot(const std::string& shareSnapshot) const + ShareDirectoryClient ShareDirectoryClient::WithShareSnapshot( + const std::string& shareSnapshot) const { ShareDirectoryClient newClient(*this); if (shareSnapshot.empty()) @@ -272,7 +274,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::move(ret), result.ExtractRawResponse()); } - Azure::Core::Response ShareDirectoryClient::ForceCloseHandle( + Azure::Core::Response + ShareDirectoryClient::ForceCloseHandle( const std::string& handleId, const ForceCloseDirectoryHandleOptions& options) const { @@ -285,7 +288,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } Azure::Core::Response - ShareDirectoryClient::ForceCloseAllHandles(const ForceCloseAllDirectoryHandlesOptions& options) const + ShareDirectoryClient::ForceCloseAllHandles( + const ForceCloseAllDirectoryHandlesOptions& options) const { auto protocolLayerOptions = Details::ShareRestClient::Directory::ForceCloseHandlesOptions(); protocolLayerOptions.HandleId = c_FileAllHandles; diff --git a/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp index 06a3000a1..ad1cfc339 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp @@ -32,7 +32,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (parsedConnectionString.KeyCredential) { - return ShareFileClient(fileUri.GetAbsoluteUrl(), parsedConnectionString.KeyCredential, options); + return ShareFileClient( + fileUri.GetAbsoluteUrl(), parsedConnectionString.KeyCredential, options); } else { @@ -68,7 +69,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { m_pipeline = std::make_shared(policies); } - ShareFileClient::ShareFileClient(const std::string& shareFileUri, const ShareClientOptions& options) + ShareFileClient::ShareFileClient( + const std::string& shareFileUri, + const ShareClientOptions& options) : m_shareFileUri(shareFileUri) { std::vector> policies; @@ -486,8 +489,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Models::ForceCloseFileHandleResult(), result.ExtractRawResponse()); } - Azure::Core::Response ShareFileClient::ForceCloseAllHandles( - const ForceCloseAllFileHandlesOptions& options) const + Azure::Core::Response + ShareFileClient::ForceCloseAllHandles(const ForceCloseAllFileHandlesOptions& options) const { auto protocolLayerOptions = Details::ShareRestClient::File::ForceCloseHandlesOptions(); protocolLayerOptions.HandleId = c_FileAllHandles; diff --git a/sdk/storage/azure-storage-files-shares/test/share_file_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/share_file_client_test.cpp index 7875cbeb7..48b560b00 100644 --- a/sdk/storage/azure-storage-files-shares/test/share_file_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/share_file_client_test.cpp @@ -48,7 +48,8 @@ namespace Azure { namespace Storage { namespace Test { for (int32_t i = 0; i < 5; ++i) { auto fileName = RandomString(10); - Files::Shares::ShareFileClient client = m_fileShareDirectoryClient->GetShareFileClient(fileName); + Files::Shares::ShareFileClient client + = m_fileShareDirectoryClient->GetShareFileClient(fileName); EXPECT_NO_THROW(client.Create(1024)); fileClients.emplace_back(std::move(client)); } @@ -62,7 +63,8 @@ namespace Azure { namespace Storage { namespace Test { for (int32_t i = 0; i < 5; ++i) { auto fileName = RandomString(10); - Files::Shares::ShareFileClient client = m_fileShareDirectoryClient->GetShareFileClient(fileName); + Files::Shares::ShareFileClient client + = m_fileShareDirectoryClient->GetShareFileClient(fileName); EXPECT_NO_THROW(client.Create(1024)); EXPECT_NO_THROW(client.Create(1024)); } diff --git a/sdk/storage/azure-storage-files-shares/test/share_sas_test.cpp b/sdk/storage/azure-storage-files-shares/test/share_sas_test.cpp index c49527bc3..ab766097b 100644 --- a/sdk/storage/azure-storage-files-shares/test/share_sas_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/share_sas_test.cpp @@ -70,13 +70,12 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_NO_THROW(shareClient.ListFilesAndDirectoriesSegment()); }; - for (auto permissions : - {Sas::ShareSasPermissions::Read, - Sas::ShareSasPermissions::Write, - Sas::ShareSasPermissions::Delete, - Sas::ShareSasPermissions::List, - Sas::ShareSasPermissions::Create, - Sas::ShareSasPermissions::All}) + for (auto permissions : {Sas::ShareSasPermissions::Read, + Sas::ShareSasPermissions::Write, + Sas::ShareSasPermissions::Delete, + Sas::ShareSasPermissions::List, + Sas::ShareSasPermissions::Create, + Sas::ShareSasPermissions::All}) { shareSasBuilder.SetPermissions(permissions); auto sasToken = shareSasBuilder.GenerateSasToken(*keyCredential); @@ -103,11 +102,10 @@ namespace Azure { namespace Storage { namespace Test { } } - for (auto permissions : - {Sas::ShareFileSasPermissions::Read, - Sas::ShareFileSasPermissions::Write, - Sas::ShareFileSasPermissions::Delete, - Sas::ShareFileSasPermissions::Create}) + for (auto permissions : {Sas::ShareFileSasPermissions::Read, + Sas::ShareFileSasPermissions::Write, + Sas::ShareFileSasPermissions::Delete, + Sas::ShareFileSasPermissions::Create}) { fileSasBuilder.SetPermissions(permissions); auto sasToken = fileSasBuilder.GenerateSasToken(*keyCredential); diff --git a/sdk/template/azure-template/src/template_client.cpp b/sdk/template/azure-template/src/template_client.cpp index f7036672a..409e21d01 100644 --- a/sdk/template/azure-template/src/template_client.cpp +++ b/sdk/template/azure-template/src/template_client.cpp @@ -8,7 +8,4 @@ using namespace Azure::Template; -std::string const TemplateClient::ClientVersion() -{ - return Version::VersionString(); -} +std::string const TemplateClient::ClientVersion() { return Version::VersionString(); } diff --git a/sdk/template/azure-template/test/ut/template_test.cpp b/sdk/template/azure-template/test/ut/template_test.cpp index 53918116f..f31a36ea3 100644 --- a/sdk/template/azure-template/test/ut/template_test.cpp +++ b/sdk/template/azure-template/test/ut/template_test.cpp @@ -10,6 +10,6 @@ using namespace Azure::Template; TEST(Template, Basic) { TemplateClient templateClient; - + EXPECT_FALSE(templateClient.ClientVersion().empty()); }