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 |
---|---|---|
.. | ||
SCsub | Loading commit data... | |
animated_sprite_2d.cpp | Loading commit data... | |
animated_sprite_2d.h | Loading commit data... | |
area_2d.cpp | Loading commit data... | |
area_2d.h | Loading commit data... | |
audio_stream_player_2d.cpp | Loading commit data... | |
audio_stream_player_2d.h | Loading commit data... | |
back_buffer_copy.cpp | Loading commit data... | |
back_buffer_copy.h | Loading commit data... | |
camera_2d.cpp | Loading commit data... | |
camera_2d.h | Loading commit data... | |
canvas_modulate.cpp | Loading commit data... | |
canvas_modulate.h | Loading commit data... | |
collision_object_2d.cpp | Loading commit data... | |
collision_object_2d.h | Loading commit data... | |
collision_polygon_2d.cpp | Loading commit data... | |
collision_polygon_2d.h | Loading commit data... | |
collision_shape_2d.cpp | Loading commit data... | |
collision_shape_2d.h | Loading commit data... | |
cpu_particles_2d.cpp | Loading commit data... | |
cpu_particles_2d.h | Loading commit data... | |
gpu_particles_2d.cpp | Loading commit data... | |
gpu_particles_2d.h | Loading commit data... | |
joints_2d.cpp | Loading commit data... | |
joints_2d.h | Loading commit data... | |
light_2d.cpp | Loading commit data... | |
light_2d.h | Loading commit data... | |
light_occluder_2d.cpp | Loading commit data... | |
light_occluder_2d.h | Loading commit data... | |
line_2d.cpp | Loading commit data... | |
line_2d.h | Loading commit data... | |
line_builder.cpp | Loading commit data... | |
line_builder.h | Loading commit data... | |
mesh_instance_2d.cpp | Loading commit data... | |
mesh_instance_2d.h | Loading commit data... | |
multimesh_instance_2d.cpp | Loading commit data... | |
multimesh_instance_2d.h | Loading commit data... | |
navigation_2d.cpp | Loading commit data... | |
navigation_2d.h | Loading commit data... | |
navigation_agent_2d.cpp | Loading commit data... | |
navigation_agent_2d.h | Loading commit data... | |
navigation_obstacle_2d.cpp | Loading commit data... | |
navigation_obstacle_2d.h | Loading commit data... | |
navigation_region_2d.cpp | Loading commit data... | |
navigation_region_2d.h | Loading commit data... | |
node_2d.cpp | Loading commit data... | |
node_2d.h | Loading commit data... | |
parallax_background.cpp | Loading commit data... | |
parallax_background.h | Loading commit data... | |
parallax_layer.cpp | Loading commit data... | |
parallax_layer.h | Loading commit data... | |
path_2d.cpp | Loading commit data... | |
path_2d.h | Loading commit data... | |
physics_body_2d.cpp | Loading commit data... | |
physics_body_2d.h | Loading commit data... | |
polygon_2d.cpp | Loading commit data... | |
polygon_2d.h | Loading commit data... | |
position_2d.cpp | Loading commit data... | |
position_2d.h | Loading commit data... | |
ray_cast_2d.cpp | Loading commit data... | |
ray_cast_2d.h | Loading commit data... | |
remote_transform_2d.cpp | Loading commit data... | |
remote_transform_2d.h | Loading commit data... | |
skeleton_2d.cpp | Loading commit data... | |
skeleton_2d.h | Loading commit data... | |
sprite_2d.cpp | Loading commit data... | |
sprite_2d.h | Loading commit data... | |
tile_map.cpp | Loading commit data... | |
tile_map.h | Loading commit data... | |
touch_screen_button.cpp | Loading commit data... | |
touch_screen_button.h | Loading commit data... | |
visibility_notifier_2d.cpp | Loading commit data... | |
visibility_notifier_2d.h | Loading commit data... | |
y_sort.cpp | Loading commit data... | |
y_sort.h | Loading commit data... |