This commit is contained in:
Barrett Ruth 2025-09-11 23:57:59 -05:00
parent dcb7debff6
commit 83d3702d3e
3 changed files with 26 additions and 4 deletions

19
.github/workflows/stylua.yml vendored Normal file
View file

@ -0,0 +1,19 @@
name: Stylua
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
stylua:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --check .

View file

@ -34,18 +34,18 @@ local function setup_python_env()
end end
if vim.fn.isdirectory(venv_dir) == 0 then if vim.fn.isdirectory(venv_dir) == 0 then
log('Setting up Python environment for scrapers...') log('setting up Python environment for scrapers...')
local result = vim.fn.system( local result = vim.fn.system(
('cd %s && uv sync'):format(vim.fn.shellescape(plugin_path)) ('cd %s && uv sync'):format(vim.fn.shellescape(plugin_path))
) )
if vim.v.shell_error ~= 0 then if vim.v.shell_error ~= 0 then
log( log(
'Failed to setup Python environment: ' .. result, 'failed to setup Python environment: ' .. result,
vim.log.levels.ERROR vim.log.levels.ERROR
) )
return false return false
end end
log('Python environment setup complete') log('python environment setup complete')
end end
return true return true
@ -56,7 +56,7 @@ local competition_types = { 'atcoder', 'codeforces', 'cses', 'icpc' }
local function setup_contest(contest_type) local function setup_contest(contest_type)
if not vim.tbl_contains(competition_types, contest_type) then if not vim.tbl_contains(competition_types, contest_type) then
log( log(
('Unknown contest type. Available: [%s]'):format( ('unknown contest type. Available: [%s]'):format(
table.concat(competition_types, ', ') table.concat(competition_types, ', ')
), ),
vim.log.levels.ERROR vim.log.levels.ERROR

View file

@ -39,4 +39,7 @@ Using [lazy.nvim](https://github.com/folke/lazy.nvim):
## TODO ## TODO
- vimdocs
- example video
- more flexible setup (more of a question of philosophy)
- USACO support - USACO support