Skip to content

Commit 7df3775

Browse files
committed
feat: initial commit
Release-As: 0.1.0
0 parents  commit 7df3775

30 files changed

Lines changed: 2118 additions & 0 deletions

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
indent_style = space
9+
indent_size = 2
10+
tab_width = 2
11+
12+
[*.lua]
13+
indent_size = 2
14+
15+
[*.md]
16+
trim_trailing_whitespace = false
17+
18+
[Makefile]
19+
indent_style = tab

.github/workflows/ci.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
types: [opened, synchronize]
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
name: lint
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: JohnnyMorganz/stylua-action@v4
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
version: latest
21+
args: --check .
22+
23+
documentation:
24+
runs-on: ubuntu-latest
25+
name: documentation
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 2
30+
31+
- name: setup neovim
32+
uses: rhysd/action-setup-vim@v1
33+
with:
34+
neovim: true
35+
version: stable
36+
37+
- name: generate documentation
38+
run: make documentation-ci
39+
40+
- name: check docs are up-to-date
41+
run: |
42+
git status doc
43+
changed=$(git status --porcelain doc | wc -l | tr -d " ")
44+
if [ "$changed" -ne 0 ]; then
45+
echo "doc/ is out of date — run 'make documentation' and commit the result"
46+
git diff doc
47+
exit 1
48+
fi
49+
50+
tests:
51+
needs:
52+
- lint
53+
- documentation
54+
runs-on: ubuntu-latest
55+
timeout-minutes: 5
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
neovim_version: ['v0.9.5', 'v0.10.3', 'stable', 'nightly']
60+
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- run: date +%F > todays-date
65+
66+
- name: restore cache for today's nightly
67+
uses: actions/cache@v4
68+
with:
69+
path: _neovim
70+
key: ${{ runner.os }}-x64-${{ matrix.neovim_version }}-${{ hashFiles('todays-date') }}
71+
72+
- name: setup neovim
73+
uses: rhysd/action-setup-vim@v1
74+
with:
75+
neovim: true
76+
version: ${{ matrix.neovim_version }}
77+
78+
- name: run tests
79+
run: make test-ci

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
release-please:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: googleapis/release-please-action@v4
16+
id: release
17+
with:
18+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
19+
config-file: release-please-config.json
20+
manifest-file: .release-please-manifest.json
21+
22+
- uses: actions/checkout@v4
23+
if: ${{ steps.release.outputs.release_created }}
24+
25+
- name: tag stable version
26+
if: ${{ steps.release.outputs.release_created }}
27+
run: |
28+
git config user.name "github-actions[bot]"
29+
git config user.email "github-actions[bot]@users.noreply.github.com"
30+
git tag -d stable 2>/dev/null || true
31+
git push origin :refs/tags/stable 2>/dev/null || true
32+
git tag -a stable -m "Last stable release"
33+
git push origin stable

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
deps
2+
**.DS_Store
3+
.luarc.json

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.0"
3+
}

.styluaignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
deps/
2+
**/mini/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Chen Asraf
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
.SUFFIXES:
2+
3+
all:
4+
5+
# runs all the test files.
6+
test:
7+
nvim --version | head -n 1 && echo ''
8+
nvim --headless --noplugin -u ./scripts/minimal_init.lua \
9+
-c "lua require('mini.test').setup()" \
10+
-c "lua MiniTest.run({ execute = { reporter = MiniTest.gen_reporter.stdout({ group_depth = 1 }) } })"
11+
12+
# installs `mini.nvim`, used for both the tests and documentation.
13+
deps:
14+
@mkdir -p deps
15+
git clone --depth 1 https://github.com/echasnovski/mini.nvim deps/mini.nvim
16+
17+
# installs deps before running tests, useful for the CI.
18+
test-ci: deps test
19+
20+
# generates the documentation.
21+
documentation:
22+
nvim --headless --noplugin -u ./scripts/minimal_init.lua -c "luafile ./scripts/docgen.lua" -c "qa!"
23+
24+
# installs deps before running the documentation generation, useful for the CI.
25+
documentation-ci: deps documentation
26+
27+
# performs a lint check and fixes issues if possible, following the config in `stylua.toml`.
28+
lint:
29+
stylua .
30+
31+
# installs the repo pre-commit hook that runs `make precommit` before every commit.
32+
precommit-install:
33+
@mkdir -p .git/hooks
34+
@printf '#!/usr/bin/env bash\nmake precommit\n' > .git/hooks/pre-commit
35+
@chmod +x .git/hooks/pre-commit
36+
@echo "pre-commit hook installed at .git/hooks/pre-commit"
37+
38+
# runs the pre-commit checks: lints all Lua files (auto-fixing anything that
39+
# isn't formatted), regenerates docs, and re-stages any files that changed.
40+
precommit:
41+
@set -eu; \
42+
if command -v stylua >/dev/null 2>&1; then \
43+
stylua .; \
44+
reformatted=$$(git diff --name-only -- '*.lua'); \
45+
if [ -n "$$reformatted" ]; then \
46+
echo "precommit: re-staging stylua-formatted files:"; \
47+
echo "$$reformatted" | sed 's/^/ /'; \
48+
git add $$reformatted; \
49+
fi; \
50+
stylua --check .; \
51+
else \
52+
echo "precommit: stylua not installed; skipping lint" >&2; \
53+
fi; \
54+
$(MAKE) documentation; \
55+
git add doc
56+
57+
clean:
58+
rm -rf deps

0 commit comments

Comments
 (0)