Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/bump-commons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
bump:
name: Lint
name: Bump
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
Expand All @@ -19,9 +19,10 @@ jobs:
git clone --depth=1 https://github.com/linrongbin16/commons.nvim.git ~/.commons.nvim
rm -rf ./lua/colorbox/commons
mkdir -p ./lua/colorbox/commons
cp -rf ~/.commons.nvim/lua/commons/*.lua ./lua/colorbox/commons
cp -rf ~/.commons.nvim/lua/commons ./lua/colorbox
cd ./lua/colorbox/commons
find . -type f -name '*.lua' -exec sed -i 's/require("commons/require("colorbox.commons/g' {} \;
find . -type f -name '*.lua' -exec sed -i "s/require('commons/require('colorbox.commons/g" {} \;
- uses: stefanzweifel/git-auto-commit-action@v5
if: ${{ github.ref != 'refs/heads/master' }}
with:
Expand Down
55 changes: 14 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,47 +38,20 @@ jobs:
run: |
cargo binstall --no-confirm selene
selene --config selene.toml ./lua
# unit_test:
# name: Unit Test
# strategy:
# matrix:
# nvim_version: [stable, nightly]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: rhysd/action-setup-vim@v1
# id: vim
# with:
# neovim: true
# version: ${{ matrix.nvim_version }}
# - uses: leafo/gh-actions-lua@v10
# with:
# # luaVersion: "luajit-2.1.0-beta3"
# luaVersion: "luajit-openresty"
# - uses: leafo/gh-actions-luarocks@v4
# - name: Run Tests
# shell: bash
# run: |
# luarocks install luacov
# luarocks install luacov-reporter-lcov
# luarocks --lua-version=5.1 install vusted
# vusted --coverage ./spec
# echo "ls -l ."
# ls -l .
# - name: Generate Coverage Report
# shell: bash
# run: |
# echo "luacov -r lcov"
# luacov -r lcov
# echo "ls -l ."
# ls -l .
# echo "tail ./luacov.report.out"
# tail -n 10 ./luacov.report.out
# - uses: codecov/codecov-action@v4
# with:
# files: luacov.report.out
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
unit_test:
name: Unit Test
strategy:
matrix:
nvim_version: [stable, nightly]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ matrix.nvim_version }}
- name: Run Test Cases
run: make test
# release:
# name: Release
# if: ${{ github.ref == 'refs/heads/main' }}
Expand Down
10 changes: 0 additions & 10 deletions .luacov

This file was deleted.

4 changes: 3 additions & 1 deletion .luarc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
"inject-field",
"deprecated",
"luadoc-miss-module-name",
"luadoc-miss-symbol",
"undefined-doc-name",
"lowercase-global",
"cast-local-type",
"param-type-mismatch"
"param-type-mismatch",
"missing-return"
],
"runtime.version": "LuaJIT",
"workspace.checkThirdParty": "Disable"
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
TESTS_INIT=spec_init.lua
TESTS_DIR=spec/

.PHONY: test

test:
@nvim \
--headless \
--noplugin \
-u ${TESTS_INIT} \
-c "PlenaryBustedDirectory ${TESTS_DIR} { minimal_init = '${TESTS_INIT}' }"

4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

<p>
<a href="https://github.com/neovim/neovim/releases/"><img alt="require" src="https://img.shields.io/badge/require-stable-blue" /></a>
<a href="https://github.com/linrongbin16/commons.nvim"><img alt="commons.nvim" src="https://img.shields.io/badge/power_by-commons.nvim-pink" /></a>
<!-- <a href="https://luarocks.org/modules/linrongbin16/colorbox.nvim"><img alt="luarocks" src="https://img.shields.io/luarocks/v/linrongbin16/colorbox.nvim" /></a> -->
<a href="https://github.com/linrongbin16/colorbox.nvim/actions/workflows/ci.yml"><img alt="ci.yml" src="https://img.shields.io/github/actions/workflow/status/linrongbin16/colorbox.nvim/ci.yml?label=ci" /></a>
<a href="https://github.com/linrongbin16/colorbox.nvim/actions/workflows/collect.yml"><img alt="collect.yml" src="https://img.shields.io/github/actions/workflow/status/linrongbin16/colorbox.nvim/collect.yml?label=collect" /></a>
<!-- <a href="https://app.codecov.io/github/linrongbin16/colorbox.nvim"><img alt="codecov" src="https://img.shields.io/codecov/c/github/linrongbin16/colorbox.nvim/main?label=codecov" /></a> -->
</p>

Do you want all the **most popular** (Neo)Vim colorschemes than only one? Do you want to change them from time to time?
Expand Down
12 changes: 0 additions & 12 deletions codecov.yml

This file was deleted.

29 changes: 11 additions & 18 deletions lua/colorbox.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
local logging = require("colorbox.commons.logging")
local LogLevels = require("colorbox.commons.logging").LogLevels
local log = require("colorbox.commons.log")
local str = require("colorbox.commons.str")
local tbl = require("colorbox.commons.tbl")

local configs = require("colorbox.configs")
local timing = require("colorbox.timing")
Expand All @@ -13,16 +11,13 @@ local loader = require("colorbox.loader")
--- @param opts colorbox.Options?
local function setup(opts)
local confs = configs.setup(opts)

if not logging.has("colorbox") then
logging.setup({
name = "colorbox",
level = confs.debug and LogLevels.DEBUG or LogLevels.INFO,
console_log = confs.console_log,
file_log = confs.file_log,
file_log_name = "colorbox.log",
})
end
log.setup({
name = "colorbox",
level = confs.debug and vim.log.levels.DEBUG or vim.log.levels.INFO,
use_console = confs.console_log,
use_file = confs.file_log,
file_name = "colorbox.log",
})

-- cache
assert(
Expand All @@ -37,8 +32,6 @@ local function setup(opts)
runtime.setup()

vim.api.nvim_create_user_command(confs.command.name, function(command_opts)
local logger = logging.get("colorbox") --[[@as commons.logging.Logger]]

-- logger.debug(
-- "|colorbox.setup| command opts:%s",
-- vim.inspect(command_opts)
Expand All @@ -51,15 +44,15 @@ local function setup(opts)
-- vim.inspect(args_splits)
-- )
if #args_splits == 0 then
logger:warn("missing parameter.")
log.warn("missing parameter.")
return
end
if vim.is_callable(controller[args_splits[1]]) then
local fn = controller[args_splits[1]]
local sub_args = args:sub(string.len(args_splits[1]) + 1)
fn(sub_args)
else
logger:warn(string.format("unknown parameter %s.", args_splits[1]))
log.warn(string.format("unknown parameter %s.", args_splits[1]))
end
end, {
nargs = "*",
Expand All @@ -80,7 +73,7 @@ local function setup(opts)

vim.api.nvim_create_autocmd("ColorSchemePre", {
callback = function(event)
loader.load(tbl.tbl_get(event, "match"), false)
loader.load(vim.tbl_get(event, "match"), false)
end,
})

Expand Down
Loading