ruff looks like very interesting tooling. Trying to make it work for Emacs groundup. Has anyone been able to run it with eglot using this pylsp plugin: https://github.com/python-lsp/python-lsp-ruff ?
A few weeks ago, I’ve written a small essay about modern #Python tools (like #Ruff and #uv) and things I dislike about them. I wanted to first redesign my website before posting it, but nah, that would take too long of a time 😂
My prediction: #astral#ruff will soon compete directly with codeclimate, sonarqube, codacy and the like. As far as I can tell, these products take a variety of free tools, repackage them and sell them to corporate customers with a hosted SaaS, sometimes with free tiers (zero marginal costs, so why not, it is a sales pipeline). They do so quietly and so who knows if they contribute anything back, if they violate the social norms of opensource or hire or compensate maintainers.
Last week @hynek
said "it looks like nobody has seen the VC playbook play out" regarding Astral and #ruff .
This week with the uv tool, I’m seeing cheerleaders right next to me like I didn’t see before with Ruff.
Regarding #Python tooling and Python itself, I can’t stop thinking about how Astral’s business model relies on keeping Python and tools slow, so that their tools stand out. And it’s really stuck in my head. 😬
Somewhat relatedly, as far as I can tell, the lack of support for uv pip install . is deliberate.
It leaves me wondering what exactly the design goals behind the "drop-in" claim are, because they don't seem to be "have the same observable behavior" as a general rule, but maybe something more like "it's close".
(I guess this kvetching applies to #ruff as well as #uv since it also claims drop-in parity and has lots of fiddly little differences that make "drop-in" mean "drop-in and then tweak")
Hab jetzt mal ein wenig Erfahrung mit #ruff gemacht... Das ist zwar schnell, aber auch nicht perfekt...
Falsche whitespaces/newlines sind ihm oft egal. Dabei kommt irgendwie darauf an, ob man "ruff check" / "ruff check --fix" oder "ruff format" nutzt. Letzteres macht mehr...
Auch wenn alle regeln an sind... Dann kann es auch #isort nicht wirklich ersetzten. Die Reihenfolge/newlines und doppelte imports (F811) fixt ruff nicht richtig.
Even after a few months of using #ruff to check and fix issues in my #python code, I still experience that moment of running 'ruff' manually, then spending a moment of hesitation thinking “hang on that returned too quickly, did it actually do anything or did it just return because it didn’t find any files to check?”
Using cyclomatic complexity in code reviews. That would be an interesting experiment - I had no idea that CC was measurable in C++ code! Metrix++ is the relevant tool.
If you use Ruff in CI to check your Python code (and if not, what’s wrong with you, start ASAP!), there’s a breaking change in the new 0.1.0 version released yesterday. Change the --output= arg to --output-format and you’ll be back up and running.
The Ruff team did bump the minor version when they made the change. If you’re like me and hadn’t bothered pinning it because “they’ve had 293 releases so far, what’s the likelihood it’ll change?”, fix that too while you’re in there.
> An extremely fast Python linter, written in Rust.
[ . . . ]
> Near-parity with the built-in Flake8 rule set
> 🔌 Native re-implementations of dozens of Flake8 plugins, like flake8-bugbear
[ . . . ]
> Ruff can be used to replace Flake8 (plus dozens of plugins), isort, pydocstyle, yesqa, eradicate, pyupgrade, and autoflake, all while executing tens or hundreds of times faster than any individual tool.
Used by well-renowned projects like pandas and FastAPI.
So, what’s your current go-to #Python#QA & #codestyle stack? Thinking of doing black, isort, mypy, pytest, but open for suggestions.
My main project currently uses flake8 instead of black, with flake8-quotes to enforce double quotes, but this breaks in Python 3.12 because of nested quotes in f-strings: https://github.com/zheller/flake8-quotes/issues/117
#ruff can now format python files in the same format as #black can:
> Alpha release of the Ruff formatter, out now in Ruff v0.0.289.
> The formatter is designed to be a drop-in replacement for Black... At present, it achieves over > 99.9% compatibility on significant Black-formatted projects like Django and Zulip.
> For the Alpha, our focus is on collecting feedback that we can address prior to a Beta release later this year.
I've been using #ruff for quite a while now but I never bothered configuring it much. Now @brianokken mentioned this article on one of the more recent @pythonbytes episodes and I had a closer look at what's possible. Seems like I missed out on quite a bit.
@_chrismay We use pipenv for dependency management. Our "build" pipeline runs pipenv check after the sync, which uses the safety underneath if I am not mistaken. Builds fail if this check fails.
From there, it is usually easy to pipenv update, run unit tests and #ruff, fix failures, and commit the changes.
Today #vscode is extremely annoying me again. Random hangs while running formatters and linters, that normally just works. Some hangs result in crashes which again result in lost #python code. I am reaching again the point, where I want to look into a different editor.