Skip to content

Conversation

@plebioda
Copy link

@plebioda plebioda commented Dec 3, 2025

Fix formatting using:

  • buildscripts/clang_format.py format
  • buildscripts/pylinters.py fix
  • buildscripts/pylinters.py fix-scons
  • buildscripts/eslint.py fix

@plebioda plebioda requested a review from Copilot December 3, 2025 17:48
Copilot finished reviewing on behalf of plebioda December 3, 2025 17:49
@plebioda plebioda changed the title PSMDB-1786: fix formatting PSMDB-1786: fix formatting (v7.0) Dec 3, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR applies automated code formatting fixes across the MongoDB codebase using clang_format, pylinters, and eslint tools to ensure consistent code style.

Key Changes:

  • Formatting adjustments to C++ source and header files (spacing, indentation, line breaks)
  • SCons build script formatting improvements (parameter alignment, line breaks)
  • JavaScript formatting fixes (array formatting, spacing)

Reviewed changes

Copilot reviewed 173 out of 207 changed files in this pull request and generated 47 comments.

File Description
Various C++ files (.cpp/.h) Applied clang_format for consistent spacing, indentation, and brace placement
SCons files (SConscript) Reformatted function calls, parameter alignment, and removed trailing whitespace
JavaScript files (.js) Fixed array formatting and spacing using eslint
Multiple source files Reordered includes alphabetically and added proper namespace comments

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@plebioda plebioda requested review from igorsol and ktrushin December 4, 2025 10:11
Copy link

@igorsol igorsol left a comment

Choose a reason for hiding this comment

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

It seems some files (http_client.h, exit_code.h) have formatting changes in parts which we didn't touch.

@ktrushin
Copy link

ktrushin commented Dec 4, 2025

It seems some files (http_client.h, exit_code.h) have formatting changes in parts which we didn't touch.

Not quite so.

It was me who initially added the two functions to the http_client.h file that were reformatted by in the PR:

$ git switch v7.0
$ git blame src/mongo/util/net/http_client.h
...
eeae160f3ae6 src/mongo/util/net/http_client.h      (Konstantin Trushin 2025-06-17 16:36:09 +0400 173)     static void enableLocalhostException() noexcept { _localhostExceptionEnabled = true; }
eeae160f3ae6 src/mongo/util/net/http_client.h      (Konstantin Trushin 2025-06-17 16:36:09 +0400 174) 
eeae160f3ae6 src/mongo/util/net/http_client.h      (Konstantin Trushin 2025-06-17 16:36:09 +0400 175)     static bool localhostExceptionEnabled() noexcept { return _localhostExceptionEnabled; }

...

In exit_code.h, situation is slightly more complex. Our changes don't touch the code the formatter changed, but they influence formatting:

$ git blame src/mongo/util/exit_code.h
...
c44db4ac9d0c (Matt Kneiser       2022-07-05 17:09:20 +0000 64)     reservedBegin = 64,       // FreeBSD uses this range. Avoiding to prevent confusion.
beb74254af99 (Igor Solodovnikov  2023-04-21 10:24:13 +0100 65)     perconaAuditError = 70,
c44db4ac9d0c (Matt Kneiser       2022-07-05 17:09:20 +0000 66)     reservedEnd = 78,         // FreeBSD uses this range. Avoiding to prevent confusion.
...

Line 65 broke the previously uninterrupted "flow" of end-of-the-line comments, which confuses the formatter.

Fix formatting using:
- `buildscripts/clang_format.py format`
- `buildscripts/pylinters.py fix`
- `buildscripts/pylinters.py fix-scons`
- `buildscripts/eslint.py fix`
@plebioda plebioda force-pushed the PSMDB-1786-fix-formatting-v7.0 branch from db75344 to f8f9acb Compare December 5, 2025 11:46
@plebioda
Copy link
Author

plebioda commented Dec 5, 2025

All review comments addressed.

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.

4 participants