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

Conversation

LarryOsterman
Copy link
Member

Define a standardized header layout for the Azure SDK for C++.

This pull request defines a standardized convention for headers in the C++ repo.

In the C++ repo, headers will be grouped according to the following scheme:

For the C++ SDK, I propose we define the following ordering:

  • P0: Main header.
  • P1: Azure headers from the current package (headers starting with ‘”’)..
  • P2: Azure headers from other packages
  • P3: Headers starting with azure (specifically headers from azure_uamqp_c and azure_c_shared_utility)
  • P4: C++ headers (‘<’ alphanumeric characters ‘>’)
  • P4: C headers (‘<’ alphanumeric characters ‘.h>) (note: same priority as C++ so they will be grouped together).

There are also some special cases defined to handle header ordering conflicts (windows.h needs to go before other headers, get_env.hpp needs to go before all other headers, there are several uAMQP headers that need to be reordered).

Note that There is essentially NO source code changes associated with this pull request, the only new code changes are in the .clang-format file. All the other changes are a consequence of re-running clang-format on the repo.

Pull Request Checklist

Please leverage this checklist as a reminder to address commonly occurring feedback when submitting a pull request to make sure your PR can be reviewed quickly:

See the detailed list in the contributing guide.

  • C++ Guidelines
  • Doxygen docs
  • Unit tests
  • No unwanted commits/changes
  • Descriptive title/description
    • PR is single purpose
    • Related issue listed
  • Comments in source
  • No typos
  • Update changelog
  • Not work-in-progress
  • External references or docs updated
  • Self review of PR done
  • Any breaking changes?

@github-actions github-actions bot added Attestation Azure.Core Azure.Identity EngSys This issue is impacting the engineering system. KeyVault Storage Storage Service (Queues, Blobs, Files) labels May 12, 2023
Copy link
Member

@antkmsft antkmsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ it is pretty cool what you've done with regexes, I didn't know it was possible.
Even if we find the order is not right somewhere (but I just looked and it looks right to me) - we have a way to fix it in the clang-format file.

@LarryOsterman LarryOsterman merged commit fb240a4 into Azure:main May 26, 2023
@LarryOsterman LarryOsterman deleted the larryo/reorderheaders branch May 26, 2023 23:24
gearama added a commit that referenced this pull request May 30, 2023
* Remove -Login and -PushImages parameters from stress helper (#4615)

* Add Azure OpenAI (#4644)

Co-authored-by: Shawn Fang <[email protected]>

* move the cleanup config to -SaveInputs parameter on the cli (#4646)

Co-authored-by: m-nash <[email protected]>

* Fixes for uploading proxy logs (#4652)

Co-authored-by: Bill Wert <[email protected]>

* Handle docker hangs and subscription mismatch on acr login (#4653)

Co-authored-by: Ben Broderick Phillips <[email protected]>

* Sync eng/common directory with azure-sdk-tools for PR 6202 (#4651)

* Adding initial commit of TypeSpecE2E common script

* add TODO comment

* Updated per feedback

---------

Co-authored-by: raychen <[email protected]>

* added a test helper to test each type for having the expected default operations. (#4627)

* add test helper

* constructible from Args

* restucture ClassTraits to ensure portability of static constexpr

* fix Etags tests and format

* clang format

* Add DefaultAzureCredential auth flow diagram (#4654)

* Add DefaultAzureCredential auth flow diagram

* Update cspell.json

---------

Co-authored-by: Anton Kolesnyk <[email protected]>

* Remove defunct template (#4659)

Co-authored-by: James Suplizio <[email protected]>

* Convert most AMQP types to read-only; Significant API surface cleanup. (#4640)

* Prep for readonly connection

* Added options for Connection and Session to enable read-only configuration

* Read-only connection and session objects; use message source and target for message sender and receiver

* Enabled read-only session; added tests for incorrect AMQPS port

* Added token reader sample; flushed out eventhubs properties sample, added some timeouts to send async test

* Moved AMQP samples to internal

* Moved samples to use GetEnvHelper

---------

Co-authored-by: Anton Kolesnyk <[email protected]>

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

* Standardized header ordering for C++ repo

* Reordered categories to move private headers above public headers; added space between categories to enable future flexibility

* fix flaky storage testcase (#4660)

---------

Co-authored-by: Ben Broderick Phillips <[email protected]>
Co-authored-by: Azure SDK Bot <[email protected]>
Co-authored-by: Shawn Fang <[email protected]>
Co-authored-by: m-nash <[email protected]>
Co-authored-by: Bill Wert <[email protected]>
Co-authored-by: raychen <[email protected]>
Co-authored-by: Jennifer Chukwu <[email protected]>
Co-authored-by: Scott Addie <[email protected]>
Co-authored-by: Anton Kolesnyk <[email protected]>
Co-authored-by: James Suplizio <[email protected]>
Co-authored-by: Larry Osterman <[email protected]>
Co-authored-by: JinmingHu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attestation Azure.Core Azure.Identity EngSys This issue is impacting the engineering system. KeyVault Storage Storage Service (Queues, Blobs, Files)
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants