TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ruff: Python linter and code formatter written in Rust

200 pointsby modinfo4 months ago

15 comments

scosman4 months ago
Being new to python, the astral stuff is such a relief.<p>I don’t think experienced python folks realize how much the flexible tooling slows people down, and creates friction for adopters. Setting up my project I tried 3 environment managers, 2 type checkers, 3 formatters&#x2F;linters, 3 packagers&#x2F;dependancy&#x2F;project managers.<p>I know this is kinda the n+1 issue where astral is just adding another. But it feels like a complete and well designed stack, not a box of parts encouraging me to build my own. Reminds me a bit of go tooling.<p>I am a convert. I’ll happily jump on their type checker and packager when ready.
评论 #42777130 未加载
评论 #42776164 未加载
评论 #42777776 未加载
评论 #42776499 未加载
评论 #42777046 未加载
评论 #42776888 未加载
评论 #42777968 未加载
评论 #42776842 未加载
评论 #42777534 未加载
评论 #42776927 未加载
danpalmer4 months ago
I&#x27;m a little sad that Ruff took off as a re-implementation of a whole bunch of work that was already done, rather than as a project to improve the work that was already done.<p>It was nice to be able to write little extra linters or flake8 plugins in the language I was linting. Plus decades of effort had gone into making those plugins pretty great, finding the right separation of linting codes so that the right things could be linted&#x2F;ignored per codebase.<p>I understand why they did it, and they have done it remarkably well, but &quot;rewrite it from scratch&quot; is almost never the best answer and part of me wonders if this result could have been even better achieved another way.
评论 #42775700 未加载
评论 #42775774 未加载
评论 #42775695 未加载
评论 #42777228 未加载
评论 #42777254 未加载
评论 #42776251 未加载
评论 #42775682 未加载
评论 #42775642 未加载
评论 #42796743 未加载
rikthevik4 months ago
I&#x27;m very impressed by the recent developer experience improvements in the python ecosystem. Between ruff, uv, and <a href="https:&#x2F;&#x2F;github.com&#x2F;gauge-sh&#x2F;tach">https:&#x2F;&#x2F;github.com&#x2F;gauge-sh&#x2F;tach</a> we&#x27;ll be able to keep our django monolith going for a long time.<p>Any opinions about the current state of the art type checker?
评论 #42775603 未加载
评论 #42777442 未加载
评论 #42775596 未加载
评论 #42779786 未加载
评论 #42776869 未加载
throwaway982314 months ago
At this point I think even people trapped for two years on the International Space Station have heard about the Astral toolchain.
评论 #42775388 未加载
评论 #42775419 未加载
评论 #42775549 未加载
JohnScolaro4 months ago
I first attempted to use ruff for a small project ~2 years ago, and at the time felt that it wasn&#x27;t quite good enough to replace the: black+isort+whatever linter combo we were using at work.<p>I&#x27;ve used it a few times since then and now I&#x27;m a big proponent of using only ruff. I think most of its value comes from:<p>1. Being fast (or at least fast enough that it&#x27;s not annoying). 2. Replaces the linting&#x2F;formatting combo of multiple tools, reducing the cognitive load for the developer.<p>Anyway, big fan.
tiltowait4 months ago
It really is as fast as it claims. I sometimes intentionally add something it will complain about just to make sure it’s still working.
评论 #42775459 未加载
monomial4 months ago
I&#x27;ve been using an amalgamation of pyenv, pip-tools, black, isort, etc. for projects and just gave uv and ruff a try. Wow, it really is fast! Skeptical of anything VC-backed but I&#x27;ll be keeping my eye on it.
mhh__4 months ago
A small boon to it not being in python — it&#x27;s now decoupled from your python toolchain.
评论 #42775729 未加载
评论 #42777481 未加载
Blackarea4 months ago
I don&#x27;t care one bit about py-land, but it&#x27;s always nice to see a rust project swoope in and save the day.<p>Language processing like compiling or linting is just one of the many aspect where rust can really play out it&#x27;s awesome strength.
评论 #42776860 未加载
TheTaytay4 months ago
I’m used to running command line tools on fast machines, but the first time I ran ruff on my codebase I was blown away. My codebase isn’t massive but most (non-rust) tools just take a while to run. It might be less than a second of startup overhead, but it’s noticeable. Ruff is so fast you wonder if it even did anything. It reminded me how fast computers actually are.
fastball4 months ago
Some previous discussions:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=34788020">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=34788020</a><p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=37908760">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=37908760</a>
seanwilson4 months ago
For Django projects, what&#x27;s fast that will cover Python, HTML, CSS and JavaScript files? Ruff only does Python?
评论 #42775650 未加载
评论 #42778167 未加载
评论 #42777326 未加载
earnestinger4 months ago
Does formatting match black? (Unlikely, but one can dream of standard being established)
评论 #42778568 未加载
bowsamic4 months ago
Now we just need this but for mypy
评论 #42781680 未加载
评论 #42796827 未加载
greatgib4 months ago
So much marketing coolaid&#x2F;bullshit.<p>I&#x27;m not that fan of Ruff because to me it doesn&#x27;t make any sense to add a rust dependency to &quot;python&quot; and it blows my mind that people are so keen to accept the ugly formatting inherited from Black just because &quot;it gives consistency to the team, so I don&#x27;t have to think, and we don&#x27;t have to discuss code style&quot;...<p>But all of that personal opinion set aside, what triggers my initial statement is that so many persons are so excited to run to use Ruff because... &quot;It is so fast&quot;... when I&#x27;m quite sure most of them would never notice any real speed difference with their modest codebase.<p>In almost all the codebases I have seen, proprietary and OSS, pylint or any other linter was quasi-instant. There are probably a few huge codebases that would see a speed benefit of a few seconds to use Ruff, but their owner would probably better have a look at their code to understand how their reached such a monster!
评论 #42775513 未加载
评论 #42775569 未加载
评论 #42775534 未加载
评论 #42775524 未加载
评论 #42777569 未加载
评论 #42775654 未加载
评论 #42775542 未加载