Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 2.09 KB

CONTRIBUTING.md

File metadata and controls

44 lines (33 loc) · 2.09 KB

Contributing

This extension is based on the Template for VS Code Python tools extensions.

Development

Getting Started

  • Install uv
  • Install just, or see the justfile for corresponding commands.
  • Create and activate a virtual environment (e.g., uv venv && source .venv/bin/activate).
  • Install development dependencies (just install).
  • To automatically format the codebase, run: just fmt.
  • To run lint and type checks, run: just check.
  • To run tests, run: just test.

To run the extension, navigate to src/extension.ts and run (F5). You should see the LSP output and Python log messages in the debug console under "Python Server".

Modifying the LSP

  • Clone ruff-lsp to, e.g., ../ruff-lsp.
  • In ../ruff-lsp, run: uv pip install -t ../ruff-vscode/bundled/libs/ -e ..

Using a custom version of ruff

  • Clone ruff to, e.g., /home/ferris/ruff.
  • Run cargo build in the Ruff repository.
  • Set "Ruff: Path" to /home/ferris/ruff/target/debug/ruff in the VS Code settings.

Release

  • Bump the version in package.json and pyproject.toml (use even numbers for stable releases).
  • Bump the ruff and ruff-lsp versions in pyproject.toml.
  • Update the ruff version in the README.md
    • in the Base URLs
    • in "The extension ships with ruff==..."
  • Make sure you have Python 3.7 installed
  • Run uv venv --python 3.7 && source .venv/bin/activate to create a Python 3.7 venv and activate it.
  • Run rm requirements.txt requirements-dev.txt && just lock to update ruff and ruff-lsp.
  • Create a new PR and merge it.
  • Update the Changelog
  • Create a new Release, enter x.x.x (where x.x.x is the new version) into the Choose a tag selector. Click Generate release notes, curate the release notes and publish the release.
  • The Release workflow publishes the extension to the VS Code marketplace.