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 |
---|---|---|
.. | ||
default_theme | Loading commit data... | |
SCsub | Loading commit data... | |
animation.cpp | Loading commit data... | |
animation.h | Loading commit data... | |
audio_stream_sample.cpp | Loading commit data... | |
audio_stream_sample.h | Loading commit data... | |
bit_map.cpp | Loading commit data... | |
bit_map.h | Loading commit data... | |
box_shape_3d.cpp | Loading commit data... | |
box_shape_3d.h | Loading commit data... | |
capsule_shape_2d.cpp | Loading commit data... | |
capsule_shape_2d.h | Loading commit data... | |
capsule_shape_3d.cpp | Loading commit data... | |
capsule_shape_3d.h | Loading commit data... | |
circle_shape_2d.cpp | Loading commit data... | |
circle_shape_2d.h | Loading commit data... | |
concave_polygon_shape_2d.cpp | Loading commit data... | |
concave_polygon_shape_2d.h | Loading commit data... | |
concave_polygon_shape_3d.cpp | Loading commit data... | |
concave_polygon_shape_3d.h | Loading commit data... | |
convex_polygon_shape_2d.cpp | Loading commit data... | |
convex_polygon_shape_2d.h | Loading commit data... | |
convex_polygon_shape_3d.cpp | Loading commit data... | |
convex_polygon_shape_3d.h | Loading commit data... | |
curve.cpp | Loading commit data... | |
curve.h | Loading commit data... | |
cylinder_shape_3d.cpp | Loading commit data... | |
cylinder_shape_3d.h | Loading commit data... | |
dynamic_font.cpp | Loading commit data... | |
dynamic_font.h | Loading commit data... | |
environment.cpp | Loading commit data... | |
environment.h | Loading commit data... | |
font.cpp | Loading commit data... | |
font.h | Loading commit data... | |
gradient.cpp | Loading commit data... | |
gradient.h | Loading commit data... | |
height_map_shape_3d.cpp | Loading commit data... | |
height_map_shape_3d.h | Loading commit data... | |
line_shape_2d.cpp | Loading commit data... | |
line_shape_2d.h | Loading commit data... | |
material.cpp | Loading commit data... | |
material.h | Loading commit data... | |
mesh.cpp | Loading commit data... | |
mesh.h | Loading commit data... | |
mesh_data_tool.cpp | Loading commit data... | |
mesh_data_tool.h | Loading commit data... | |
mesh_library.cpp | Loading commit data... | |
mesh_library.h | Loading commit data... | |
multimesh.cpp | Loading commit data... | |
multimesh.h | Loading commit data... | |
navigation_mesh.cpp | Loading commit data... | |
navigation_mesh.h | Loading commit data... | |
packed_scene.cpp | Loading commit data... | |
packed_scene.h | Loading commit data... | |
particles_material.cpp | Loading commit data... | |
particles_material.h | Loading commit data... | |
physics_material.cpp | Loading commit data... | |
physics_material.h | Loading commit data... | |
polygon_path_finder.cpp | Loading commit data... | |
polygon_path_finder.h | Loading commit data... | |
primitive_meshes.cpp | Loading commit data... | |
primitive_meshes.h | Loading commit data... | |
ray_shape_3d.cpp | Loading commit data... | |
ray_shape_3d.h | Loading commit data... | |
rectangle_shape_2d.cpp | Loading commit data... | |
rectangle_shape_2d.h | Loading commit data... | |
resource_format_text.cpp | Loading commit data... | |
resource_format_text.h | Loading commit data... | |
segment_shape_2d.cpp | Loading commit data... | |
segment_shape_2d.h | Loading commit data... | |
shader.cpp | Loading commit data... | |
shader.h | Loading commit data... | |
shape_2d.cpp | Loading commit data... | |
shape_2d.h | Loading commit data... | |
shape_3d.cpp | Loading commit data... | |
shape_3d.h | Loading commit data... | |
skin.cpp | Loading commit data... | |
skin.h | Loading commit data... | |
sky.cpp | Loading commit data... | |
sky.h | Loading commit data... | |
sky_material.cpp | Loading commit data... | |
sky_material.h | Loading commit data... | |
sphere_shape_3d.cpp | Loading commit data... | |
sphere_shape_3d.h | Loading commit data... | |
style_box.cpp | Loading commit data... | |
style_box.h | Loading commit data... | |
surface_tool.cpp | Loading commit data... | |
surface_tool.h | Loading commit data... | |
text_file.cpp | Loading commit data... | |
text_file.h | Loading commit data... | |
texture.cpp | Loading commit data... | |
texture.h | Loading commit data... | |
theme.cpp | Loading commit data... | |
theme.h | Loading commit data... | |
tile_set.cpp | Loading commit data... | |
tile_set.h | Loading commit data... | |
video_stream.h | Loading commit data... | |
visual_shader.cpp | Loading commit data... | |
visual_shader.h | Loading commit data... | |
visual_shader_nodes.cpp | Loading commit data... | |
visual_shader_nodes.h | Loading commit data... | |
world_2d.cpp | Loading commit data... | |
world_2d.h | Loading commit data... | |
world_3d.cpp | Loading commit data... | |
world_3d.h | Loading commit data... | |
world_margin_shape_3d.cpp | Loading commit data... | |
world_margin_shape_3d.h | Loading commit data... |