fix: apply clang-format and exclude third-party libraries from formatting checks

- Applied clang-format to fix formatting violations in TUI and other source files
- Updated CMakeLists.txt to exclude src/lib/* from format targets to prevent third-party library violations
- Fixes clang-format violations in chat_tui.cc, tui.cc, and unified_layout.cc
- All source files now pass format-check target

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
scawful
2025-11-20 03:30:56 -05:00
parent 43a0e5e314
commit bb5e2002c2
433 changed files with 3092 additions and 4123 deletions

View File

@@ -1,11 +1,13 @@
#include "core/asar_wrapper.h"
#include "test_utils.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <filesystem>
#include <fstream>
#include "test_utils.h"
namespace yaze {
namespace core {
namespace {

View File

@@ -1,7 +1,7 @@
#include "testing.h"
#include "util/hex.h"
#include "testing.h"
namespace yaze {
namespace test {

View File

@@ -43,8 +43,9 @@ TEST(SnesTileTest, UnpackBppTile) {
EXPECT_EQ(tile2bpp.data[63], 3); // Last pixel: 1|1<<1 = 3
// Test 4bpp tile unpacking
// According to SnesLab: First planes 1&2 intertwined, then planes 3&4 intertwined
// 32 bytes total: 16 bytes for planes 1&2, then 16 bytes for planes 3&4
// According to SnesLab: First planes 1&2 intertwined, then planes 3&4
// intertwined 32 bytes total: 16 bytes for planes 1&2, then 16 bytes for
// planes 3&4
std::vector<uint8_t> data4bpp = {
// Planes 1&2 intertwined (rows 0-7)
0x81, 0x80, // Row 0: bp1=10000001, bp2=10000000

View File

@@ -316,7 +316,8 @@ TEST_F(CanvasAutomationAPITest, CenterOn_ValidTile) {
api_->CenterOn(0, 0);
api_->CenterOn(20, 20);
// Verify scroll position changed (should be non-zero after centering on non-origin)
// Verify scroll position changed (should be non-zero after centering on
// non-origin)
ImVec2 scroll = canvas_->scrolling();
// Scroll values will depend on canvas size, just verify they're set
}

View File

@@ -1,8 +1,7 @@
#include "app/gui/canvas/canvas.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "app/gui/canvas/canvas.h"
#include "testing.h"
namespace yaze {
@@ -150,8 +149,8 @@ TEST_F(CanvasCoordinateSyncTest, MapCalculation_LargeMaps) {
// ============================================================================
TEST_F(CanvasCoordinateSyncTest, HoverPosition_ScaleInvariant) {
// REGRESSION TEST: Hover position should be in world space regardless of scale
// The bug was scale-dependent because it used screen coordinates
// REGRESSION TEST: Hover position should be in world space regardless of
// scale The bug was scale-dependent because it used screen coordinates
auto test_hover_at_scale = [&](float scale) {
canvas_->set_global_scale(scale);
@@ -184,7 +183,8 @@ TEST_F(CanvasCoordinateSyncTest, OverworldMapHighlight_UsesHoverNotDrawn) {
// The pattern used in DrawOverworldEdits (line 664) for painting:
auto drawn_pos = canvas_->drawn_tile_position();
// The pattern that SHOULD be used in CheckForCurrentMap (line 1041) for highlighting:
// The pattern that SHOULD be used in CheckForCurrentMap (line 1041) for
// highlighting:
auto hover_pos = canvas_->hover_mouse_pos();
// These are different methods for different purposes:

View File

@@ -196,7 +196,8 @@ TEST_F(RomTest, SaveTruncatesExistingFile) {
#if defined(__linux__)
GTEST_SKIP();
#endif
// Prepare ROM data and save to a temp file twice; second save should overwrite, not append
// Prepare ROM data and save to a temp file twice; second save should
// overwrite, not append
EXPECT_OK(rom_.LoadFromData(kMockRomData, /*z3_load=*/false));
const char* tmp_name = "test_temp_rom.sfc";
@@ -211,7 +212,8 @@ TEST_F(RomTest, SaveTruncatesExistingFile) {
EXPECT_OK(rom_.WriteByte(0, 0xEE));
EXPECT_OK(rom_.SaveToFile(settings));
// Load the saved file and verify size equals original data size and first byte matches
// Load the saved file and verify size equals original data size and first
// byte matches
Rom verify;
EXPECT_OK(verify.LoadFromFile(tmp_name, /*z3_load=*/false));
EXPECT_EQ(verify.size(), kMockRomData.size());

View File

@@ -1,9 +1,8 @@
#include "gtest/gtest.h"
#include "absl/status/status.h"
#include "app/gfx/background_buffer.h"
#include "app/gfx/snes_palette.h"
#include "app/rom.h"
#include "gtest/gtest.h"
#include "zelda3/dungeon/object_drawer.h"
#include "zelda3/dungeon/object_parser.h"
#include "zelda3/dungeon/room_object.h"

View File

@@ -1,6 +1,7 @@
// Tests for Room object manipulation methods (Phase 3)
#include <gtest/gtest.h>
#include "app/rom.h"
#include "zelda3/dungeon/room.h"
#include "zelda3/dungeon/room_object.h"

View File

@@ -5,10 +5,10 @@
// correctly for all three object types (Type1, Type2, Type3) based on
// ZScream's proven implementation.
#include "zelda3/dungeon/room_object.h"
#include <gtest/gtest.h>
#include "zelda3/dungeon/room_object.h"
namespace yaze {
namespace zelda3 {
namespace {

View File

@@ -1,4 +1,5 @@
#include <gtest/gtest.h>
#include <memory>
// Test the individual components independently
@@ -10,7 +11,7 @@ namespace test {
/**
* @brief Unit tests for individual dungeon components
*
*
* These tests validate component behavior without requiring ROM files
* or complex graphics initialization.
*/

View File

@@ -1,6 +1,5 @@
#include "zelda3/dungeon/object_parser.h"
#include "gtest/gtest.h"
#include "zelda3/dungeon/object_parser.h"
namespace yaze {
namespace test {

View File

@@ -1,8 +1,10 @@
#include "zelda3/overworld/overworld.h"
#include <gtest/gtest.h>
#include <memory>
#include "app/rom.h"
#include "zelda3/overworld/overworld.h"
#include "zelda3/overworld/overworld_map.h"
namespace yaze {

View File

@@ -14,7 +14,7 @@ namespace test {
/**
* @brief Simplified test framework for dungeon object rendering
*
*
* This provides a clean, focused testing environment for dungeon object
* functionality without the complexity of full integration tests.
*/