1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Style: Enforce braces around if blocks and loops

Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
This commit is contained in:
Rémi Verschelde
2020-05-14 16:41:43 +02:00
parent 07bc4e2f96
commit 0ee0fa42e6
683 changed files with 22803 additions and 12225 deletions

View File

@@ -99,8 +99,9 @@ void AnimationNodeBlendTreeEditor::_property_changed(const StringName &p_propert
}
void AnimationNodeBlendTreeEditor::_update_graph() {
if (updating)
if (updating) {
return;
}
visible_properties.clear();
@@ -415,8 +416,9 @@ void AnimationNodeBlendTreeEditor::_delete_nodes_request() {
}
}
if (to_erase.empty())
if (to_erase.empty()) {
return;
}
undo_redo->create_action(TTR("Delete Node(s)"));
@@ -482,8 +484,9 @@ void AnimationNodeBlendTreeEditor::_filter_edited() {
}
bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &anode) {
if (updating || _filter_edit != anode)
if (updating || _filter_edit != anode) {
return false;
}
NodePath player_path = AnimationTreeEditor::get_singleton()->get_tree()->get_animation_player();
@@ -582,8 +585,9 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano
if (base->has_node(accum)) {
node = base->get_node(accum);
}
if (!node)
if (!node) {
continue; //no node, can't edit
}
if (path.get_subname_count()) {
String concat = path.get_concatenated_subnames();
@@ -670,8 +674,9 @@ void AnimationNodeBlendTreeEditor::_edit_filters(const String &p_which) {
ERR_FAIL_COND(!anode.is_valid());
_filter_edit = anode;
if (!_update_filters(anode))
if (!_update_filters(anode)) {
return;
}
filter_dialog->popup_centered(Size2(500, 500) * EDSCALE);
}
@@ -687,8 +692,9 @@ void AnimationNodeBlendTreeEditor::_notification(int p_what) {
error_panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree"));
error_label->add_theme_color_override("font_color", get_theme_color("error_color", "Editor"));
if (p_what == NOTIFICATION_THEME_CHANGED && is_visible_in_tree())
if (p_what == NOTIFICATION_THEME_CHANGED && is_visible_in_tree()) {
_update_graph();
}
}
if (p_what == NOTIFICATION_PROCESS) {
@@ -754,8 +760,9 @@ void AnimationNodeBlendTreeEditor::_notification(int p_what) {
}
void AnimationNodeBlendTreeEditor::_scroll_changed(const Vector2 &p_scroll) {
if (updating)
if (updating) {
return;
}
updating = true;
blend_tree->set_graph_offset(p_scroll / EDSCALE);
updating = false;