godot/core
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
..
bind Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
crypto Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
debugger Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
input Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
io Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
math Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
os Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
array.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
array.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
callable_method_pointer.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
callable_method_pointer.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
callable.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
callable.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
class_db.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
class_db.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
color_names.inc Style: clang-format: Disable AllowShortIfStatementsOnASingleLine 2020-05-10 13:12:16 +02:00
color.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
color.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
command_queue_mt.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
command_queue_mt.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
compressed_translation.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
compressed_translation.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
container_type_validate.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
core_builders.py SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00
core_string_names.cpp Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
core_string_names.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
cowdata.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
dictionary.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
dictionary.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
engine.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
engine.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
error_list.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
error_macros.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
error_macros.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
func_ref.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
func_ref.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
global_constants.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
global_constants.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
hash_map.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
hashfuncs.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
image.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
image.h Port member initialization from constructor to declaration (C++11) 2020-05-14 10:01:56 +02:00
int_types.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
list.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
local_vector.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
make_binders.py SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00
map.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
message_queue.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
message_queue.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
method_bind.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
method_bind.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
method_ptrcall.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
node_path.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
node_path.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
oa_hash_map.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
object_id.h Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
object.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
object.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
ordered_hash_map.h Port member initialization from constructor to declaration (C++11) 2020-05-14 10:01:56 +02:00
packed_data_container.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
packed_data_container.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
pair.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
pool_allocator.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
pool_allocator.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
print_string.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
print_string.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
project_settings.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
project_settings.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
reference.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
reference.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
register_core_types.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
register_core_types.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
resource.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
resource.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
rid_owner.cpp Vulkan: Move thirdparty code out of drivers, style fixes 2020-02-11 14:08:44 +01:00
rid_owner.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
rid.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
ring_buffer.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
safe_refcount.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
safe_refcount.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
script_language.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
script_language.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
SCsub thirdparty: Cleanup after #38386, document provenance and copyright 2020-05-11 14:50:06 +02:00
self_list.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
set.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
simple_type.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
sort_array.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
spin_lock.h Port member initialization from constructor to declaration (C++11) 2020-05-14 10:01:56 +02:00
string_buffer.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
string_builder.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
string_builder.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
string_name.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
string_name.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
thread_work_pool.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
thread_work_pool.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
translation.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
translation.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
type_info.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
typed_array.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
typedefs.h typedefs: Cleanup unused macros and unnecessary checks 2020-03-11 21:44:56 +01:00
ucaps.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
undo_redo.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
undo_redo.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
ustring.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
ustring.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
variant_call.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
variant_op.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
variant_parser.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
variant_parser.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
variant.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
variant.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
vector.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
version.h Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
vmap.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
vset.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00