Add your description here
Project description
ruff-jupyter-jetbrains
ruff-jupyter-jetbrains is a python package that is designed to be run as a file watcher tool in JetBrains IDEs to display ruff linting inspections in Jupyter notebooks.
Usage
-
Install the package in your environment, using your package manager of choice. E.g:
uv add --dev ruff-jupyter-jetbrains -
Ensure you have the JetBrains File Watchers plugin enabled.
-
Under Settings > Tools > File Watchers, configure a new file watcher with the following settings:
- File type:
Jupyter Notebook - Program:
uv(or your tool of choice) - Arguments:
run ruff-jupyter-jetbrains $FilePath$ - Show console:
Never(unless you need to debug) - Output Filters:
$FILE_PATH$:$LINE$:$COLUMN$: $MESSAGE$
- File type:
- Set your desired severity level and color scheme under Settings > Editor > Inspections > File watcher problems
Alternative Usage
If you want to keep your project dependencies minimal, you could also use an isolated runner like uvx, without installing the package in your environment. In that case ignore step 1 above and use the following settings instead:
- Program:
uvx - Arguments:
ruff-jupyter-jetbrains $FilePath$
How it works
JetBrains maintains an intermediary notebook representation that differs from the raw notebook JSON content: each cell source appears as is in order and is marked up with a comment line that specifies its type (# %% for code and # %%m for markdown).
In addition, custom JetBrains file watchers can show inspection messages when their output can be parsed into a file path, line, column and message.
With that knowledge the ruff linting output can be used and converted to a format compatible with JetBrains file watchers.
[!WARNING]
This little tool, while functional, is only meant as a workaround. Ideally, this functionality should live in a proper plugin that makes use of the language server protocol. This was motivated by a standing issue in the Ruff plugin and my lack of Kotlin knowledge to fix it at the root.
Development
Setup
Clone the repo:
git clone https://github.com/OliverSieweke/ruff-jupyter-jetbrains.git
This project uses uv as a project manager. To set up the environment, ensure uv is installed and run:
uv sync
To ensure code follows the project’s guidelines, install pre-commit hooks with:
pre-commit install
Code Standards
ruff is used as a formatter and can be run with:
ruff format
ruff is used as a linter and code can be checked with:
ruff check
ty is used as a type checker and code can be checked with:
ty check
Tests are handled by pytest and can be run with:
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ruff_jupyter_jetbrains-1.0.0.tar.gz.
File metadata
- Download URL: ruff_jupyter_jetbrains-1.0.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8af7d96ea7719570c37cc4239a5fbaf37499cd9f41244d3648393685b5b3bd8
|
|
| MD5 |
90857644c37ddf00b382f5b98b60e1fb
|
|
| BLAKE2b-256 |
5b06c227d1d1ebf5b33cf631a2137ca8a6be7b91a18500b5155f60d66f60ef36
|
Provenance
The following attestation bundles were made for ruff_jupyter_jetbrains-1.0.0.tar.gz:
Publisher:
publish.yml on OliverSieweke/ruff-jupyter-jetbrains
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ruff_jupyter_jetbrains-1.0.0.tar.gz -
Subject digest:
e8af7d96ea7719570c37cc4239a5fbaf37499cd9f41244d3648393685b5b3bd8 - Sigstore transparency entry: 692805506
- Sigstore integration time:
-
Permalink:
OliverSieweke/ruff-jupyter-jetbrains@9400381a17cd2fa5566d3f88f8644371396641b0 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/OliverSieweke
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9400381a17cd2fa5566d3f88f8644371396641b0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ruff_jupyter_jetbrains-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ruff_jupyter_jetbrains-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e79890da409b0ba94853267756294533a55d51dc8f3d7ec817d086fdeba5da46
|
|
| MD5 |
dd75fc2bb606c9e660f3e56b235a350e
|
|
| BLAKE2b-256 |
5c3053a9c729335188a263a99a7904926763879bb6dc85e8202cb1213ffc784a
|
Provenance
The following attestation bundles were made for ruff_jupyter_jetbrains-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on OliverSieweke/ruff-jupyter-jetbrains
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ruff_jupyter_jetbrains-1.0.0-py3-none-any.whl -
Subject digest:
e79890da409b0ba94853267756294533a55d51dc8f3d7ec817d086fdeba5da46 - Sigstore transparency entry: 692805535
- Sigstore integration time:
-
Permalink:
OliverSieweke/ruff-jupyter-jetbrains@9400381a17cd2fa5566d3f88f8644371396641b0 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/OliverSieweke
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9400381a17cd2fa5566d3f88f8644371396641b0 -
Trigger Event:
release
-
Statement type: