Skip to content

Commit

Permalink
Check Vim plugin code with Vint
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeinhardt committed Feb 20, 2023
1 parent fe91c30 commit 31581ab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@ jobs:
run: make
- name: Run
run: test -x bin/ql && (bin/ql || true)
vint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
pip install --upgrade pip
pip install vim-vint
- name: Run vint
run: vint .
10 changes: 5 additions & 5 deletions plugin/ql.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let s:cmd = exepath(s:path . '/bin/ql')

if exists('g:ql_command')
let s:cmd = g:ql_command
elseif s:cmd != ''
elseif !empty(s:cmd)
let s:cmd = s:cmd . ' --title "$TITLE"'
elseif executable('ql')
let s:cmd = exepath('ql') . ' --title "$TITLE"'
Expand Down Expand Up @@ -37,13 +37,13 @@ endfunction
function! s:view(...) abort
let argc = a:0

if argc == 0
if argc > 0
let path = a:1
let name = fnamemodify(path, ':t')
else
let name = expand('%:t')
let path = tempname() . '.' . name
silent execute 'write ' . fnameescape(path)
else
let path = a:1
let name = fnamemodify(path, ':t')
endif

if !filereadable(path)
Expand Down

0 comments on commit 31581ab

Please sign in to comment.