1
0
mirror of https://github.com/godotengine/godot synced 2024-07-08 19:30:43 +00:00
godot/modules
Rémi Verschelde 07bc4e2f96 Style: Enforce separation line between function definitions
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.
2020-05-14 16:54:55 +02:00
..
arkit Rename InputFilter back to Input 2020-04-28 15:19:49 +02:00
assimp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
basis_universal Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
bmp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
bullet Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
camera SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00
csg Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
cvtt Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
dds Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
denoise Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
enet Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
etc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
freetype SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00
gdnative Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
gdnavigation Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
gdscript Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
glslang Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
gridmap Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
hdr Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
jpg Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
jsonrpc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
lightmapper_rd Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
mbedtls Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
mobile_vr Style: clang-format: Disable AllowShortIfStatementsOnASingleLine 2020-05-10 13:12:16 +02:00
mono Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
ogg SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00
opensimplex Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
opus SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00
pvr Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
regex Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
squish Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
stb_vorbis Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
svg Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
tga Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
theora Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
tinyexr Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
upnp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
vhacd Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
visual_script Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
vorbis SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00
webm Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
webp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
webrtc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
websocket Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
xatlas_unwrap Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
modules_builders.py SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00
register_module_types.h Moved the shader source compilation code outside RenderingDevice and Vulkan 2020-02-11 11:53:29 +01:00
SCsub fixed modules not beeing added to vsproj 2020-04-09 15:15:52 +02:00