Contributing and donating¶
Contributing¶
Bug reports, ideas, docs fixes and pull requests are welcome.
- Read CONTRIBUTING.md for the development setup (an isolated
NVIM_APPNAMEcopy), where things live, StyLua, how to test and the commit style. - Use the issue templates for bugs and feature requests.
- Questions and chat: Discord.
Editing these docs¶
The docs are Markdown files in docs/ and are built with Zensical, which reads mkdocs.yml (English) and mkdocs-fa.yml (Persian). To preview locally:
python3 -m venv .venv
.venv/bin/pip install -r docs/requirements.txt
.venv/bin/zensical serve # http://localhost:8000
.venv/bin/zensical build --strict
.venv/bin/zensical build --strict -f mkdocs-fa.yml # Persian pages (docs/fa/), into site/fa/
Pushing to main publishes the site to GitHub Pages (.github/workflows/docs.yml) and rebuilds the whole GitHub wiki from the same files (scripts/sync-wiki.sh, .github/workflows/sync-wiki.yml): every page in the nav of mkdocs.yml and mkdocs-fa.yml becomes a wiki page, with a generated sidebar and footer. A new page needs a wiki name in PAGE_NAMES in scripts/wiki/build_wiki.py. Preview the wiki pages with ./scripts/sync-wiki.sh --build-only /tmp/wiki. Don't edit the wiki directly; the next sync overwrites it.
Zensical checks links and anchors with --strict. It does not warn about a page that is missing from the nav; the wiki build does, so run it too when you add a page.
Install tests¶
.github/workflows/install.yml installs CodeArt from scratch the way the Installation page says, on Ubuntu, Debian, Fedora, Arch Linux and Alpine (containers), macOS and Windows, on every push and pull request to main, by hand and once a week. The steps are in scripts/ci/fresh_install.sh (clone, installer, :Lazy restore, scripts/ci/install_check.lua, the smoke test, a clean git status). Run one distribution locally with Docker or Podman from your checkout:
podman run --rm -e CI=1 -v "$PWD:/src" archlinux:latest \
sh -c 'pacman -Sy --noconfirm git && bash /src/scripts/ci/fresh_install.sh /src'
fresh_install.sh clones the checkout's committed HEAD, so commit (or stash into a commit) what you want to test. CODEART_LANGUAGES picks other packs (default lua python).
Tests on macOS and Windows¶
The settings tests jobs in .github/workflows/ci.yml run scripts/ci/settings_test.lua on macOS and Windows as well as Ubuntu. Run fixtures whose program is missing (make, npm, cmake) are skipped there. Both jobs must pass. On Windows, Neovim keeps its state in <app name>-data, git may rewrite line endings (the test sets core.autocrlf=false), and a terminal task's output can be lost, so the tests allow for those. When a test cannot work on one OS, skip it in the test with a reason instead of leaving the job red.
Language pack tests¶
.github/workflows/packs.yml checks one language pack per job on Ubuntu: it installs the pack's runtime, sets languages = { "<pack>" }, runs scripts/ci/install_check.lua (Mason installs, :checkhealth codeart, servers attach) and then scripts/ci/pack_check.lua on the pack's fixture in scripts/ci/fixtures/packs/<pack>/: its parsers load, its servers attach, formatting gives the expected text, its run templates are offered (and the ones listed run), and its debug adapter is registered. Packs with a neotest fixture also run it. Pull requests run the packs they change, or all of them when shared code changes; the weekly run and a run by hand (with a packs input) check every pack. A few packs also run on macOS and Windows.
Run it locally in a sandbox with the pack's tools installed:
nvim --headless --cmd "luafile scripts/ci/pack_check.lua"
A check whose program is not on PATH is skipped; CODEART_PACK_STRICT=1 (set in CI) fails instead. A pack without a fixture is skipped.
Startup budget¶
The startup budget job in .github/workflows/ci.yml runs scripts/ci/startup_budget.lua on an Ubuntu runner with the default settings: the median of 20 headless nvim --startuptime runs (after 3 warm-up runs) for the dashboard and for opening a Lua file, and the number of plugins loaded at startup. The table goes to the job summary.
| Start | Time budget | Most plugins loaded | Reference (2.6, 8-core Linux box) |
|---|---|---|---|
nvim (dashboard) |
100 ms | 6 | 21 ms, 3 of 47 |
nvim lua/codeart/options.lua |
350 ms | 25 | 110 ms, 20 of 47 |
The time budgets leave room for slow and noisy CI runners; the plugin counts catch a plugin that stops lazy-loading even on a fast runner. Run it yourself from the config folder with nvim -l scripts/ci/startup_budget.lua (STARTUP_RUNS, STARTUP_BUDGET_DASHBOARD_MS, STARTUP_BUDGET_FILE_MS, STARTUP_MAX_PLUGINS_DASHBOARD and STARTUP_MAX_PLUGINS_FILE change it). Raise a budget in ci.yml only for a deliberate change, and say why in the pull request.
The same job then runs scripts/ci/first_use_budget.lua, which times the first use of lazily loaded features in a fresh Neovim (the median of 7 runs, timed inside Neovim): the run templates of every pack as the first :CodeArtRun builds them (250 ms), :CodeArtLanguages (50 ms), the :CodeArtProjects list (50 ms) and :checkhealth codeart (1000 ms). On an Apple M-series Mac these take 45, 0.5, 1.4 and 96 ms. FIRST_USE_RUNS and FIRST_USE_BUDGET_<ID> (RUN, LANGUAGES, PROJECTS, HEALTH) change it.
Releases¶
Releases are made by hand; the steps are in the Release checklist.
Re-recording the demo GIF and screenshots¶
The README GIF and the screenshots in docs/assets/screenshots/ are recorded with vhs in an isolated sandbox, so they never touch your own config:
./scripts/demo/setup.sh # builds /tmp/codeart-demo
vhs scripts/demo/demo.tape # writes docs/assets/demo.gif
vhs scripts/demo/screenshots.tape # raw PNGs in /tmp/codeart-demo/shots/
./scripts/demo/optimize.sh # compressed PNGs in docs/assets/screenshots/
It needs JetBrainsMono Nerd Font, and ImageMagick for optimize.sh.
Donate¶
If CodeArt is useful to you, you can support its development with a crypto donation (USDT on TRC20, BTC or ETH). GitHub Sponsors is not available to developers in Iran, so the addresses are in DONATE.md. Starring the repo and sharing it helps a lot too.