Skip to content

chore(IWYU): Remove some redundant includes#4758

Merged
vitaut merged 1 commit into
fmtlib:mainfrom
KaganCanSit:chore/IWYU-header-cleanup
Apr 30, 2026
Merged

chore(IWYU): Remove some redundant includes#4758
vitaut merged 1 commit into
fmtlib:mainfrom
KaganCanSit:chore/IWYU-header-cleanup

Conversation

@KaganCanSit
Copy link
Copy Markdown
Contributor

@KaganCanSit KaganCanSit commented Apr 25, 2026

Checked header dependencies using IWYU and removed includes identified as redundant. I check potential false positives and some warnings were addressed here — not all.

fmt project has platform-specific guards and backward-compatibility build paths that's why I tried to approach it as minimally as possible.

I am marking this PR draft. I want analyze CI results and check again this changes.

@KaganCanSit KaganCanSit force-pushed the chore/IWYU-header-cleanup branch from 28f4348 to f0f9900 Compare April 25, 2026 17:07
@KaganCanSit KaganCanSit force-pushed the chore/IWYU-header-cleanup branch from f0f9900 to 33b3a45 Compare April 25, 2026 17:08
@KaganCanSit
Copy link
Copy Markdown
Contributor Author

KaganCanSit commented Apr 25, 2026

#include "fmt/os.h"  // fmt::system_category
#include "fmt/ranges.h"
#include "gtest-extra.h"  // StartsWith

#ifdef __cpp_lib_filesystem
TEST(std_test, path) {
  using std::filesystem::path;
// ...
// ...
// ...
// ...
  EXPECT_EQ(fmt::format("{:?}", path(L"\xD800")), "\"\\ud800\"");
#  endif
}

// Intentionally delayed include to test #4303
#  include "fmt/ranges.h"

fmt/test/std-test.cc have two same include fmt/ranges.h. But If I change compile failed. I'll take a look at it when I have time. (I need to find the test purpose of the second include.)

@vitaut
Copy link
Copy Markdown
Contributor

vitaut commented Apr 29, 2026

LGTM. Do you still plan to make changes to this PR or shall we merge?

@KaganCanSit
Copy link
Copy Markdown
Contributor Author

LGTM. Do you still plan to make changes to this PR or shall we merge?

Thank you for your review. We can mergw. At the moment, I haven’t been able to find the time to look into the situation I mentioned in the comment above.

@vitaut vitaut marked this pull request as ready for review April 30, 2026 03:50
@vitaut vitaut merged commit d0e3d20 into fmtlib:main Apr 30, 2026
44 checks passed
@vitaut
Copy link
Copy Markdown
Contributor

vitaut commented Apr 30, 2026

Merged, thanks!

@KaganCanSit KaganCanSit deleted the chore/IWYU-header-cleanup branch April 30, 2026 04:25
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