5 ms·
just tried it and this is immensely fast. too bad it doesn't appear to support flake8 plugins and only has a small subset hardcoded into it. if it could sup
by zzzeek 4y ago
just tried it and this is immensely fast.
too bad it doesn't appear to support flake8 plugins and only has a small subset hardcoded into it. if it could support arbitrary flake8 plugins I would move SQLAlchemy to this tool immediately.
the main reason people want to move off flake8 is not so much a speed issue but that its author refuses to allow it to use pyproject.toml files for configuration, meaning every project's configuration has to remain half-broken using obsolete setup.cfg files. A very silly situation.
- emptysea 4y agoyeah that pyproject.toml issue is really annoying with flake8, made me glad to switch to ruff even though it doesn't have all the same lints available
- charliermarsh 4y agoYeah we don't support arbitrary Flake8 plugins. We do plan to support plugins eventually but the exact architecture and API are TBD. If there are plugins that would be particularly impactful for you, I'd be happy to take a look at adding them. (We support some of the plugins you use in SQLAlchemy, like flake8-docstrings and flake8-builtins, but not flake8-rst-docstrings which I'm guessing is a blocker.)
- zzzeek 4y agothanks for the reply! we use a bunch of goofy ones that nobody else does. one of them is like a 3 line plugin that has only a handful of stars on github. flake8-import-order flake8-builtins flake8-future-annotations flake8-docstrings flake8-rst-docstrings flake8-import-single
- charliermarsh 4y agoOh heh yeah I saw flake8-import-single :) That might be equivalent to using Ruff's isort implementation with `force_single_line` but maybe that comes with other implications that you don't want for SQLAlchemy.
- zzzeek 4y agoI really tried to use isort but it doesnt do the import order style that we use, and there were some other things that didnt work for us. flake8-import-order has selectable styles that I match in my own "zimports" tool that we use to actually write our imports. flake8-import-single then adds this extra idea that you shouldn't have "from tool import x, y, z", since that defeats the purpose import sorting which is to avoid merge artifacts.
- clepto 4y agoAre smaller plugins like this potentially an easy place for first time contributors to work in? My Rust skills are certainly very lacking but if there is some big list of arbitrary flake8 plugins that there is a desire to have ported, that sounds like it could be a relatively easy place to get one’s feet wet.
- selestify 4y agoWhat’s the reasoning behind refusing to use pyproject.toml?
- shosca 4y agohttps://github.com/PyCQA/flake8/issues/234 https://github.com/PyCQA/flake8/issues/234
- zzzeek 4y agoit's utterly ridiculous and has all the indications of a maintainer who was grumpy about making a change (a place I know *very well*, I am there multiple times a week myself), and now as it's gone on for years, they no longer can really back down from their original "complaints" even though they are absurd at this point.
- fastball 4y agoThe good news is some maintainers can have a change of heart. I seem to remember there being a certain someone who thought asyncio python was pointless, but now SQLAlchemy has asyncio support and that's super cool!
- zzzeek 4y agohaha that's because i figured out a cool way to do it that wouldnt ruin my life. pyproject thing, he just doesn't want to "give in", there's zero technical issue
- clepto 4y agoI maintain a few open source libraries and we have recently switched to Ruff from Flake8 exclusively because of the lack of pyproject.toml support. These are relatively speaking small codebases, and the speed improvements really don’t make a difference for us, but with trying to get our own projects in line with current standards flake8’s refusal to support it was the final nail in the coffin. I think the point was reasonable when pyproject.toml first came about and parsing it was a bit more of a Wild West, I can certainly understand the unwillingness to try and support it then. Now with Python itself having toml support in the standard library, and every other major tool standardizing on it, not to mention TOML being the de-facto config file for Rust projects. It just seems like a bizarre hill to die on to me now. It’s not as if the work hasn’t been done, there are forks of flake8 with pyproject.toml support, but as far I’m aware multiple PRs with support for it have been denied.