From 494c8a90a584e7b268919ebc90e320ee4b03b74c Mon Sep 17 00:00:00 2001 From: Sergey Bronnikov Date: Tue, 24 Oct 2023 22:18:04 +0300 Subject: [PATCH] chore: Fix typos in comments and documentation strings (#101) --- src/luacheck/builtin_standards/playdate.lua | 2 +- src/luacheck/format.lua | 2 +- src/luacheck/parser.lua | 2 +- src/luacheck/runner.lua | 2 +- src/luacheck/serializer.lua | 2 +- src/luacheck/stages/detect_uninit_accesses.lua | 2 +- src/luacheck/stages/linearize.lua | 4 ++-- src/luacheck/stages/parse_inline_options.lua | 2 +- src/luacheck/vendor/sha1/init.lua | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/luacheck/builtin_standards/playdate.lua b/src/luacheck/builtin_standards/playdate.lua index bb4b6475..7496d9da 100644 --- a/src/luacheck/builtin_standards/playdate.lua +++ b/src/luacheck/builtin_standards/playdate.lua @@ -35,7 +35,7 @@ local sample = { -- JSON local json = standards.def_fields("decode", "decodeFile", "encode", "encodePretty", "encodeToFile") --- Text Alignement +-- Text Alignment local kTextAlignment = standards.def_fields("left", "center", "right") -- Playdate SDK diff --git a/src/luacheck/format.lua b/src/luacheck/format.lua index 96f39a5f..a9d23c3f 100644 --- a/src/luacheck/format.lua +++ b/src/luacheck/format.lua @@ -6,7 +6,7 @@ local format = {} local color_support = not utils.is_windows or os.getenv("ANSICON") local function get_message_format(warning) - local message_format = assert(stages.warnings[warning.code], "Unkown warning code " .. warning.code).message_format + local message_format = assert(stages.warnings[warning.code], "Unknown warning code " .. warning.code).message_format if type(message_format) == "function" then return message_format(warning) diff --git a/src/luacheck/parser.lua b/src/luacheck/parser.lua index 45271e13..7637e68a 100644 --- a/src/luacheck/parser.lua +++ b/src/luacheck/parser.lua @@ -900,7 +900,7 @@ local function parse_expression_statement(state) if primary_expression.tag == "Call" or primary_expression.tag == "Invoke" then if lhs then - -- The is an assingment, and a call is not valid in lhs. + -- The is an assignment, and a call is not valid in lhs. parse_error(state, "expected call or indexing") else -- This is a call. diff --git a/src/luacheck/runner.lua b/src/luacheck/runner.lua index ce46221d..373fdaf1 100644 --- a/src/luacheck/runner.lua +++ b/src/luacheck/runner.lua @@ -104,7 +104,7 @@ end -- Normalizes inputs and filters inputs using `exclude_files` and `include_files` options. -- Returns an array of prepared input tables. --- Differences between normal and prepated inputs: +-- Differences between normal and prepared inputs: -- * Prepared inputs can't have `rockspec_path` field. -- * Prepared inputs can't have `path` pointing to a directory (unless it has an error). -- * Prepared inputs have `filename` field if possible (copied from `path` if not given). diff --git a/src/luacheck/serializer.lua b/src/luacheck/serializer.lua index bce7c015..91f02be9 100644 --- a/src/luacheck/serializer.lua +++ b/src/luacheck/serializer.lua @@ -110,7 +110,7 @@ local function max_n(t) end -- Serializes a value into buffer. --- `strings` is a table mapping string values to where they first occured or to name of local +-- `strings` is a table mapping string values to where they first occurred or to name of local -- variable used to represent it. -- Array part contains representations of values saved into locals. local function add_value(buffer, strings, value, level) diff --git a/src/luacheck/stages/detect_uninit_accesses.lua b/src/luacheck/stages/detect_uninit_accesses.lua index 3afe8d2a..66c719c4 100644 --- a/src/luacheck/stages/detect_uninit_accesses.lua +++ b/src/luacheck/stages/detect_uninit_accesses.lua @@ -15,7 +15,7 @@ local function detect_uninit_access_in_line(chstate, line) for var, accessing_nodes in pairs(item_var_map) do -- If there are no values at all reaching this access, not even the empty one, -- this item (or a closure containing it) is not reachable from variable definition. - -- It will be reported as unreachable code, no need to report uninitalized accesses in it. + -- It will be reported as unreachable code, no need to report uninitialized accesses in it. if item.used_values[var] then -- If this variable is has only one, empty value then it's already reported as never set, -- no need to report each access. diff --git a/src/luacheck/stages/linearize.lua b/src/luacheck/stages/linearize.lua index 9d4511f9..a3ab5475 100644 --- a/src/luacheck/stages/linearize.lua +++ b/src/luacheck/stages/linearize.lua @@ -57,7 +57,7 @@ function Line:__init(node, parent, value) self.accessed_upvalues = {} -- Maps variables to arrays of mutating items. self.mutated_upvalues = {} - -- Maps variables to arays of setting items. + -- Maps variables to arrays of setting items. self.set_upvalues = {} self.lines = {} self.node = node @@ -729,7 +729,7 @@ function LinState:scan_expr_Function(item, node) end -- Builds linear representation (line) of AST and assigns it as `chstate.top_line`. --- Assings an array of all lines as `chstate.lines`. +-- Assigns an array of all lines as `chstate.lines`. -- Adds warnings for redefined/shadowed locals and unused labels. function stage.run(chstate) local linstate = LinState(chstate) diff --git a/src/luacheck/stages/parse_inline_options.lua b/src/luacheck/stages/parse_inline_options.lua index cab07b48..1da56679 100644 --- a/src/luacheck/stages/parse_inline_options.lua +++ b/src/luacheck/stages/parse_inline_options.lua @@ -239,7 +239,7 @@ local function options_and_boundaries_comparator(t1, t2) end end --- Applies bounadaries withing `inline_options_and_boundaries` to replace them with pop count +-- Applies boundaries within `inline_options_and_boundaries` to replace them with pop count -- instructions in the resulting array. -- Comments on lines with code are popped at the end of line. -- Warns about unpaired push and pop directives. diff --git a/src/luacheck/vendor/sha1/init.lua b/src/luacheck/vendor/sha1/init.lua index 49f95bee..d85db689 100644 --- a/src/luacheck/vendor/sha1/init.lua +++ b/src/luacheck/vendor/sha1/init.lua @@ -8,7 +8,7 @@ local sha1 = { SHA-1 secure hash and HMAC-SHA1 signature computation in Lua, using bit and bit32 modules and Lua 5.3 operators when available and falling back to a pure Lua implementation on Lua 5.1. -Based on code orignally by Jeffrey Friedl and modified by +Based on code originally by Jeffrey Friedl and modified by Eike Decker and Enrique GarcĂ­a Cota.]], _LICENSE = [[ MIT LICENSE