mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +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:
parent
07bc4e2f96
commit
0ee0fa42e6
683 changed files with 22803 additions and 12225 deletions
|
@ -144,8 +144,9 @@ void ExtendGDScriptParser::parse_class_symbol(const GDScriptParser::ClassNode *p
|
|||
r_symbol.script_path = path;
|
||||
r_symbol.children.clear();
|
||||
r_symbol.name = p_class->name;
|
||||
if (r_symbol.name.empty())
|
||||
if (r_symbol.name.empty()) {
|
||||
r_symbol.name = path.get_file();
|
||||
}
|
||||
r_symbol.kind = lsp::SymbolKind::Class;
|
||||
r_symbol.deprecated = false;
|
||||
r_symbol.range.start.line = LINE_NUMBER_TO_INDEX(p_class->line);
|
||||
|
@ -378,8 +379,9 @@ String ExtendGDScriptParser::parse_documentation(int p_line, bool p_docs_down) {
|
|||
int step = p_docs_down ? 1 : -1;
|
||||
int start_line = p_docs_down ? p_line : p_line - 1;
|
||||
for (int i = start_line; true; i += step) {
|
||||
if (i < 0 || i >= lines.size())
|
||||
if (i < 0 || i >= lines.size()) {
|
||||
break;
|
||||
}
|
||||
|
||||
String line_comment = lines[i].strip_edges(true, false);
|
||||
if (line_comment.begins_with("#")) {
|
||||
|
@ -413,8 +415,9 @@ String ExtendGDScriptParser::get_text_for_completion(const lsp::Position &p_curs
|
|||
longthing += lines[i];
|
||||
}
|
||||
|
||||
if (i != len - 1)
|
||||
if (i != len - 1) {
|
||||
longthing += "\n";
|
||||
}
|
||||
}
|
||||
|
||||
return longthing;
|
||||
|
@ -450,8 +453,9 @@ String ExtendGDScriptParser::get_text_for_lookup_symbol(const lsp::Position &p_c
|
|||
longthing += lines[i];
|
||||
}
|
||||
|
||||
if (i != len - 1)
|
||||
if (i != len - 1) {
|
||||
longthing += "\n";
|
||||
}
|
||||
}
|
||||
|
||||
return longthing;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue