惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
Spread Privacy
Spread Privacy
Cloudbric
Cloudbric
V
Vulnerabilities – Threatpost
博客园 - 叶小钗
I
Intezer
S
Secure Thoughts
Jina AI
Jina AI
T
Tenable Blog
博客园 - 【当耐特】
WordPress大学
WordPress大学
W
WeLiveSecurity
宝玉的分享
宝玉的分享
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Google DeepMind News
Google DeepMind News
Schneier on Security
Schneier on Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
Blog RSS Feed
Martin Fowler
Martin Fowler
Hacker News - Newest:
Hacker News - Newest: "LLM"
S
Schneier on Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
IT之家
IT之家
小众软件
小众软件
P
Privacy & Cybersecurity Law Blog
V
Visual Studio Blog
S
Securelist
M
MIT News - Artificial intelligence
H
Help Net Security
Scott Helme
Scott Helme
N
News and Events Feed by Topic
SecWiki News
SecWiki News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园_首页
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
T
Tailwind CSS Blog
A
About on SuperTechFans
The Last Watchdog
The Last Watchdog
S
Security @ Cisco Blogs
大猫的无限游戏
大猫的无限游戏
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
H
Heimdal Security Blog
T
The Blog of Author Tim Ferriss
Blog — PlanetScale
Blog — PlanetScale

Blog - Astral

Ruff v0.16.0 Vulnerability and malware checks in uv Open source security at Astral Astral to join OpenAI Ruff v0.15.0 ty: An extremely fast Python type checker and language server Python 3.14 Ruff v0.13.0 Astral OSS Fund: One Year Later pyx: a Python-native package registry, now in Beta An experimental, variant-enabled build of uv uv security advisory: ZIP payload obfuscation Ruff v0.12.0 Ruff v0.10.0 Ruff v0.9.0 A new home for python-build-standalone Ruff v0.8.0 Ruff v0.7.0 uv: Unified Python packaging Ruff v0.6.0 Announcing the Astral OSS Fund Ruff v0.5.0 Ruff v0.4.0: a hand-written recursive descent parser for Python Ruff v0.3.0 uv: Python packaging in Rust Ruff v0.2.0 Ruff v0.1.8 Ruff v0.1.5 The Ruff Formatter: An extremely fast, Black-compatible Python formatter Ruff v0.1.0 Ruff v0.0.292 Ruff v0.0.285 Ruff v0.0.283 Ruff v0.0.281 Ruff v0.0.278 Ruff v0.0.276 Announcing Astral, the company behind Ruff
Ruff v0.4.5: Ruff's language server is now written in Rust
jane@astral. · 2024-05-22 · via Blog - Astral

Ruff v0.4.5 is available now! Install it from PyPI, or your package manager of choice:

pip install --upgrade ruff

Ruff is an extremely fast Python linter and formatter, written in Rust. Ruff can be used to replace Black, Flake8 (plus dozens of plugins), isort, pydocstyle, pyupgrade, and more, all while executing tens or hundreds of times faster than any individual tool.


This release marks the Beta release of our integrated, Rust-based language server, which powers the diagnostic and formatting capabilities of Ruff’s VS Code extension and other editor integrations.

Last month, we released the Alpha version as part of Ruff v0.4.0. Since then, we’ve made several stabilizing improvements to the server and introduced a few major features, bringing us closer to completely replacing our previous Python-based language server, ruff-lsp.

If you want to get started with ruff server, enable it in Ruff's VS Code extension, or read the setup guide.

Rewrite it in Rust #

Ruff's editor integrations have always been powered by a language server. Unlike Pylance or Jedi, which are general-purpose language servers for Python, Ruff’s language server facilitates linting, formatting, and automatic fixes within editors, like VS Code or Neovim.

In December 2022, we introduced ruff-lsp, a language server written in Python that interfaced with Ruff over the command line.

While ruff-lsp worked well for a time, we ran into fundamental technical limitations that made it difficult to maintain and extend:

  • ruff-lsp was developed, tested, and released independently of Ruff, which meant we needed to maintain compatibility with a wide range of Ruff versions.
  • Since ruff-lsp interacted with Ruff's command line interface, every new feature had to be exposed in user-facing options, and all data necessary to power the integration had to passed over standard input and output.
  • Repeatedly running Ruff as a stateless subprocess resulted in unnecessary overhead for each request.
  • Since every invocation of Ruff was a separate process, we couldn't implement LSP features that required tracking state across multiple requests (e.g., files that have been modified in the editor but not saved to disk), since Ruff itself was being used in a stateless manner.

We realized that our language server needed to be tightly integrated with Ruff itself if we wanted it to keep up with Ruff’s rapid growth.

That's where ruff server comes in: a language server written in Rust and built into Ruff.

Like ruff-lsp, it provides linting, formatting, and other features to our VS Code extension and editor integrations. But unlike ruff-lsp, ruff server uses Ruff directly, as a library, which makes integration easier (and more performant!) compared to ruff-lsp. Since it's part of Ruff itself, there's no external package to install.

Ultimately, ruff server gives us the foundation we need to build a more powerful and feature-rich editor integration, while delivering significant performance improvements and a more streamlined installation experience to users in the process.

Features #

ruff server supports all the features you know and love from ruff-lsp, while also introducing a few new ones. Thanks to an extensible architecture, we have many more features planned down the road.

Diagnostic Highlighting #

Ruff will show you rule violations and syntax errors as fast as you can type.

Editing a file in Helix

Dynamic Configuration #

Ruff dynamically refreshes diagnostics when you update your configuration.

Editing a `pyproject.toml` configuration file in VS Code

Formatting #

Ruff can format your code instantly.

Formatting a document in VS Code

Code Actions #

Ruff can solve issues with your code in seconds using Code Actions.

Applying a quick fix in Helix

You can also chose to ignore diagnostics entirely with noqa comments.

Creating a `noqa` comment in VS Code

Source Actions #

Ruff provides source actions and commands to re-format code or solve issues across an entire file.

Using the `source.fixAll` source action in Helix

You can even run these actions on-save. For example, to format on-save in VS Code, add the following to your settings.json:

{
  "[python]": {
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "charliermarsh.ruff"
  }
}

On save, Ruff will format your code automatically.

Formatting on save in VS Code

Hover Hints #

Ruff can show you the documentation for # noqa codes.

Hovering over a noqa code in VS Code

Jupyter Notebook #

ruff server fully supports Jupyter Notebook files. We even support range formatting within Notebook cells.

Editing multiple Jupyter Notebook cells in VS Code

Formatting a selection within a Jupyter Notebook cell in VS Code

What’s next #

We’re really excited about the future of ruff server. Here's what's coming next:

  • Supporting more editors: Currently, we support VS Code, Neovim, and Helix. At a minimum, we plan to support all of the editors that ruff-lsp officially supports. But expect us to go beyond that.
  • Deprecating ruff-lsp: ruff server will be a drop-in upgrade for ruff-lsp . We plan to deprecate and, eventually, archive the old language server.
  • Supporting future Ruff features: Future Ruff CLI features will have corresponding support in the language server.
  • Supporting more general language server features: We plan to expand the server's capabilities beyond linting, formatting, and diagnostics.

Overall, our goal with ruff server is to build the best, most feature-rich Python language server available. This release marks an important milestone in reaching that goal.