mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-14 01:50:27 +00:00
create github actions
- add linter workflow - fix linter errors - finish incomplete function in term.lua - add formatter workflow
This commit is contained in:
parent
375ce5a311
commit
979d39ba25
26
.github/workflows/format.yml
vendored
Normal file
26
.github/workflows/format.yml
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
name: Format
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
format:
|
||||||
|
name: Stylua
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- run: date +%W > weekly
|
||||||
|
|
||||||
|
- name: Restore cache
|
||||||
|
id: cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/bin
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('weekly') }}
|
||||||
|
|
||||||
|
- name: Install
|
||||||
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
|
run: cargo install stylua
|
||||||
|
|
||||||
|
- name: Format
|
||||||
|
run: stylua --check lua/ --config-path=.stylua.toml
|
18
.github/workflows/lint.yml
vendored
Normal file
18
.github/workflows/lint.yml
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
name: Lint
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Luacheck
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Setup
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install luarocks
|
||||||
|
sudo luarocks install luacheck
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: luacheck lua/harpoon
|
10
.luacheckrc
Normal file
10
.luacheckrc
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
std = luajit
|
||||||
|
cache = true
|
||||||
|
codes = true
|
||||||
|
|
||||||
|
globals = {
|
||||||
|
"HarpoonConfig",
|
||||||
|
"Harpoon_bufh",
|
||||||
|
"Harpoon_win_id",
|
||||||
|
}
|
||||||
|
read_globals = { "vim" }
|
@ -1,5 +1,4 @@
|
|||||||
local harpoon = require("harpoon")
|
local harpoon = require("harpoon")
|
||||||
local Path = require("plenary.path")
|
|
||||||
local log = require("harpoon.dev").log
|
local log = require("harpoon.dev").log
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
@ -28,8 +27,20 @@ local function create_terminal()
|
|||||||
return buf_id, term_id
|
return buf_id, term_id
|
||||||
end
|
end
|
||||||
|
|
||||||
function getCmd(idx)
|
M.getCmd = function(idx)
|
||||||
return
|
log.trace("getCmd()")
|
||||||
|
local cmd
|
||||||
|
if type(idx) == "number" then
|
||||||
|
cmd = harpoon.get_term_config().cmds[idx]
|
||||||
|
else
|
||||||
|
log.error("getCmd(): Index is expected to be a number.")
|
||||||
|
end
|
||||||
|
|
||||||
|
if cmd then
|
||||||
|
return cmd
|
||||||
|
else
|
||||||
|
error("Command does not exist for that id.")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function find_terminal(idx)
|
local function find_terminal(idx)
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
-- TODO: Harpooned
|
-- TODO: Harpooned
|
||||||
local Marker = require('harpoon.mark')
|
-- local Marker = require('harpoon.mark')
|
||||||
local eq = assert.are.same
|
-- local eq = assert.are.same
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user