ci: add spell checker and fix existing typo

This commit is contained in:
Zhizhen He
2023-03-19 12:02:38 -04:00
committed by Micah Halter
parent 24b3d0ac15
commit 26d985e1d9
5 changed files with 36 additions and 17 deletions
+13
View File
@@ -0,0 +1,13 @@
name: Spell Check
on: [push, pull_request]
jobs:
typos-check:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v3
- name: Check spelling
uses: crate-ci/typos@v1.13.26
+6
View File
@@ -0,0 +1,6 @@
# See https://github.com/crate-ci/typos/blob/master/docs/reference.md to configure typos
[default.extend-words]
enew = "enew"
fo = "fo"
[files]
extend-exclude = ["LICENSE"]
+1 -1
View File
@@ -19,7 +19,7 @@ function M.is_valid(bufnr)
end
--- Move the current buffer tab n places in the bufferline
-- @param n numer of tabs to move the current buffer over by (positive = right, negative = left)
-- @param n number of tabs to move the current buffer over by (positive = right, negative = left)
function M.move(n)
if n == 0 then return end -- if n = 0 then no shifts are needed
local bufs = vim.t.bufs -- make temp variable
+2 -2
View File
@@ -156,9 +156,9 @@ function M.is_available(plugin)
end
--- A helper function to wrap a module function to require a plugin before running
-- @param plugin the plugin string to call `require("lazy").laod` with
-- @param plugin the plugin string to call `require("lazy").load` with
-- @param module the system module where the functions live (e.g. `vim.ui`)
-- @param func_names a string or a list like table of strings for functions to wrap in the given moduel (e.g. `{ "ui", "select }`)
-- @param func_names a string or a list like table of strings for functions to wrap in the given module (e.g. `{ "ui", "select }`)
function M.load_plugin_with_func(plugin, module, func_names)
if type(func_names) == "string" then func_names = { func_names } end
for _, func in ipairs(func_names) do
+14 -14
View File
@@ -556,7 +556,7 @@ function M.provider.scrollbar(opts)
end
end
--- A provider to simply show a cloes button icon
--- A provider to simply show a close button icon
-- @param opts options passed to the stylize function and the kind of icon to use
-- @return return the stylized icon
-- @usage local heirline_component = { provider = require("astronvim.utils.status").provider.close_button() }
@@ -801,14 +801,14 @@ function M.provider.str(opts)
end
--- A condition function if the window is currently active
-- @return boolean of wether or not the window is currently actie
-- @return boolean of whether or not the window is currently actie
-- @usage local heirline_component = { provider = "Example Provider", condition = require("astronvim.utils.status").condition.is_active }
function M.condition.is_active() return vim.api.nvim_get_current_win() == tonumber(vim.g.actual_curwin) end
--- A condition function if the buffer filetype,buftype,bufname match a pattern
-- @param patterns the table of patterns to match
-- @param bufnr number of the buffer to match (Default: 0 [current])
-- @return boolean of wether or not LSP is attached
-- @return boolean of whether or not LSP is attached
-- @usage local heirline_component = { provider = "Example Provider", condition = function() return require("astronvim.utils.status").condition.buffer_matches { buftype = { "terminal" } } end }
function M.condition.buffer_matches(patterns, bufnr)
for kind, pattern_list in pairs(patterns) do
@@ -818,18 +818,18 @@ function M.condition.buffer_matches(patterns, bufnr)
end
--- A condition function if a macro is being recorded
-- @return boolean of wether or not a macro is currently being recorded
-- @return boolean of whether or not a macro is currently being recorded
-- @usage local heirline_component = { provider = "Example Provider", condition = require("astronvim.utils.status").condition.is_macro_recording }
function M.condition.is_macro_recording() return vim.fn.reg_recording() ~= "" end
--- A condition function if search is visible
-- @return boolean of wether or not searching is currently visible
-- @return boolean of whether or not searching is currently visible
-- @usage local heirline_component = { provider = "Example Provider", condition = require("astronvim.utils.status").condition.is_hlsearch }
function M.condition.is_hlsearch() return vim.v.hlsearch ~= 0 end
--- A condition function if the current file is in a git repo
-- @param bufnr a buffer number to check the condition for, a table with bufnr property, or nil to get the current buffer
-- @return boolean of wether or not the current file is in a git repo
-- @return boolean of whether or not the current file is in a git repo
-- @usage local heirline_component = { provider = "Example Provider", condition = require("astronvim.utils.status").condition.is_git_repo }
function M.condition.is_git_repo(bufnr)
if type(bufnr) == "table" then bufnr = bufnr.bufnr end
@@ -838,7 +838,7 @@ end
--- A condition function if there are any git changes
-- @param bufnr a buffer number to check the condition for, a table with bufnr property, or nil to get the current buffer
-- @return boolean of wether or not there are any git changes
-- @return boolean of whether or not there are any git changes
-- @usage local heirline_component = { provider = "Example Provider", condition = require("astronvim.utils.status").condition.git_changed }
function M.condition.git_changed(bufnr)
if type(bufnr) == "table" then bufnr = bufnr.bufnr end
@@ -848,7 +848,7 @@ end
--- A condition function if the current buffer is modified
-- @param bufnr a buffer number to check the condition for, a table with bufnr property, or nil to get the current buffer
-- @return boolean of wether or not the current buffer is modified
-- @return boolean of whether or not the current buffer is modified
-- @usage local heirline_component = { provider = "Example Provider", condition = require("astronvim.utils.status").condition.file_modified }
function M.condition.file_modified(bufnr)
if type(bufnr) == "table" then bufnr = bufnr.bufnr end
@@ -857,7 +857,7 @@ end
--- A condition function if the current buffer is read only
-- @param bufnr a buffer number to check the condition for, a table with bufnr property, or nil to get the current buffer
-- @return boolean of wether or not the current buffer is read only or not modifiable
-- @return boolean of whether or not the current buffer is read only or not modifiable
-- @usage local heirline_component = { provider = "Example Provider", condition = require("astronvim.utils.status").condition.file_read_only }
function M.condition.file_read_only(bufnr)
if type(bufnr) == "table" then bufnr = bufnr.bufnr end
@@ -867,7 +867,7 @@ end
--- A condition function if the current file has any diagnostics
-- @param bufnr a buffer number to check the condition for, a table with bufnr property, or nil to get the current buffer
-- @return boolean of wether or not the current file has any diagnostics
-- @return boolean of whether or not the current file has any diagnostics
-- @usage local heirline_component = { provider = "Example Provider", condition = require("astronvim.utils.status").condition.has_diagnostics }
function M.condition.has_diagnostics(bufnr)
if type(bufnr) == "table" then bufnr = bufnr.bufnr end
@@ -876,7 +876,7 @@ end
--- A condition function if there is a defined filetype
-- @param bufnr a buffer number to check the condition for, a table with bufnr property, or nil to get the current buffer
-- @return boolean of wether or not there is a filetype
-- @return boolean of whether or not there is a filetype
-- @usage local heirline_component = { provider = "Example Provider", condition = require("astronvim.utils.status").condition.has_filetype }
function M.condition.has_filetype(bufnr)
if type(bufnr) == "table" then bufnr = bufnr.bufnr end
@@ -884,14 +884,14 @@ function M.condition.has_filetype(bufnr)
end
--- A condition function if Aerial is available
-- @return boolean of wether or not aerial plugin is installed
-- @return boolean of whether or not aerial plugin is installed
-- @usage local heirline_component = { provider = "Example Provider", condition = require("astronvim.utils.status").condition.aerial_available }
-- function M.condition.aerial_available() return is_available "aerial.nvim" end
function M.condition.aerial_available() return package.loaded["aerial"] end
--- A condition function if LSP is attached
-- @param bufnr a buffer number to check the condition for, a table with bufnr property, or nil to get the current buffer
-- @return boolean of wether or not LSP is attached
-- @return boolean of whether or not LSP is attached
-- @usage local heirline_component = { provider = "Example Provider", condition = require("astronvim.utils.status").condition.lsp_attached }
function M.condition.lsp_attached(bufnr)
if type(bufnr) == "table" then bufnr = bufnr.bufnr end
@@ -900,7 +900,7 @@ end
--- A condition function if treesitter is in use
-- @param bufnr a buffer number to check the condition for, a table with bufnr property, or nil to get the current buffer
-- @return boolean of wether or not treesitter is active
-- @return boolean of whether or not treesitter is active
-- @usage local heirline_component = { provider = "Example Provider", condition = require("astronvim.utils.status").condition.treesitter_available }
function M.condition.treesitter_available(bufnr)
if not package.loaded["nvim-treesitter"] then return false end