Skip to content

CDRIVER-5866 Use consistent syntax for include directives #1840

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

Merged
merged 3 commits into from
Jan 28, 2025

Conversation

eramongodb
Copy link
Contributor

Resolves CDRIVER-5866 (comprehensive followup to #1836). Changes split from ongoing work on CDRIVER-5670.

Note

Sorting and grouping of include directives will still be addressed by CDRIVER-5670.

Consistently applies <>-syntax + library prefix to all include directives of all library headers.

The changes are applied using the following "rules":

  • Library headers are included using the same syntax as users are expected to use.
    • Makes internal code depend on the "same" include directory paths as what is configured for users.
    • All system and third-party headers now also use <>-syntax.
  • Test, example, and fuzzing components are excluded due to not yet being organized in prefix-friendly directories.
    • These are the only include directives still using ""-syntax.
    • Updated so the included header is always relative to the current file containing the directive.
    • No implicit dependence on include directory path configuration.

As a drive-by fix, updates the Jinja2 templates files to avoid inserting extra trailing newlines in the source files which may trigger git warnings of the form:

<stdin>:9: new blank line at EOF.
+
warning: 1 line adds whitespace errors.

@eramongodb eramongodb requested a review from kevinAlbs January 28, 2025 17:00
@eramongodb eramongodb self-assigned this Jan 28, 2025
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

LGTM. I support moving towards internal code that better resembles expected use.

@eramongodb eramongodb merged commit 1a615a7 into mongodb:master Jan 28, 2025
43 of 44 checks passed
@eramongodb eramongodb deleted the cdriver-5866 branch January 28, 2025 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants