From 8cf40de8603aa500e321429a241a91cf46260a1f Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Sun, 21 Jan 2024 22:30:59 +0100 Subject: [PATCH] Fix comment typos in data/core/{init.lua,dirwatch.lua} (#1549) * comment typo in data/core/init.lua * init.lua reword comment * Update dirwatch.lua Some wording is still whacky, maybe next time * Update dirwatch.lua * clear up can/may be not nil confusion * falsey vs falsy new wording to help out * falsey -> falsy * Update data/core/dirwatch.lua Co-authored-by: Guldoman --------- Co-authored-by: Guldoman --- data/core/dirwatch.lua | 15 ++++++++------- data/core/init.lua | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/data/core/dirwatch.lua b/data/core/dirwatch.lua index d9ac4523..eb8cb2e5 100644 --- a/data/core/dirwatch.lua +++ b/data/core/dirwatch.lua @@ -28,7 +28,7 @@ function dirwatch:scan(directory, bool) end -- Should be called on every directory in a subdirectory. --- In windows, this is a no-op for anything underneath a top-level directory, +-- On Windows, this is a no-op for anything underneath a top-level directory, -- but code should be called anyway, so we can ensure that we have a proper -- experience across all platforms. Should be an absolute path. -- Can also be called on individual files, though this should be used sparingly, @@ -134,11 +134,11 @@ local function compile_ignore_files() -- config.ignore_files could be a simple string... if type(ipatterns) ~= "table" then ipatterns = {ipatterns} end for i, pattern in ipairs(ipatterns) do - -- we ignore malformed pattern that raise an error + -- we ignore malformed patterns that raise an error if pcall(string.match, "a", pattern) then table.insert(compiled, { use_path = pattern:match("/[^/$]"), -- contains a slash but not at the end - -- An '/' or '/$' at the end means we want to match a directory. + -- A '/' or '/$' at the end means we want to match a directory. match_dir = pattern:match(".+/%$?$"), -- to be used as a boolen value pattern = pattern -- get the actual pattern }) @@ -175,11 +175,12 @@ end -- compute a file's info entry completed with "filename" to be used --- in project scan or falsy if it shouldn't appear in the list. +-- in project scan and return it or falsy if it shouldn't appear in the list. local function get_project_file_info(root, file, ignore_compiled) local info = system.get_file_info(root .. PATHSEP .. file) - -- info can be not nil but info.type may be nil if is neither a file neither - -- a directory, for example for /dev/* entries on linux. + -- In some cases info.type is nil even if info is valid. + -- This happens when it is neither a file nor a directory, + -- for example /dev/* entries on linux. if info and info.type then info.filename = file return fileinfo_pass_filter(info, ignore_compiled) and info @@ -191,7 +192,7 @@ end -- "path" will be a path starting without '/' and without trailing '/' -- or the empty string. -- It identifies a sub-path within "root". --- The current path location will therefore always be: root .. path. +-- The current path location will therefore always be: root .. '/' .. path. -- When recursing, "root" will always be the same, only "path" will change. -- Returns a list of file "items". In each item the "filename" will be the -- complete file path relative to "root" *without* the trailing '/', and without the starting '/'. diff --git a/data/core/init.lua b/data/core/init.lua index 58411e3f..76c88846 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -758,7 +758,7 @@ function core.init() cur_node = cur_node:split("down", core.command_view, {y = true}) cur_node = cur_node:split("down", core.status_view, {y = true}) - -- Load defaiult commands first so plugins can override them + -- Load default commands first so plugins can override them command.add_defaults() -- Load user module, plugins and project module @@ -786,7 +786,7 @@ function core.init() end end - -- Load core plugins after user ones to let the user override them + -- Load core and user plugins giving preference to user ones with same name. local plugins_success, plugins_refuse_list = core.load_plugins() do