From aed05d5cebd0695192356cc7828881f344367c1f Mon Sep 17 00:00:00 2001 From: Mika Vilpas Date: Sun, 2 Jun 2024 10:19:32 +0300 Subject: [PATCH] ci: use nvim-typecheck-action for simpler type checking setup --- .github/workflows/.luarc.json | 13 --------- .github/workflows/typecheck.yml | 50 ++++++++------------------------- lua/yazi/types.lua | 6 ++-- 3 files changed, 15 insertions(+), 54 deletions(-) delete mode 100644 .github/workflows/.luarc.json diff --git a/.github/workflows/.luarc.json b/.github/workflows/.luarc.json deleted file mode 100644 index 2334034..0000000 --- a/.github/workflows/.luarc.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", - "Lua.runtime.version": "LuaJIT", - "Lua.runtime.path": ["lua/?.lua", "lua/?/init.lua"], - "Lua.workspace.library": [ - "/home/runner/work/yazi.nvim/yazi.nvim/lua_modules/share/lua/5.1", - "/home/runner/work/yazi.nvim/yazi.nvim/deps/neovim/runtime/lua", - "/home/runner/work/yazi.nvim/yazi.nvim/deps/neodev.nvim/types/stable", - "/home/runner/work/yazi.nvim/yazi.nvim/deps/plenary.nvim" - ], - "Lua.diagnostics.libraryFiles": "Disable", - "Lua.workspace.checkThirdParty": "Disable" -} diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index 3b1482c..f13c817 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -1,50 +1,22 @@ -# copied from https://github.com/nvim-neorg/neorg/blob/1e63f84f04caed4b8831b8122c4ba2e7dbda389f/.github/workflows/typecheck.yml#L17 -name: Type check the code base +--- +name: Type check on: pull_request: ~ push: branches: - - "*" + - master jobs: build: - name: Type Check Code Base + name: Type check runs-on: ubuntu-latest steps: - - name: Checkout Code - uses: actions/checkout@v4.1.6 - - - name: Checkout dependency neodev # get neodev and neovim/runtime for builtin types - uses: actions/checkout@v4.1.6 - with: - repository: "folke/neodev.nvim" - path: "deps/neodev.nvim" - - - name: Checkout dependency plenary - uses: actions/checkout@v4.1.6 - with: - repository: "nvim-lua/plenary.nvim" - path: "deps/plenary.nvim" - - - name: Checkout neovim for type annotations - uses: actions/checkout@v4.1.6 - with: - repository: "neovim/neovim" - path: "deps/neovim" - - - uses: leafo/gh-actions-lua@v10.0.0 # get luarocks dependencies for their types (eg `PathlibPath`) - with: - luaVersion: "5.1" - - uses: leafo/gh-actions-luarocks@v4.3.0 - - name: install dependencies - run: | - luarocks init - luarocks install --only-deps ./*.rockspec - - - name: Typecheck the code base - uses: mrcjkb/lua-typecheck-action@v1.0.0 + - uses: actions/checkout@v4 + - uses: stevearc/nvim-typecheck-action@v2 with: - configpath: .github/workflows/.luarc.json - directories: | - lua + path: lua + level: Information + libraries: + # space separated + https://github.com/nvim-lua/plenary.nvim diff --git a/lua/yazi/types.lua b/lua/yazi/types.lua index e4c8545..3db45ee 100644 --- a/lua/yazi/types.lua +++ b/lua/yazi/types.lua @@ -1,5 +1,7 @@ -- TODO all config properties are optional when given, but mandatory inside the plugin +---@module "plenary.path" + ---@class (exact) YaziConfig ---@field public open_for_directories? boolean ---@field public chosen_file_path? string "the path to a temporary file that will be created by yazi to store the chosen file path" @@ -9,8 +11,8 @@ ---@field public set_keymappings_function? fun(buffer: integer, config: YaziConfig): nil "the function that will set the keymappings for the yazi floating window. It will be called after the floating window is created." ---@field public hooks? YaziConfigHooks ---@field public integrations? YaziConfigIntegrations ----@field public floating_window_scaling_factor? float "the scaling factor for the floating window. 1 means 100%, 0.9 means 90%, etc." ----@field public yazi_floating_window_winblend? float "the transparency of the yazi floating window (0-100). See :h winblend" +---@field public floating_window_scaling_factor? number "the scaling factor for the floating window. 1 means 100%, 0.9 means 90%, etc." +---@field public yazi_floating_window_winblend? number "the transparency of the yazi floating window (0-100). See :h winblend" ---@field public yazi_floating_window_border? any "the type of border to use. See nvim_open_win() for the values your neovim version supports" ---@field public log_level? yazi.LogLevel