Skip to content

Commit

Permalink
feat: add typechecks
Browse files Browse the repository at this point in the history
  • Loading branch information
Willem Jan Noort committed Jun 9, 2024
1 parent 01db4a5 commit 919bd96
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Type Check Code Base
on:
pull_request: ~
push:
branches:
- master

jobs:
build:
name: Type Check Code Base
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Type Check Code Base
uses: mrcjkb/lua-typecheck-action@v0
with:
directories: |
lua
tests
2 changes: 2 additions & 0 deletions lua/ado/marker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ local M = {
local Path = require("plenary.path")

---Get open file paths with bufnrs
---@diagnostic disable-next-line: undefined-doc-name
---@return table<Path, number>
local function get_open_file_paths()
---@diagnostic disable-next-line: undefined-doc-name
---@type table<Path, number>
local open_file_paths = {}
local buffers = vim.api.nvim_list_bufs()
Expand Down
2 changes: 1 addition & 1 deletion lua/ado/project.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ local function format_project_choice(project)
end

---Set project_name in cache file;
---@param project_cache_path Path
---@diagnostic disable-next-line: undefined-doc-name
---@return string|nil err
local function set_project_name_cache(project_cache_path)
local projects, err = require("ado.api").get_projects()
Expand Down
3 changes: 2 additions & 1 deletion lua/ado/utils.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local M = {}
--- Await result of plenary job
---@diagnostic disable-next-line: undefined-doc-name
---@param job Job
---@return unknown
function M.await_result(job)
Expand All @@ -9,7 +10,7 @@ function M.await_result(job)
return result
end
vim.wait(1000, function()
---@diagnostic disable-next-line: missing-return
---@diagnostic disable-next-line: missing-return,undefined-field
result = job:result()
end)
end
Expand Down

0 comments on commit 919bd96

Please sign in to comment.