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 <giulio.lettieri@gmail.com>

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
This commit is contained in:
Luke aka SwissalpS 2024-01-21 22:30:59 +01:00 committed by GitHub
parent 0383e17475
commit 8cf40de860
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 9 deletions

View File

@ -28,7 +28,7 @@ function dirwatch:scan(directory, bool)
end end
-- Should be called on every directory in a subdirectory. -- 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 -- but code should be called anyway, so we can ensure that we have a proper
-- experience across all platforms. Should be an absolute path. -- experience across all platforms. Should be an absolute path.
-- Can also be called on individual files, though this should be used sparingly, -- 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... -- config.ignore_files could be a simple string...
if type(ipatterns) ~= "table" then ipatterns = {ipatterns} end if type(ipatterns) ~= "table" then ipatterns = {ipatterns} end
for i, pattern in ipairs(ipatterns) do 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 if pcall(string.match, "a", pattern) then
table.insert(compiled, { table.insert(compiled, {
use_path = pattern:match("/[^/$]"), -- contains a slash but not at the end 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 match_dir = pattern:match(".+/%$?$"), -- to be used as a boolen value
pattern = pattern -- get the actual pattern pattern = pattern -- get the actual pattern
}) })
@ -175,11 +175,12 @@ end
-- compute a file's info entry completed with "filename" to be used -- 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 function get_project_file_info(root, file, ignore_compiled)
local info = system.get_file_info(root .. PATHSEP .. file) 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 -- In some cases info.type is nil even if info is valid.
-- a directory, for example for /dev/* entries on linux. -- This happens when it is neither a file nor a directory,
-- for example /dev/* entries on linux.
if info and info.type then if info and info.type then
info.filename = file info.filename = file
return fileinfo_pass_filter(info, ignore_compiled) and info return fileinfo_pass_filter(info, ignore_compiled) and info
@ -191,7 +192,7 @@ end
-- "path" will be a path starting without '/' and without trailing '/' -- "path" will be a path starting without '/' and without trailing '/'
-- or the empty string. -- or the empty string.
-- It identifies a sub-path within "root". -- 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. -- 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 -- 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 '/'. -- complete file path relative to "root" *without* the trailing '/', and without the starting '/'.

View File

@ -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.command_view, {y = true})
cur_node = cur_node:split("down", core.status_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() command.add_defaults()
-- Load user module, plugins and project module -- Load user module, plugins and project module
@ -786,7 +786,7 @@ function core.init()
end end
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() local plugins_success, plugins_refuse_list = core.load_plugins()
do do