1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 07:50:04 +08:00

Compare commits

...

5 Commits

Author SHA1 Message Date
Eric Wong
ad03e51196 fix(mirror): remove -f opt 2024-07-09 00:14:15 +08:00
Eric Wong
b184f80ae2
build(docker): use new docker repo 2024-07-08 23:20:08 +08:00
Eric Wong
f6f1261486
test(vader): fix vader test 2024-07-08 23:01:40 +08:00
Eric Wong
e6e406c981 build(makefile): update makefile 2024-07-08 22:07:45 +08:00
Eric Wong
5b92e0271d feat(github): add ci files 2024-07-08 22:04:38 +08:00
14 changed files with 120 additions and 8 deletions

0
.ci/detach_plugin.sh Normal file → Executable file
View File

0
.ci/install/linux.sh Normal file → Executable file
View File

0
.ci/script.sh Normal file → Executable file
View File

6
.ci/update_mirror.sh Normal file → Executable file
View File

@ -7,19 +7,19 @@ usage () {
push_gitee()
{
git remote add gitee https://SpaceVimBot:${BOTSECRET}@gitee.com/spacevim/SpaceVim.git
git push gitee master -f
git push gitee master
}
push_gitlab()
{
git remote add gitlab https://SpaceVimBot:${BOTSECRET}@gitlab.com/SpaceVim/SpaceVim.git
git push gitlab master -f
git push gitlab master
}
push_coding()
{
git remote add coding https://spacevim%40outlook.com:${CODINGBOTSECRET}@e.coding.net/spacevim/SpaceVim.git
git push coding master -f
git push coding master
}
main () {

View File

@ -31,4 +31,4 @@ jobs:
context: .
file: docker/Dockerfile
push: true
tags: spacevim/spacevim:latest
tags: wsdjeg2/spacevim:latest

View File

@ -1,6 +1,19 @@
test: build/vader | build
$(VIM_BIN) -Nu test/vimrc $(VIM_Es) -c 'Vader! test/**'
COVIMERAGE=$(shell command -v covimerage 2>/dev/null || echo build/covimerage/bin/covimerage)
test_coverage: $(COVIMERAGE) build/vader | build
$(COVIMERAGE) run --source after --source syntax --source autoload --source colors --source config --source ftplugin $(VIM_BIN) -Nu test/vimrc $(VIM_Es) -c 'Vader! test/**'
$(COVIMERAGE):
$(COVIMERAGE) run --source after --source syntax --source autoload --source colors --source config --source ftplugin $(VIM_BIN) -Nu test/vimrc $(VIM_Es) -c 'Vader! test/**'
build/covimerage:
virtualenv $@
build/covimerage/bin/covimerage: | build/covimerage
build/covimerage/bin/pip install covimerage
build/vader:
git clone --depth 1 https://github.com/junegunn/vader.vim.git $@

View File

@ -1749,7 +1749,6 @@ function! s:lazy_end(...) abort
endfunction
function! SpaceVim#end() abort
let g:_spacevim_mappings_prefixs['[SPC]'] = {'name' : '+SPC prefix'}
let g:_spacevim_mappings_space.t = {'name' : '+Toggles'}
let g:_spacevim_mappings_space.t.h = {'name' : '+Toggles highlight'}
@ -1771,6 +1770,8 @@ function! SpaceVim#end() abort
let g:_spacevim_mappings_space.d = {'name' : '+Debug'}
let g:_spacevim_mappings_space.e = {'name' : '+Errors/Encoding'}
let g:_spacevim_mappings_space.B = {'name' : '+Global buffers'}
function! SpaceVim#end() abort
let &tabline = ' '
if has('timers')
call timer_start(g:spacevim_lazy_conf_timeout, function('s:lazy_end'))

View File

@ -21,3 +21,9 @@ function! SpaceVim#layers#lang#qml#plugins() abort
call add(plugins, [g:_spacevim_root_dir . 'bundle/vim-qml', {'merged' : 0}])
return plugins
endfunction
function! SpaceVim#layers#lang#qml#health() abort
return 1
endfunction

View File

@ -108,7 +108,13 @@ else
" saving cache
function! s:cache() abort
silent call writefile([s:JSON.json_encode(s:project_config)], s:FILE.unify_path(s:cache_path, ':p'))
try
let rst = writefile([s:JSON.json_encode(s:project_config)], s:FILE.unify_path(s:cache_path, ':p'))
if rst !=# 0
call s:LOGGER.info('failed to write cache')
endif
catch
endtry
endfunction
function! s:load_cache() abort

View File

@ -102,7 +102,13 @@ else
let s:project_cache_path = s:FILE.unify_path(g:spacevim_data_dir, ':p') . 'SpaceVim/projects.json'
function! s:cache() abort
call writefile([s:JSON.json_encode(s:project_paths)], s:FILE.unify_path(s:project_cache_path, ':p'))
try
let rst = writefile([s:JSON.json_encode(s:project_paths)], s:FILE.unify_path(s:project_cache_path, ':p'))
if rst !=# 0
call s:LOGGER.info('failed to write cache')
endif
catch
endtry
endfunction
function! s:load_cache() abort

View File

@ -0,0 +1,52 @@
--=============================================================================
-- update-index --- Git update-index command
-- Copyright (c) 2016-2022 Wang Shidong & Contributors
-- Author: Wang Shidong < wsdjeg@outlook.com >
-- URL: https://spacevim.org
-- License: GPLv3
--=============================================================================
local m = {}
local job = require('spacevim.api.job')
local nt = require('spacevim.api.notify')
local log = require('git.log')
local stddata = {}
local function on_exit(id, code, single)
log.debug('git-update-index exit code:' .. code .. ' single:' .. single)
if code == 0 and single == 0 then
if vim.fn.exists(':GitGutter') == 2 then
vim.cmd('GitGutter')
end
nt.notify('git update index done!')
else
nt.notify(table.concat(stddata, '\n'), 'warningmsg')
end
end
local function on_std(id, data)
for _, v in ipairs(data) do
table.insert(stddata, v)
end
end
function m.run(argv)
local cmd = { 'git', 'update-index' }
for _, v in ipairs(argv) do
if v == '%' then
table.insert(cmd, vim.fn.expand('%'))
else
table.insert(cmd, v)
end
end
log.debug('git-update-index cmd:' .. vim.inspect(cmd))
stddata = {}
job.start(cmd, {
on_exit = on_exit,
on_stdout = on_std,
on_stderr = on_std,
})
end
return m

View File

@ -29,6 +29,7 @@ local cmds = {
'rebase',
'stash',
'tag',
'update-index',
}
local supported_commands = {}

23
codecov.yml Normal file
View File

@ -0,0 +1,23 @@
comment: off
codecov:
branch: master
coverage:
status:
patch:
default: false
project:
default: false # disable the default status that measures entire project
api: # declare a new status context "api"
target: 1% # we always want 35% coverage here
paths:
- "autoload/SpaceVim/api/" # only include coverage in "autoload/SpaceVim/api/" folder
plugins: # declare a new status context "api"
target: 15% # we always want 35% coverage here
paths:
- "autoload/SpaceVim/plugins/" # only include coverage in "autoload/SpaceVim/api/" folder
all: # declare a new status context "all"
target: 90% # we always want 35% coverage here
paths:
- "!tests/" # remove all files in "tests/"
- "!bundle/" # remove all files in "tests/"

View File

@ -1248,7 +1248,11 @@ function M.remove_section(name)
vim.g.spacevim_statusline_right = right
vim.opt_local.statusline = M.get(1)
end
function M.health() end
function M.health()
return true
end
function M.init()
local group = vim.api.nvim_create_augroup('spacevim_statusline', { clear = true })
vim.api.nvim_create_autocmd({ 'BufWinEnter', 'WinEnter', 'FileType', 'BufWritePost' }, {