I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
export | Loading commit data... | |
SCsub | Loading commit data... | |
context_gl_windows.cpp | Loading commit data... | |
context_gl_windows.h | Loading commit data... | |
crash_handler_windows.cpp | Loading commit data... | |
crash_handler_windows.h | Loading commit data... | |
detect.py | Loading commit data... | |
display_server_windows.cpp | Loading commit data... | |
display_server_windows.h | Loading commit data... | |
godot.ico | Loading commit data... | |
godot.natvis | Loading commit data... | |
godot_res.rc | Loading commit data... | |
godot_windows.cpp | Loading commit data... | |
joypad_windows.cpp | Loading commit data... | |
joypad_windows.h | Loading commit data... | |
key_mapping_windows.cpp | Loading commit data... | |
key_mapping_windows.h | Loading commit data... | |
lang_table.h | Loading commit data... | |
logo.png | Loading commit data... | |
os_windows.cpp | Loading commit data... | |
os_windows.h | Loading commit data... | |
platform_config.h | Loading commit data... | |
platform_windows_builders.py | Loading commit data... | |
vulkan_context_win.cpp | Loading commit data... | |
vulkan_context_win.h | Loading commit data... | |
windows_terminal_logger.cpp | Loading commit data... | |
windows_terminal_logger.h | Loading commit data... |