Skip to content

Commit ad0bbe9

Browse files
committed
docs: hookup vim-docs, lint, contributing doc
Run code through linter and replace all generic `M = {}` module definitions with more descriptive ones for documentation
1 parent 78f8f4f commit ad0bbe9

40 files changed

+2082
-1221
lines changed

.github/workflows/lint.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Linting and style checking
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.actor }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
stylua:
13+
name: Formatting
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: JohnnyMorganz/stylua-action@v4
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
version: v2.1.0
21+
# CLI arguments
22+
args: --color always --respect-ignores --check .
23+
24+
gendoc:
25+
name: Document generation
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Install Neovim
29+
uses: rhysd/action-setup-vim@v1
30+
with:
31+
neovim: true
32+
version: v0.11.3
33+
- uses: actions/checkout@v4
34+
- name: Generate documentation
35+
run: make --silent documentation
36+
- name: Check for changes
37+
run: if [[ -n $(git status -s) ]]; then exit 1; fi
38+
39+
lintcommit:
40+
name: Lint commits
41+
runs-on: ubuntu-latest
42+
env:
43+
LINTCOMMIT_STRICT: true
44+
steps:
45+
- name: Install Neovim
46+
uses: rhysd/action-setup-vim@v1
47+
with:
48+
neovim: true
49+
version: v0.11.3
50+
- uses: actions/checkout@v4
51+
with:
52+
fetch-depth: 0
53+
ref: ${{ github.event.pull_request.head.sha || github.ref }}
54+
- name: Lint new commits
55+
run: make --silent lintcommit-ci
56+
57+
lint-filename-length:
58+
name: Lint filename lengths
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v4
62+
with:
63+
fetch-depth: 0
64+
ref: ${{ github.event.pull_request.head.sha || github.ref }}
65+
- name: Lint filename legnths
66+
run: make --silent lint-filename-length-ci
67+
68+
case-sensitivity:
69+
name: File case sensitivity
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v4
73+
with:
74+
fetch-depth: 0
75+
- name: Check Case Sensitivity
76+
uses: credfeto/action-case-checker@v1.2.1

.stylua.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
column_width = 120
2+
line_endings = "Unix"
3+
indent_type = "Spaces"
4+
indent_width = 2
5+
quote_style = "AutoPreferDouble"
6+
call_parentheses = "Always"

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Contributing
2+
3+
## Adding a Python Dependency Backend
4+
5+
Within `detect.lua` is a table called `check_paths` and `check_paths_ordered_keys`
6+
7+
You can have either a file or pattern here to detect the python dependency program (i.e `pip` or `uv`)
8+
which has a callback function to do the install.
9+
10+
`check_paths_ordered_keys` is the order of the table of precedence when detecting
11+
12+
## Snippets
13+
14+
`snip/init.lua` has a table of LuaSnip snippets.
15+
16+
You can add to this list and determine if the snippet can activate based on conditions like `is_in_test_file` which only loads snippets while in files with pattern `test_*`
17+
18+
## Tests
19+
20+
Tests are ran by [mini.nvim](https://github.com/echasnovski/mini.nvim) tests [module](https://github.com/echasnovski/mini.nvim/blob/main/TESTING.md).
21+
22+
You can run tests just by running `make test`
23+
24+
## Documentation
25+
26+
Docs are generated by [mini.nvim](https://github.com/echasnovski/mini.nvim) docs [module](https://github.com/echasnovski/mini.doc).
27+
28+
Can be updated by running `make documentation`
29+
30+
## Lint
31+
32+
Checked by `stylua`
33+
34+
Run `make lint` to check status and `make lint-fix` to have stylua make changes.
35+
36+
## Examples
37+
38+
In the `examples` directory, you can find mock python projects to test dependency backends.
39+
These can be used for local and automation testing.

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ test: deps test_requirements
1010
test_file: deps test_requirements
1111
nvim --headless --noplugin -u ./scripts/minimal_init.lua -c "lua MiniTest.run_file('$(FILE)')"
1212

13+
documentation: deps/mini.nvim
14+
nvim --headless --noplugin -u ./scripts/minimal_init.lua -c "lua require('mini.doc').generate()" -c "qa!"
15+
16+
lint:
17+
stylua --color always --respect-ignores --check .
18+
19+
lint-fix:
20+
stylua --color always --respect-ignores .
21+
1322
# Install all test dependencies
1423
deps: deps/mini.nvim \
1524
deps/nvim-dap \

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
Python Tools for Neovim
44

5-
> [!WARNING]
6-
> This plugin is currently in beta status and can be subject to breaking changes
7-
> Please file issues when found and feel free to contribute
8-
95
https://github.com/user-attachments/assets/025f8475-e946-4875-bc91-53508ea5d3fa
106

117
## Installation

0 commit comments

Comments
 (0)