mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #85837 from akien-mga/clang-format-16
Style: Mark clang-format 16 as supported for pre-commit hook
This commit is contained in:
commit
e72e63a6b5
4 changed files with 100 additions and 100 deletions
|
|
@ -607,8 +607,7 @@ layout(std140) uniform GlobalShaderUniformData { //ubo:1
|
||||||
vec4 global_shader_uniforms[MAX_GLOBAL_SHADER_UNIFORMS];
|
vec4 global_shader_uniforms[MAX_GLOBAL_SHADER_UNIFORMS];
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Material Uniforms */
|
/* Material Uniforms */
|
||||||
|
|
||||||
#ifdef MATERIAL_UNIFORMS_USED
|
#ifdef MATERIAL_UNIFORMS_USED
|
||||||
|
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
|
|
|
||||||
|
|
@ -1045,15 +1045,15 @@ bool ProjectConverter3To4::test_conversion(RegExContainer ®_container) {
|
||||||
|
|
||||||
// get_object_of_execution
|
// get_object_of_execution
|
||||||
{
|
{
|
||||||
{ String base = "var roman = kieliszek.";
|
String base = "var roman = kieliszek.";
|
||||||
String expected = "kieliszek.";
|
String expected = "kieliszek.";
|
||||||
String got = get_object_of_execution(base);
|
String got = get_object_of_execution(base);
|
||||||
if (got != expected) {
|
if (got != expected) {
|
||||||
ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
|
ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
|
||||||
}
|
}
|
||||||
valid = valid && (got == expected);
|
valid = valid && (got == expected);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
String base = "r.";
|
String base = "r.";
|
||||||
String expected = "r.";
|
String expected = "r.";
|
||||||
String got = get_object_of_execution(base);
|
String got = get_object_of_execution(base);
|
||||||
|
|
@ -1061,8 +1061,8 @@ bool ProjectConverter3To4::test_conversion(RegExContainer ®_container) {
|
||||||
ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
|
ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
|
||||||
}
|
}
|
||||||
valid = valid && (got == expected);
|
valid = valid && (got == expected);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
String base = "mortadela(";
|
String base = "mortadela(";
|
||||||
String expected = "";
|
String expected = "";
|
||||||
String got = get_object_of_execution(base);
|
String got = get_object_of_execution(base);
|
||||||
|
|
@ -1070,8 +1070,8 @@ bool ProjectConverter3To4::test_conversion(RegExContainer ®_container) {
|
||||||
ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
|
ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
|
||||||
}
|
}
|
||||||
valid = valid && (got == expected);
|
valid = valid && (got == expected);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
String base = "var node = $world/ukraine/lviv.";
|
String base = "var node = $world/ukraine/lviv.";
|
||||||
String expected = "$world/ukraine/lviv.";
|
String expected = "$world/ukraine/lviv.";
|
||||||
String got = get_object_of_execution(base);
|
String got = get_object_of_execution(base);
|
||||||
|
|
@ -1079,10 +1079,10 @@ bool ProjectConverter3To4::test_conversion(RegExContainer ®_container) {
|
||||||
ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
|
ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
|
||||||
}
|
}
|
||||||
valid = valid && (got == expected);
|
valid = valid && (got == expected);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// get_starting_space
|
// get_starting_space
|
||||||
{
|
{
|
||||||
String base = "\t\t\t var roman = kieliszek.";
|
String base = "\t\t\t var roman = kieliszek.";
|
||||||
String expected = "\t\t\t";
|
String expected = "\t\t\t";
|
||||||
String got = get_starting_space(base);
|
String got = get_starting_space(base);
|
||||||
|
|
@ -1090,9 +1090,10 @@ bool ProjectConverter3To4::test_conversion(RegExContainer ®_container) {
|
||||||
ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
|
ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
|
||||||
}
|
}
|
||||||
valid = valid && (got == expected);
|
valid = valid && (got == expected);
|
||||||
}
|
}
|
||||||
// Parse Arguments
|
|
||||||
{
|
// Parse Arguments
|
||||||
|
{
|
||||||
String line = "( )";
|
String line = "( )";
|
||||||
Vector<String> got_vector = parse_arguments(line);
|
Vector<String> got_vector = parse_arguments(line);
|
||||||
String got = "";
|
String got = "";
|
||||||
|
|
@ -1104,8 +1105,8 @@ bool ProjectConverter3To4::test_conversion(RegExContainer ®_container) {
|
||||||
ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size()));
|
ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size()));
|
||||||
}
|
}
|
||||||
valid = valid && (got == expected);
|
valid = valid && (got == expected);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
String line = "(a , b , c)";
|
String line = "(a , b , c)";
|
||||||
Vector<String> got_vector = parse_arguments(line);
|
Vector<String> got_vector = parse_arguments(line);
|
||||||
String got = "";
|
String got = "";
|
||||||
|
|
@ -1117,8 +1118,8 @@ bool ProjectConverter3To4::test_conversion(RegExContainer ®_container) {
|
||||||
ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size()));
|
ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size()));
|
||||||
}
|
}
|
||||||
valid = valid && (got == expected);
|
valid = valid && (got == expected);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
String line = "(a , \"b,\" , c)";
|
String line = "(a , \"b,\" , c)";
|
||||||
Vector<String> got_vector = parse_arguments(line);
|
Vector<String> got_vector = parse_arguments(line);
|
||||||
String got = "";
|
String got = "";
|
||||||
|
|
@ -1130,8 +1131,8 @@ bool ProjectConverter3To4::test_conversion(RegExContainer ®_container) {
|
||||||
ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size()));
|
ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size()));
|
||||||
}
|
}
|
||||||
valid = valid && (got == expected);
|
valid = valid && (got == expected);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
String line = "(a , \"(,),,,,\" , c)";
|
String line = "(a , \"(,),,,,\" , c)";
|
||||||
Vector<String> got_vector = parse_arguments(line);
|
Vector<String> got_vector = parse_arguments(line);
|
||||||
String got = "";
|
String got = "";
|
||||||
|
|
@ -1143,9 +1144,9 @@ bool ProjectConverter3To4::test_conversion(RegExContainer ®_container) {
|
||||||
ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size()));
|
ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size()));
|
||||||
}
|
}
|
||||||
valid = valid && (got == expected);
|
valid = valid && (got == expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
return valid;
|
return valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate in all arrays if names don't do cyclic renames "Node" -> "Node2D" | "Node2D" -> "2DNode"
|
// Validate in all arrays if names don't do cyclic renames "Node" -> "Node2D" | "Node2D" -> "2DNode"
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ so they should work out of the box on Linux/macOS.
|
||||||
|
|
||||||
##### clang-format
|
##### clang-format
|
||||||
- Download LLVM for Windows (version 13 or later) from
|
- Download LLVM for Windows (version 13 or later) from
|
||||||
<https://releases.llvm.org/download.html>
|
<https://github.com/llvm/llvm-project/releases>
|
||||||
- Make sure LLVM is added to the `PATH` during installation
|
- Make sure LLVM is added to the `PATH` during installation
|
||||||
|
|
||||||
##### black
|
##### black
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ fi
|
||||||
# To get consistent formatting, we recommend contributors to use the same
|
# To get consistent formatting, we recommend contributors to use the same
|
||||||
# clang-format version as CI.
|
# clang-format version as CI.
|
||||||
RECOMMENDED_CLANG_FORMAT_MAJOR_MIN="13"
|
RECOMMENDED_CLANG_FORMAT_MAJOR_MIN="13"
|
||||||
RECOMMENDED_CLANG_FORMAT_MAJOR_MAX="15"
|
RECOMMENDED_CLANG_FORMAT_MAJOR_MAX="16"
|
||||||
|
|
||||||
if [ ! -x "$CLANG_FORMAT" ] ; then
|
if [ ! -x "$CLANG_FORMAT" ] ; then
|
||||||
message="Error: clang-format executable not found. Please install clang-format $RECOMMENDED_CLANG_FORMAT_MAJOR_MAX."
|
message="Error: clang-format executable not found. Please install clang-format $RECOMMENDED_CLANG_FORMAT_MAJOR_MAX."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue