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
47 changes: 47 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Linting and style checking

on:
push:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.actor }}
cancel-in-progress: true

jobs:
stylua:
name: Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: v2.1.0
# CLI arguments
args: --color always --respect-ignores --check .

gendoc:
name: Document generation
runs-on: ubuntu-latest
steps:
- name: Install Neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: v0.11.3
- uses: actions/checkout@v4
- name: Generate documentation
run: make --silent documentation
- name: Check for changes
run: if [[ -n $(git status -s) ]]; then exit 1; fi

case-sensitivity:
name: File case sensitivity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check Case Sensitivity
uses: credfeto/action-case-checker@v1.2.1
6 changes: 6 additions & 0 deletions .stylua.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
column_width = 120
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferDouble"
call_parentheses = "Always"
39 changes: 39 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Contributing

## Adding a Python Dependency Backend

Within `detect.lua` is a table called `check_paths` and `check_paths_ordered_keys`

You can have either a file or pattern here to detect the python dependency program (i.e `pip` or `uv`)
which has a callback function to do the install.

`check_paths_ordered_keys` is the order of the table of precedence when detecting

## Snippets

`snip/init.lua` has a table of LuaSnip snippets.

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_*`

## Tests

Tests are ran by [mini.nvim](https://github.com/echasnovski/mini.nvim) tests [module](https://github.com/echasnovski/mini.nvim/blob/main/TESTING.md).

You can run tests just by running `make test`

## Documentation

Docs are generated by [mini.nvim](https://github.com/echasnovski/mini.nvim) docs [module](https://github.com/echasnovski/mini.doc).

Can be updated by running `make documentation`

## Lint

Checked by `stylua`

Run `make lint` to check status and `make lint-fix` to have stylua make changes.

## Examples

In the `examples` directory, you can find mock python projects to test dependency backends.
These can be used for local and automation testing.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ test: deps test_requirements
test_file: deps test_requirements
nvim --headless --noplugin -u ./scripts/minimal_init.lua -c "lua MiniTest.run_file('$(FILE)')"

documentation: deps/mini.nvim
nvim --headless --noplugin -u ./scripts/minimal_init.lua -c "lua require('mini.doc').generate()" -c "qa!"

lint:
stylua --color always --respect-ignores --check .

lint-fix:
stylua --color always --respect-ignores .

# Install all test dependencies
deps: deps/mini.nvim \
deps/nvim-dap \
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Python Tools for Neovim

> [!WARNING]
> This plugin is currently in beta status and can be subject to breaking changes
> Please file issues when found and feel free to contribute

https://github.com/user-attachments/assets/025f8475-e946-4875-bc91-53508ea5d3fa

## Installation
Expand Down
Loading
Loading