From 1d2898f6abb6044b7c5d6123022d3e7c4e3e3dc2 Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Fri, 29 Mar 2024 23:55:53 +1300 Subject: [PATCH] chore(spelling): add codespell pre-commit hook Fixes spelling mistakes identified by it. --- .pre-commit-config.yaml | 5 +++++ addons/gd-plug/plug.gd | 2 +- addons/godot_xterm/native/javascript.Dockerfile | 2 +- addons/godot_xterm/native/src/constants.cpp | 2 +- addons/godot_xterm/native/src/pty_unix.cpp | 2 +- addons/godot_xterm/native/src_old/node_pty/win/conpty.cc | 4 ++-- addons/godot_xterm/native/src_old/node_pty/win/winpty.cc | 2 +- addons/godot_xterm/native/src_old/pty_unix.cpp | 4 ++-- addons/godot_xterm/native/src_old/pty_unix_new.cpp | 2 +- addons/godot_xterm/native/src_old/pty_unix_original.cpp | 4 ++-- addons/godot_xterm/pty.gd | 2 +- docs/CHANGELOG.md | 2 +- examples/retro_term/retro_term.tscn | 6 +++--- misc/gen_3rdparty_notices.sh | 2 +- 14 files changed, 23 insertions(+), 18 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bd19593..3128d1e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,3 +18,8 @@ repos: hooks: - id: gdformat exclude: "^addons/gut/" + - repo: https://github.com/codespell-project/codespell + rev: v2.2.6 + hooks: + - id: codespell + exclude: ".*package-lock.json|.*demo.txt|.*fonts.*LICENSE|.*THIRDPARTY_NOTICES.*|.*.svg" diff --git a/addons/gd-plug/plug.gd b/addons/gd-plug/plug.gd index f5eb8d6..8ec2d91 100644 --- a/addons/gd-plug/plug.gd +++ b/addons/gd-plug/plug.gd @@ -852,7 +852,7 @@ func directory_remove_batch(files, args = {}): if dir.remove(dir.get_current_dir()) == OK: logger.debug("Remove empty directory: %s" % dir.get_current_dir()) # Dumb method to clean empty ancestor directories - logger.debug("Removing emoty ancestor directory for %s..." % dir.get_current_dir()) + logger.debug("Removing empty ancestor directory for %s..." % dir.get_current_dir()) var current_dir = dir.get_current_dir() for i in slash_count: current_dir = current_dir.get_base_dir() diff --git a/addons/godot_xterm/native/javascript.Dockerfile b/addons/godot_xterm/native/javascript.Dockerfile index 69c0157..1560535 100644 --- a/addons/godot_xterm/native/javascript.Dockerfile +++ b/addons/godot_xterm/native/javascript.Dockerfile @@ -1,4 +1,4 @@ -# For convenient building of the library and gdnative export templates targeted at the javacript platform. +# For convenient building of the library and gdnative export templates targeted at the javascript platform. FROM emscripten/emsdk:3.1.14 RUN apt-get update && apt-get install pkg-config python3 -y RUN pip3 install scons==4.4.0 diff --git a/addons/godot_xterm/native/src/constants.cpp b/addons/godot_xterm/native/src/constants.cpp index 8f4fdaf..a3f4027 100644 --- a/addons/godot_xterm/native/src/constants.cpp +++ b/addons/godot_xterm/native/src/constants.cpp @@ -20,7 +20,7 @@ const char* Terminal::FONT_TYPES[4] = { }; const Terminal::KeyMap Terminal::KEY_MAP = { - // Godot does not have seperate scancodes for keypad keys when NumLock is + // Godot does not have separate scancodes for keypad keys when NumLock is // off. We can check the unicode value to determine whether it is off and // set the appropriate scancode. Based on the patch which adds support for // this to TextEdit/LineEdit: diff --git a/addons/godot_xterm/native/src/pty_unix.cpp b/addons/godot_xterm/native/src/pty_unix.cpp index f06c04d..4f5d196 100644 --- a/addons/godot_xterm/native/src/pty_unix.cpp +++ b/addons/godot_xterm/native/src/pty_unix.cpp @@ -377,7 +377,7 @@ Dictionary PTYUnix::fork( } } - // reenable signals + // re-enable signals pthread_sigmask(SIG_SETMASK, &oldmask, NULL); switch (pid) { diff --git a/addons/godot_xterm/native/src_old/node_pty/win/conpty.cc b/addons/godot_xterm/native/src_old/node_pty/win/conpty.cc index ef45707..1fedd61 100644 --- a/addons/godot_xterm/native/src_old/node_pty/win/conpty.cc +++ b/addons/godot_xterm/native/src_old/node_pty/win/conpty.cc @@ -149,7 +149,7 @@ HRESULT CreateNamedPipesAndPseudoConsole(COORD size, DWORD dwFlags, } } - // Failed to find kernel32. This is realy unlikely - honestly no idea how + // Failed to find kernel32. This is really unlikely - honestly no idea how // this is even possible to hit. But if it does happen, fall back to // winpty. return HRESULT_FROM_WIN32(GetLastError()); @@ -180,7 +180,7 @@ static NAN_METHOD(PtyStartProcess) { const bool inheritCursor = Nan::To(info[5]).FromJust(); // use environment 'Path' variable to determine location of - // the relative path that we have recieved (e.g cmd.exe) + // the relative path that we have received (e.g cmd.exe) std::wstring shellpath; if (::PathIsRelativeW(filename.c_str())) { shellpath = path_util::get_shell_path(filename.c_str()); diff --git a/addons/godot_xterm/native/src_old/node_pty/win/winpty.cc b/addons/godot_xterm/native/src_old/node_pty/win/winpty.cc index f3165ad..900f0af 100644 --- a/addons/godot_xterm/native/src_old/node_pty/win/winpty.cc +++ b/addons/godot_xterm/native/src_old/node_pty/win/winpty.cc @@ -147,7 +147,7 @@ static NAN_METHOD(PtyStartProcess) { } // use environment 'Path' variable to determine location of - // the relative path that we have recieved (e.g cmd.exe) + // the relative path that we have received (e.g cmd.exe) std::wstring shellpath; if (::PathIsRelativeW(filename)) { shellpath = path_util::get_shell_path(filename); diff --git a/addons/godot_xterm/native/src_old/pty_unix.cpp b/addons/godot_xterm/native/src_old/pty_unix.cpp index eee269c..6ab34f2 100644 --- a/addons/godot_xterm/native/src_old/pty_unix.cpp +++ b/addons/godot_xterm/native/src_old/pty_unix.cpp @@ -227,7 +227,7 @@ Array PTYUnix::fork(String p_file, int _ignored, PackedStringArray p_args, sigaction(i, &sig_action, NULL); } } - // reenable signals + // re-enable signals pthread_sigmask(SIG_SETMASK, &oldmask, NULL); if (pid) { @@ -677,4 +677,4 @@ void PTYUnix::_bind_methods() { void PTYUnix::_init() {} -#endif \ No newline at end of file +#endif diff --git a/addons/godot_xterm/native/src_old/pty_unix_new.cpp b/addons/godot_xterm/native/src_old/pty_unix_new.cpp index f8f93d9..1043205 100644 --- a/addons/godot_xterm/native/src_old/pty_unix_new.cpp +++ b/addons/godot_xterm/native/src_old/pty_unix_new.cpp @@ -313,7 +313,7 @@ Dictionary fork( free(cwd); } - // reenable signals + // re-enable signals pthread_sigmask(SIG_SETMASK, &oldmask, NULL); switch (pid) { diff --git a/addons/godot_xterm/native/src_old/pty_unix_original.cpp b/addons/godot_xterm/native/src_old/pty_unix_original.cpp index 91d35e5..1637d76 100644 --- a/addons/godot_xterm/native/src_old/pty_unix_original.cpp +++ b/addons/godot_xterm/native/src_old/pty_unix_original.cpp @@ -395,7 +395,7 @@ Napi::Value PtyFork(const Napi::CallbackInfo& info) { } } - // reenable signals + // re-enable signals pthread_sigmask(SIG_SETMASK, &oldmask, NULL); switch (pid) { @@ -785,4 +785,4 @@ Napi::Object init(Napi::Env env, Napi::Object exports) { NODE_API_MODULE(NODE_GYP_MODULE_NAME, init) -#endif \ No newline at end of file +#endif diff --git a/addons/godot_xterm/pty.gd b/addons/godot_xterm/pty.gd index 3fd6a17..e633fcf 100644 --- a/addons/godot_xterm/pty.gd +++ b/addons/godot_xterm/pty.gd @@ -100,7 +100,7 @@ func _set_terminal(value): if _terminal == value: return - # Disconect the current terminal, if any. + # Disconnect the current terminal, if any. if _terminal != null: disconnect("data_received", Callable(_terminal, "write")) _terminal.disconnect("data_sent", Callable(self, "write")) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index bc3b98b..8c2fa21 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -201,5 +201,5 @@ Thanks to [@ConteZero](https://github.com/contezero) for reporting and providing ### Changed - Implementation of Terminal node from GDScript to GDNative using [Aetf's patched version of libtsm](https://github.com/Aetf/libtsm). -- Move input handling to the Terminal node itself, rather than handling it in a seperate Control node. +- Move input handling to the Terminal node itself, rather than handling it in a separate Control node. - The Terminal `write()` method now accepts both String and PoolByteArray. diff --git a/examples/retro_term/retro_term.tscn b/examples/retro_term/retro_term.tscn index 0110ebf..48d5245 100644 --- a/examples/retro_term/retro_term.tscn +++ b/examples/retro_term/retro_term.tscn @@ -34,7 +34,7 @@ uniform bool pixelate = true; // Fill each square (\"pixel\") with a sampled col uniform bool roll = true; uniform float roll_speed = 8.0; // Positive values are down, negative are up uniform float roll_size : hint_range(0.0, 100.0) = 15.0; -uniform float roll_variation : hint_range(0.1, 5.0) = 1.8; // This valie is not an exact science. You have to play around with the value to find a look you like. How this works is explained in the code below. +uniform float roll_variation : hint_range(0.1, 5.0) = 1.8; // This value is not an exact science. You have to play around with the value to find a look you like. How this works is explained in the code below. uniform float distort_intensity : hint_range(0.0, 0.2) = 0.05; // The distortion created by the rolling effect. uniform float noise_opacity : hint_range(0.0, 1.0) = 0.4; @@ -52,7 +52,7 @@ uniform bool clip_warp = false; uniform float vignette_intensity = 0.4; // Size of the vignette, how far towards the middle it should go. uniform float vignette_opacity : hint_range(0.0, 1.0) = 0.5; -// Used by the noise functin to generate a pseudo random value between 0.0 and 1.0 +// Used by the noise function to generate a pseudo random value between 0.0 and 1.0 vec2 random(vec2 uv){ uv = vec2( dot(uv, vec2(127.1,311.7) ), dot(uv, vec2(269.5,183.3) ) ); @@ -193,7 +193,7 @@ void fragment() // We use roll_line (set above) to define how big the noise should be vertically (multiplying cuts off all black parts). // We also add in some basic noise with random() to break up the noise pattern above. The noise is sized according to // the resolution value set in the inspector. If you don't like this look you can - // change \"ceil(uv * resolution) / resolution\" to only \"uv\" to make it less pixelated. Or multiply resolution with som value + // change \"ceil(uv * resolution) / resolution\" to only \"uv\" to make it less pixelated. Or multiply resolution with some value // greater than 1.0 to make them smaller. roll_line *= noise * scanlines * clamp(random((ceil(uv * resolution) / resolution) + vec2(TIME * 0.8, 0.0)).x + 0.8, 0.0, 1.0); // Add it to the texture based on noise_opacity diff --git a/misc/gen_3rdparty_notices.sh b/misc/gen_3rdparty_notices.sh index 64f30c9..fa6ed43 100755 --- a/misc/gen_3rdparty_notices.sh +++ b/misc/gen_3rdparty_notices.sh @@ -9,7 +9,7 @@ out=addons/godot_xterm/THIRDPARTY_NOTICES.txt # List of licenses to be concatenated. -# Format (space seperated): Software name, Path to license file from git repo root. +# Format (space separated): Software name, Path to license file from git repo root. # When compiling with option 'disable_pty=yes' libuv, node-pty and tmux can be omitted. LICENSES=$(cat <<-END godot ./misc/export_templates/godot/LICENSE.txt