You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
This commit is contained in:
@@ -54,13 +54,11 @@ const char *ScriptClassParser::token_names[ScriptClassParser::TK_MAX] = {
|
||||
};
|
||||
|
||||
String ScriptClassParser::get_token_name(ScriptClassParser::Token p_token) {
|
||||
|
||||
ERR_FAIL_INDEX_V(p_token, TK_MAX, "<error>");
|
||||
return token_names[p_token];
|
||||
}
|
||||
|
||||
ScriptClassParser::Token ScriptClassParser::get_token() {
|
||||
|
||||
while (true) {
|
||||
switch (code[idx]) {
|
||||
case '\n': {
|
||||
@@ -268,7 +266,6 @@ ScriptClassParser::Token ScriptClassParser::get_token() {
|
||||
}
|
||||
|
||||
Error ScriptClassParser::_skip_generic_type_params() {
|
||||
|
||||
Token tk;
|
||||
|
||||
while (true) {
|
||||
@@ -337,7 +334,6 @@ Error ScriptClassParser::_skip_generic_type_params() {
|
||||
}
|
||||
|
||||
Error ScriptClassParser::_parse_type_full_name(String &r_full_name) {
|
||||
|
||||
Token tk = get_token();
|
||||
|
||||
if (tk != TK_IDENTIFIER) {
|
||||
@@ -370,7 +366,6 @@ Error ScriptClassParser::_parse_type_full_name(String &r_full_name) {
|
||||
}
|
||||
|
||||
Error ScriptClassParser::_parse_class_base(Vector<String> &r_base) {
|
||||
|
||||
String name;
|
||||
|
||||
Error err = _parse_type_full_name(name);
|
||||
@@ -470,7 +465,6 @@ Error ScriptClassParser::_parse_type_constraints() {
|
||||
}
|
||||
|
||||
Error ScriptClassParser::_parse_namespace_name(String &r_name, int &r_curly_stack) {
|
||||
|
||||
Token tk = get_token();
|
||||
|
||||
if (tk == TK_IDENTIFIER) {
|
||||
@@ -497,7 +491,6 @@ Error ScriptClassParser::_parse_namespace_name(String &r_name, int &r_curly_stac
|
||||
}
|
||||
|
||||
Error ScriptClassParser::parse(const String &p_code) {
|
||||
|
||||
code = p_code;
|
||||
idx = 0;
|
||||
line = 0;
|
||||
@@ -653,7 +646,6 @@ static String get_preprocessor_directive(const String &p_line, int p_from) {
|
||||
}
|
||||
|
||||
static void run_dummy_preprocessor(String &r_source, const String &p_filepath) {
|
||||
|
||||
Vector<String> lines = r_source.split("\n", /* p_allow_empty: */ true);
|
||||
|
||||
bool *include_lines = memnew_arr(bool, lines.size());
|
||||
@@ -720,7 +712,6 @@ static void run_dummy_preprocessor(String &r_source, const String &p_filepath) {
|
||||
}
|
||||
|
||||
Error ScriptClassParser::parse_file(const String &p_filepath) {
|
||||
|
||||
String source;
|
||||
|
||||
Error ferr = read_all_file_utf8(p_filepath, source);
|
||||
|
||||
Reference in New Issue
Block a user