Adapter plugin to use Ruff in dprint's CLI and with JavaScript via Wasm

Overview

dprint-plugin-ruff

CI

Adapter for Ruff for use as a formatting plugin in dprint.

Formats .py and .pyi files.

Note: For formatting .ipynb files, use the Jupyter plugin along with this plugin.

Install

Install and setup dprint.

Then in your project's directory with a dprint.json file, run:

dprint config add ruff

Configuration

To add configuration, specify a "ruff" key in your dprint.json:

{
  "ruff": {
    "indentStyle": "space",
    "lineLength": 100,
    "indentWidth": 2
  },
  "plugins": [
    // ...etc...
  ]
}

For an overview of the config, see https://dprint.dev/plugins/ruff/config/

JS Formatting API

Versioning

This repo automatically upgrades to the latest version of Ruff once a day. You can check which version of Ruff is being used by looking at the tag property in the ruff_python_formatter entry in the Cargo.toml file in this repo:

https://github.com/dprint/dprint-plugin-ruff/blob/main/Cargo.toml

At the moment, the version of this plugin does not reflect the version of Ruff. This is just in case there are any small bug fixes that need to be made as this plugin is quite new. After a while I'll try to match the versions.

You might also like...
notify Node.js binding via napi-rs.

@napi-rs/notify notify Node.js binding via napi-rs. Install this package yarn add

Trigger sounds via RFID tags or barcodes

Reads codes via RFID or 1D/2D barcode USB scanners and plays soundfiles mapped to them.

esp-serial-dbg - debugging of esp-hal based applications via serial

esp-serial-dbg - debugging of esp-hal based applications via serial About This is still work in progress! At least the contained examples should work

An RSS feed aggregator that notifies you of new posts via email.
An RSS feed aggregator that notifies you of new posts via email.

Rss2Email A small program capable of aggregating content from multiple RSS/Atom feeds and mailing them to you in a practical summary email. Keep track

A low-ish level tool for easily writing and hosting WASM based plugins.

A low-ish level tool for easily writing and hosting WASM based plugins. The goal of wasm_plugin is to make communicating across the host-plugin bounda

BSV stdlib written in Rust and runs in WASM environments

BSV.WASM A Rust/WASM Library to interact with Bitcoin SV Installation NodeJS: npm i bsv-wasm --save Web: npm i bsv-wasm-web --save Rust: https://crate

A playground for creating generative art, buit with Rust🦀 and WASM🕸
A playground for creating generative art, buit with Rust🦀 and WASM🕸

Genny A playground for creating generative art, buit with Rust 🦀 and WASM 🕸 About This is a simple playground that allows me to explore ideas around

A Zellij plugin for quickly searching and switching tabs 🖤
A Zellij plugin for quickly searching and switching tabs 🖤

🖤 room A Zellij plugin for quickly searching and switching between tabs. Usage Tab to cycle through tab list Up and Down to cycle through tab list En

A reactive DOM library for Rust in WASM

maple A VDOM-less web library with fine-grained reactivity. Getting started The recommended build tool is Trunk. Start by adding maple-core to your Ca

Comments
  • Suggestion: include ruff's isort lint rule

    Suggestion: include ruff's isort lint rule

    https://docs.astral.sh/ruff/rules/#isort-i https://docs.astral.sh/ruff/settings/#isort

    At Canva we currently use dprint-plugin-exec to run both black and isort over the codebase. I'm not sure how common this is externally - but I believe it's not uncommon to run both black + isort on a python codebase together - treating isort as a second formatter of sorts.

    Ruff supports import sorting - so it would be great if we could leverage this and eliminate one more (slow) integration from the exec plugin.

    enhancement 
    opened by bradzacher 3
Releases(0.0.3)
Owner
Pluggable and configurable code formatting platform.
null
A Wasm component optimizer (mostly a wrapper around wasm-opt)

component-opt An optimizer for Wasm Components Current Status This project currently only offers one optimization and does not allow it to be configur

Robin Brown 6 Mar 4, 2024
Plugin to request a relaunch when uploading a Skyline plugin through cargo skyline

restart-plugin A skyline plugin for allowing cargo-skyline (or other tools) to restart your game without you having to touch your controller. Install

null 1 Nov 21, 2021
swc node binding use wasm

node_swc swc node binding use wasm Build Make sure you have rust wasm-pack installed. $ yarn build # build wasm, node Usage import { parseSync, printS

伊撒尔 23 Sep 8, 2022
An n-tuple pendulum simulator in Rust + WebAssembly (and JavaScript)

An n-tuple pendulum simulator in Rust + WebAssembly (and JavaScript) Remaking this n-tuple pendulum simulator moving the math to Rust ?? and WebAssemb

Travis Taylor 27 Feb 19, 2022
Blazing fast linter for JavaScript and TypeScript written in Rust

deno_lint A Rust crate for writing fast JavaScript and TypeScript linters. This crate powers deno lint, but is not Deno specific and can be used to wr

Deno Land 1.3k Dec 29, 2022
Extremely fast JavaScript minifier, available for Rust and Node.js

minify-js Extremely fast JavaScript minifier, written in Rust. Goals Fully written in Rust for maximum compatibility with Rust programs and derivative

Wilson Lin 78 Jul 13, 2023
Membrane is an opinionated crate that generates a Dart package from a Rust library. Extremely fast performance with strict typing and zero copy returns over the FFI boundary via bincode.

Membrane is an opinionated crate that generates a Dart package from a Rust library. Extremely fast performance with strict typing and zero copy returns over the FFI boundary via bincode.

Jerel Unruh 70 Dec 13, 2022
The axiom profiler for exploring and visualizing SMT solver quantifier instantiations (made via E-matching).

Axiom Profiler A tool for visualising, analysing and understanding quantifier instantiations made via E-matching in a run of an SMT solver (at present

Viper Project 18 Oct 18, 2022
Code for connecting an RP2040 to a Bosch BNO055 IMU and having the realtime orientation data be sent to the host machine via serial USB

Code for connecting an RP2040 (via Raspberry Pi Pico) to a Bosch BNO055 IMU (via an Adafruit breakout board) and having the realtime orientation data be sent to the host machine via serial USB.

Gerald Nash 3 Nov 4, 2022
🎓 My journey from JavaScript to Rust

Rusty Days My journey from JavaScript to Rust I'm a web3 dev looking for higher performance. Enticed that Rust was voted the most loved programming la

Dawson Botsford 19 Apr 17, 2022