Commit graph

22 commits

Author SHA1 Message Date
Stijn Hinlopen
929b98d24b Remove String::find_last (same as rfind) 2020-07-03 15:26:22 +02:00
Rémi Verschelde
0ee0fa42e6 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
2020-05-14 21:57:34 +02:00
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
Rémi Verschelde
0be6d925dc 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.
2020-05-14 16:54:55 +02:00
Thakee Nathees
3275e8488b Fix EditorFolding crash when switching scenes 2020-03-05 18:19:58 +05:30
Juan Linietsky
3205a92ad8 PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
2020-02-18 10:10:36 +01:00
Rémi Verschelde
a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
Rafał Mikrut
ed1c4bc77d Removed unused variables, add some constants numbers 2019-12-10 05:13:02 +01:00
Tomasz Chabora
57b12c10ab Prevent crash when scene has path, but no file 2019-11-12 14:09:58 +01:00
Rémi Verschelde
6920c82742 Style: Fix issues with clang-format 8.0 2019-05-20 13:51:51 +02:00
Juan Linietsky
c1dcdf6109 No more metadata and dependency indices kept in resources saved.
-Node folding is now saved externally together with the properties
-External resources remember their ID when scenes are saved.
2019-04-11 14:36:58 -03:00
PouleyKetchoupp
790a78273f EditorFolding ignores hidden properties for folded resources (fixes #26663) 2019-04-10 12:11:14 +02:00
marxin
8d51618949 Add -Wshadow=local to warnings and fix reported issues.
Fixes #25316.
2019-02-20 19:44:12 +01:00
K. S. Ernest (iFire) Lee
b83c3827f3 Add check in folding to see if the nodepath exists to avoid message spam. 2019-01-30 20:19:44 -08:00
Rémi Verschelde
b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Rémi Verschelde
d1f3b622f0 Fix missing/malformed license headers 2019-01-01 12:46:36 +01:00
Rémi Verschelde
dd06f6ee70 Fix style issues and signature mismatch 2018-11-28 10:21:07 +01:00
Juan Linietsky
0d69da8c0e Rewrite code for unfolding and make it automatic on scene load, which works better. 2018-11-25 10:47:33 -03:00
Juan Linietsky
455f297671 Properly reset canvas state after drawing, fixes #18860 2018-11-18 16:34:20 -03:00
Michael Alexsander Silva Dias
df72ac5965 Remove "save folding for:" message when saving 2018-10-30 11:55:36 -03:00
Juan Linietsky
4761c6bb7b Automatically unfold sections of properties that someone else edited (no local info exists). 2018-10-29 17:39:17 -03:00
Juan Linietsky
e647342140 Moved folding outside the resource files, now saved outside the project. 2018-10-29 16:37:09 -03:00