virtualx-engine/editor
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
..
debugger Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
fileserver Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
icons Update the editor icons README to remove outdated information 2020-05-12 09:46:56 +02:00
import Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
plugins Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
translations i18n: Sync translations with Weblate 2020-05-05 16:05:56 +02:00
animation_bezier_editor.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
animation_bezier_editor.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
animation_track_editor.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
animation_track_editor.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
animation_track_editor_plugins.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
animation_track_editor_plugins.h Texture refactor 2020-02-11 11:53:26 +01:00
array_property_edit.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
array_property_edit.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
audio_stream_preview.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
audio_stream_preview.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
code_editor.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
code_editor.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
connections_dialog.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
connections_dialog.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
create_dialog.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
create_dialog.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
dependency_editor.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
dependency_editor.h Style: Set clang-format Standard to Cpp11 2020-03-17 07:36:24 +01:00
dictionary_property_edit.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
dictionary_property_edit.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
doc_data.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
doc_data.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_about.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_about.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_asset_installer.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_asset_installer.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_atlas_packer.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
editor_atlas_packer.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
editor_audio_buses.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
editor_audio_buses.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_autoload_settings.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_autoload_settings.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_builders.py Replace more occurrences of NULL with nullptr 2020-04-02 14:56:01 +02:00
editor_data.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
editor_data.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_dir_dialog.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_dir_dialog.h Signals: Port more uses of connect_compat 2020-02-28 14:24:09 +01:00
editor_export.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
editor_export.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_feature_profile.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
editor_feature_profile.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_file_dialog.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
editor_file_dialog.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_file_system.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
editor_file_system.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_folding.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
editor_folding.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_fonts.cpp Improve shortcut formatting in docs 2020-04-10 18:42:11 +03:00
editor_fonts.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
editor_help.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
editor_help.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_help_search.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_help_search.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_inspector.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
editor_inspector.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_layouts_dialog.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_layouts_dialog.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_log.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_log.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_node.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
editor_node.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_path.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_path.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_plugin.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
editor_plugin.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_plugin_settings.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_plugin_settings.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_properties.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
editor_properties.h Implement global and per instance shader uniforms. 2020-04-17 12:35:41 -03:00
editor_properties_array_dict.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_properties_array_dict.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_resource_preview.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_resource_preview.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_run.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_run.h Move Debug menu logic to DebuggerEditorPlugin 2020-03-08 22:57:48 +01:00
editor_run_native.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_run_native.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_run_script.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_run_script.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_scale.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
editor_scale.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
editor_sectioned_inspector.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_sectioned_inspector.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_settings.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_settings.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_spin_slider.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_spin_slider.h Popups have also been converted to windows 2020-03-26 15:49:44 +01:00
editor_sub_scene.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_sub_scene.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_themes.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_themes.h Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
editor_vcs_interface.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_vcs_interface.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
export_template_manager.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
export_template_manager.h PoolVector is gone, replaced by Vector 2020-02-18 10:10:36 +01:00
filesystem_dock.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
filesystem_dock.h Port member initialization from constructor to declaration (C++11) 2020-05-14 10:01:56 +02:00
find_in_files.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
find_in_files.h Working multiple window support, including editor 2020-03-26 15:49:40 +01:00
groups_editor.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
groups_editor.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
import_dock.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
import_dock.h Fix multiple issues with the "Import" dock 2020-02-13 23:08:05 -03:00
inspector_dock.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
inspector_dock.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
multi_node_edit.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
multi_node_edit.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
node_3d_editor_gizmos.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
node_3d_editor_gizmos.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
node_dock.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
node_dock.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
pane_drag.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
pane_drag.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
plugin_config_dialog.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
plugin_config_dialog.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
progress_dialog.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
progress_dialog.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
project_export.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
project_export.h Working multiple window support, including editor 2020-03-26 15:49:40 +01:00
project_manager.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
project_manager.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
project_settings_editor.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
project_settings_editor.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
property_editor.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
property_editor.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
property_selector.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
property_selector.h Signals: Port more uses of connect_compat 2020-02-28 14:24:09 +01:00
pvrtc_compress.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
pvrtc_compress.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
quick_open.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
quick_open.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
register_exporters.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
rename_dialog.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
rename_dialog.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
reparent_dialog.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
reparent_dialog.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
run_settings_dialog.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
run_settings_dialog.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
scene_tree_dock.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
scene_tree_dock.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
scene_tree_editor.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
scene_tree_editor.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
script_create_dialog.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
script_create_dialog.h Warn about built-in script limitations in the script creation dialog 2020-04-04 13:44:13 +02:00
SCsub Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
settings_config_dialog.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
settings_config_dialog.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
shader_globals_editor.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
shader_globals_editor.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00