From 1bdb82c64e65f23381183051ef1fc9856a7830f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 10 Feb 2022 12:00:11 +0100 Subject: [PATCH] Fix typos with codespell Using codespell 2.2-dev from current git. Added `misc/scripts/codespell.sh` to make it easier to run it once in a while and update the skip and ignore lists. --- core/io/marshalls.cpp | 2 +- core/string/string_name.h | 2 +- doc/classes/EngineDebugger.xml | 2 +- doc/classes/EngineProfiler.xml | 4 ++-- doc/classes/FontData.xml | 2 +- doc/classes/GPUParticles2D.xml | 2 +- doc/classes/GPUParticles3D.xml | 2 +- doc/classes/TextServerExtension.xml | 2 +- doc/classes/TranslationServer.xml | 2 +- doc/classes/Viewport.xml | 4 ++-- doc/tools/make_rst.py | 10 +++++----- doc/translations/classes.pot | 2 +- drivers/vulkan/vulkan_context.cpp | 2 +- editor/editor_themes.cpp | 2 +- misc/hooks/pre-commit-black | 16 ++++++++-------- misc/hooks/pre-commit-clang-format | 16 ++++++++-------- misc/scripts/codespell.sh | 5 +++++ modules/gltf/gltf_document.cpp | 6 +++--- modules/text_server_adv/script_iterator.cpp | 2 +- .../editor/visual_script_property_selector.cpp | 10 +++++----- modules/websocket/wsl_client.cpp | 2 +- platform/android/display_server_android.cpp | 2 +- platform/android/java_godot_io_wrapper.cpp | 4 ++-- platform/linuxbsd/display_server_x11.cpp | 8 ++++---- platform/osx/display_server_osx.mm | 2 +- scene/3d/spring_arm_3d.cpp | 8 ++++---- scene/gui/text_edit.cpp | 2 +- tests/core/math/test_vector3.h | 2 +- 28 files changed, 65 insertions(+), 60 deletions(-) create mode 100644 misc/scripts/codespell.sh diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index 555d4f6df428..a363cc369464 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -1030,7 +1030,7 @@ static void _encode_string(const String &p_string, uint8_t *&buf, int &r_len) { } Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bool p_full_objects, int p_depth) { - ERR_FAIL_COND_V_MSG(p_depth > Variant::MAX_RECURSION_DEPTH, ERR_OUT_OF_MEMORY, "Potential inifite recursion detected. Bailing."); + ERR_FAIL_COND_V_MSG(p_depth > Variant::MAX_RECURSION_DEPTH, ERR_OUT_OF_MEMORY, "Potential infinite recursion detected. Bailing."); uint8_t *buf = r_buffer; r_len = 0; diff --git a/core/string/string_name.h b/core/string/string_name.h index f767f3e1ec04..6f08d3298171 100644 --- a/core/string/string_name.h +++ b/core/string/string_name.h @@ -188,7 +188,7 @@ StringName _scs_create(const char *p_chr, bool p_static = false); * - Control::get_theme_*( and Window::get_theme_*( functions. * - emit_signal(,..) function * - call_deferred(,..) function - * - Comparisons to a StringName in overriden _set and _get methods. + * - Comparisons to a StringName in overridden _set and _get methods. * * Use in places that can be called hundreds of times per frame (or more) is recommended, but this situation is very rare. If in doubt, do not use. */ diff --git a/doc/classes/EngineDebugger.xml b/doc/classes/EngineDebugger.xml index 0e1bf99afc45..3c2f735e72f9 100644 --- a/doc/classes/EngineDebugger.xml +++ b/doc/classes/EngineDebugger.xml @@ -67,7 +67,7 @@ - Registers a profiler with the given [code]name[/code]. See [EngineProfiler] for more informations. + Registers a profiler with the given [code]name[/code]. See [EngineProfiler] for more information. diff --git a/doc/classes/EngineProfiler.xml b/doc/classes/EngineProfiler.xml index 88780b1a4192..60817338b849 100644 --- a/doc/classes/EngineProfiler.xml +++ b/doc/classes/EngineProfiler.xml @@ -5,7 +5,7 @@ This class can be used to implement custom profilers that are able to interact with the engine and editor debugger. - See [EngineDebugger] and [EditorDebuggerPlugin] for more informations. + See [EngineDebugger] and [EditorDebuggerPlugin] for more information. @@ -24,7 +24,7 @@ - Called once every engine iteration when the profiler is active with informations about the current frame. + Called once every engine iteration when the profiler is active with information about the current frame. diff --git a/doc/classes/FontData.xml b/doc/classes/FontData.xml index 55b715c3fc51..658f7dd34de4 100644 --- a/doc/classes/FontData.xml +++ b/doc/classes/FontData.xml @@ -577,7 +577,7 @@ Font style flags, see [enum TextServer.FontStyle]. - If set to [code]true[/code], auto-hinting is supported and preffered over font built-in hinting. Used by dynamic fonts only. + If set to [code]true[/code], auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only. Font hinting mode. Used by dynamic fonts only. diff --git a/doc/classes/GPUParticles2D.xml b/doc/classes/GPUParticles2D.xml index f97198658e0d..1fde3c8463b6 100644 --- a/doc/classes/GPUParticles2D.xml +++ b/doc/classes/GPUParticles2D.xml @@ -119,7 +119,7 @@ Particle starts with specified color. - Particle starts with specificed [code]CUSTOM[/code] data. + Particle starts with specified [code]CUSTOM[/code] data. diff --git a/doc/classes/GPUParticles3D.xml b/doc/classes/GPUParticles3D.xml index 62ac84607775..fc490eac96b7 100644 --- a/doc/classes/GPUParticles3D.xml +++ b/doc/classes/GPUParticles3D.xml @@ -150,7 +150,7 @@ Particle starts with specified color. - Particle starts with specificed [code]CUSTOM[/code] data. + Particle starts with specified [code]CUSTOM[/code] data. Maximum number of draw passes supported. diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml index b500bd565896..b212cec5f291 100644 --- a/doc/classes/TextServerExtension.xml +++ b/doc/classes/TextServerExtension.xml @@ -557,7 +557,7 @@ - If set to [code]true[/code] auto-hinting is preffered over font built-in hinting. + If set to [code]true[/code] auto-hinting is preferred over font built-in hinting. diff --git a/doc/classes/TranslationServer.xml b/doc/classes/TranslationServer.xml index 6ece42da6b2c..546b7ec242bf 100644 --- a/doc/classes/TranslationServer.xml +++ b/doc/classes/TranslationServer.xml @@ -138,7 +138,7 @@ - Retunrs [code]locale[/code] string standardized to match known locales (e.g. [code]en-US[/code] would be matched to [code]en_US[/code]). + Returns [code]locale[/code] string standardized to match known locales (e.g. [code]en-US[/code] would be matched to [code]en_US[/code]). diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 7a60ca9fa6f5..e1dc97240a5a 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -55,7 +55,7 @@ - Returns the mouse's positon in this [Viewport] using the coordinate system of this [Viewport]. + Returns the mouse's position in this [Viewport] using the coordinate system of this [Viewport]. @@ -128,7 +128,7 @@ - Removes the focus from the currently focussed [Control] within this viewport. If no [Control] has the focus, does nothing. + Removes the focus from the currently focused [Control] within this viewport. If no [Control] has the focus, does nothing. diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index 68f3b66f4370..365beb434b63 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -536,19 +536,19 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S # Inheritance tree # Ascendants if class_def.inherits: - inh = class_def.inherits.strip() + inherits = class_def.inherits.strip() f.write("**" + translate("Inherits:") + "** ") first = True - while inh in state.classes: + while inherits in state.classes: if not first: f.write(" **<** ") else: first = False - f.write(make_type(inh, state)) - inode = state.classes[inh].inherits + f.write(make_type(inherits, state)) + inode = state.classes[inherits].inherits if inode: - inh = inode.strip() + inherits = inode.strip() else: break f.write("\n\n") diff --git a/doc/translations/classes.pot b/doc/translations/classes.pot index a802e3a7ac7e..ca8bc21508c4 100644 --- a/doc/translations/classes.pot +++ b/doc/translations/classes.pot @@ -34818,7 +34818,7 @@ msgstr "" #: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml msgid "" "The minimal amount of time for which this agent's velocities, that are " -"computed with the collision avoidance algorithim, are safe with respect to " +"computed with the collision avoidance algorithm, are safe with respect to " "other agents. The larger the number, the sooner the agent will respond to " "other agents, but the less freedom in choosing its velocities. Must be " "positive." diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp index 689d76ba26c5..1aa1bfddc87a 100644 --- a/drivers/vulkan/vulkan_context.cpp +++ b/drivers/vulkan/vulkan_context.cpp @@ -860,7 +860,7 @@ Error VulkanContext::_create_physical_device(VkSurfaceKHR p_surface) { free(device_queue_props); print_verbose(" #" + itos(i) + ": " + vendor + " " + name + " - " + (present_supported ? "Supported" : "Unsupported") + ", " + dev_type); - if (present_supported) { // Select first supported device of preffered type: Discrete > Integrated > Virtual > CPU > Other. + if (present_supported) { // Select first supported device of preferred type: Discrete > Integrated > Virtual > CPU > Other. switch (props.deviceType) { case VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU: { if (type_selected < 4) { diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 321b69e20ff5..54b6aa537f0b 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -159,7 +159,7 @@ void editor_register_and_generate_icons(Ref p_theme, bool p_dark_theme = ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ffffff", "#414141"); // Pure white ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#000000", "#bfbfbf"); // Pure black - // Keep pure RGB colors as is, but list them for explicity. + // Keep pure RGB colors as is, but list them for explicitly. ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ff0000", "#ff0000"); // Pure red ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#00ff00", "#00ff00"); // Pure green ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#0000ff", "#0000ff"); // Pure blue diff --git a/misc/hooks/pre-commit-black b/misc/hooks/pre-commit-black index 8e22e6068e70..fd93bfe73c23 100755 --- a/misc/hooks/pre-commit-black +++ b/misc/hooks/pre-commit-black @@ -139,11 +139,11 @@ fi while true; do if [ $terminal = "0" ] ; then if [ -x "$ZENITY" ] ; then - ans=$($ZENITY --text-info --filename="$patch" --width=800 --height=600 --title="Do you want to apply that patch?" --ok-label="Apply" --cancel-label="Do not apply" --extra-button="Apply and stage") + choice=$($ZENITY --text-info --filename="$patch" --width=800 --height=600 --title="Do you want to apply that patch?" --ok-label="Apply" --cancel-label="Do not apply" --extra-button="Apply and stage") if [ "$?" = "0" ] ; then yn="Y" else - if [ "$ans" = "Apply and stage" ] ; then + if [ "$choice" = "Apply and stage" ] ; then yn="S" else yn="N" @@ -151,10 +151,10 @@ while true; do fi elif [ -x "$XMSG" ] ; then $XMSG -file "$patch" -buttons "Apply":100,"Apply and stage":200,"Do not apply":0 -center -default "Do not apply" -geometry 800x600 -title "Do you want to apply that patch?" - ans=$? - if [ "$ans" = "100" ] ; then + choice=$? + if [ "$choice" = "100" ] ; then yn="Y" - elif [ "$ans" = "200" ] ; then + elif [ "$choice" = "200" ] ; then yn="S" else yn="N" @@ -162,10 +162,10 @@ while true; do elif [ \( \( "$OSTYPE" = "msys" \) -o \( "$OSTYPE" = "win32" \) \) -a \( -x "$PWSH" \) ]; then winmessage="$(canonicalize_filename "./.git/hooks/winmessage.ps1")" $PWSH -noprofile -executionpolicy bypass -file "$winmessage" -file "$patch" -buttons "Apply":100,"Apply and stage":200,"Do not apply":0 -center -default "Do not apply" -geometry 800x600 -title "Do you want to apply that patch?" - ans=$? - if [ "$ans" = "100" ] ; then + choice=$? + if [ "$choice" = "100" ] ; then yn="Y" - elif [ "$ans" = "200" ] ; then + elif [ "$choice" = "200" ] ; then yn="S" else yn="N" diff --git a/misc/hooks/pre-commit-clang-format b/misc/hooks/pre-commit-clang-format index de5d9c3f0600..2ee3f569d52c 100755 --- a/misc/hooks/pre-commit-clang-format +++ b/misc/hooks/pre-commit-clang-format @@ -179,11 +179,11 @@ fi while true; do if [ $terminal = "0" ] ; then if [ -x "$ZENITY" ] ; then - ans=$($ZENITY --text-info --filename="$patch" --width=800 --height=600 --title="Do you want to apply that patch?" --ok-label="Apply" --cancel-label="Do not apply" --extra-button="Apply and stage") + choice=$($ZENITY --text-info --filename="$patch" --width=800 --height=600 --title="Do you want to apply that patch?" --ok-label="Apply" --cancel-label="Do not apply" --extra-button="Apply and stage") if [ "$?" = "0" ] ; then yn="Y" else - if [ "$ans" = "Apply and stage" ] ; then + if [ "$choice" = "Apply and stage" ] ; then yn="S" else yn="N" @@ -191,10 +191,10 @@ while true; do fi elif [ -x "$XMSG" ] ; then $XMSG -file "$patch" -buttons "Apply":100,"Apply and stage":200,"Do not apply":0 -center -default "Do not apply" -geometry 800x600 -title "Do you want to apply that patch?" - ans=$? - if [ "$ans" = "100" ] ; then + choice=$? + if [ "$choice" = "100" ] ; then yn="Y" - elif [ "$ans" = "200" ] ; then + elif [ "$choice" = "200" ] ; then yn="S" else yn="N" @@ -202,10 +202,10 @@ while true; do elif [ \( \( "$OSTYPE" = "msys" \) -o \( "$OSTYPE" = "win32" \) \) -a \( -x "$PWSH" \) ]; then winmessage="$(canonicalize_filename "./.git/hooks/winmessage.ps1")" $PWSH -noprofile -executionpolicy bypass -file "$winmessage" -file "$patch" -buttons "Apply":100,"Apply and stage":200,"Do not apply":0 -center -default "Do not apply" -geometry 800x600 -title "Do you want to apply that patch?" - ans=$? - if [ "$ans" = "100" ] ; then + choice=$? + if [ "$choice" = "100" ] ; then yn="Y" - elif [ "$ans" = "200" ] ; then + elif [ "$choice" = "200" ] ; then yn="S" else yn="N" diff --git a/misc/scripts/codespell.sh b/misc/scripts/codespell.sh new file mode 100644 index 000000000000..2822c6421bd5 --- /dev/null +++ b/misc/scripts/codespell.sh @@ -0,0 +1,5 @@ +#!/bin/sh +SKIP_LIST="./thirdparty,*.gen.*,*.po,*.pot,package-lock.json,./core/string/locales.h,./DONORS.md,./misc/scripts/codespell.sh" +IGNORE_LIST="ba,childs,curvelinear,expct,fave,findn,gird,inout,lod,nd,numer,ois,ro,statics,te,varn" + +codespell -w -q 3 -S "${SKIP_LIST}" -L "${IGNORE_LIST}" diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index 0056fee7a459..a3dcfddc7f8f 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -3373,9 +3373,9 @@ Error GLTFDocument::_serialize_materials(Ref state) { orm_texture_index = _set_texture(state, orm_texture); } if (has_ao) { - Dictionary ot; - ot["index"] = orm_texture_index; - d["occlusionTexture"] = ot; + Dictionary occt; + occt["index"] = orm_texture_index; + d["occlusionTexture"] = occt; } if (has_roughness || has_metalness) { mrt["index"] = orm_texture_index; diff --git a/modules/text_server_adv/script_iterator.cpp b/modules/text_server_adv/script_iterator.cpp index 9e3d9138d079..06e934c67dd0 100644 --- a/modules/text_server_adv/script_iterator.cpp +++ b/modules/text_server_adv/script_iterator.cpp @@ -82,7 +82,7 @@ ScriptIterator::ScriptIterator(const String &p_string, int p_start, int p_length paren_stack[paren_sp].pair_index = ch; paren_stack[paren_sp].script_code = script_code; } else if (paren_sp >= 0) { - // If it's a close character, find the matching open on the stack, and use that script code. Any non-matching open characters above it on the stack will be poped. + // If it's a close character, find the matching open on the stack, and use that script code. Any non-matching open characters above it on the stack will be popped. UChar32 paired_ch = u_getBidiPairedBracket(ch); while (paren_sp >= 0 && paren_stack[paren_sp].pair_index != paired_ch) { paren_sp -= 1; diff --git a/modules/visual_script/editor/visual_script_property_selector.cpp b/modules/visual_script/editor/visual_script_property_selector.cpp index bba54106292f..cf0111ee7c17 100644 --- a/modules/visual_script/editor/visual_script_property_selector.cpp +++ b/modules/visual_script/editor/visual_script_property_selector.cpp @@ -493,7 +493,7 @@ VisualScriptPropertySelector::VisualScriptPropertySelector() { hbox->add_child(scope_combo); search_box = memnew(LineEdit); - search_box->set_tooltip(TTR("Enter \" \" to show all filterd options\nEnter \".\" to show all filterd methods, operators and constructors\nUse CTRL_KEY to drop property setters")); + search_box->set_tooltip(TTR("Enter \" \" to show all filtered options\nEnter \".\" to show all filtered methods, operators and constructors\nUse CTRL_KEY to drop property setters")); search_box->set_custom_minimum_size(Size2(200, 0) * EDSCALE); search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); search_box->connect("text_changed", callable_mp(this, &VisualScriptPropertySelector::_update_results_s)); @@ -694,7 +694,7 @@ bool VisualScriptPropertySelector::SearchRunner::_phase_match_classes_init() { class_doc.name = selector_ui->base_script; class_doc.inherits = script->get_instance_base_type(); - class_doc.brief_description = ".vs files not suported by EditorHelp::get_doc_data()"; + class_doc.brief_description = ".vs files not supported by EditorHelp::get_doc_data()"; class_doc.description = ""; Object *obj = ObjectDB::get_instance(script->get_instance_id()); @@ -711,9 +711,9 @@ bool VisualScriptPropertySelector::SearchRunner::_phase_match_classes_init() { class_doc.signals.push_back(_get_method_doc(S->get())); } - List propertys; - Object::cast_to