Comment by zem

Comment by zem 2 days ago

11 replies

this is very much in line with the unix philosophy - it delegates formatting to ruff and simply provides a unified front end that calls out to the right specialized tool. think of it as a makefile.

zvr 2 days ago

A better example might be: in good ol' days when we were formatting with troff(1), passing arguments to the command line invoked other programs like eqn(1) and tbl(1).

zahlman 2 days ago

I don't think this is an apt (pun intended?) comparison at all.

  • d0mine 2 days ago

    One can find repos using `make format` / `make lint`/ `make typecheck` / or similar

    I remember David Beazley mentioning that code with Makefiles were relatively easier to analyze based on ~Terabyte of C++ code and no internet connection (pycon 2014) https://youtube.com/watch?v=RZ4Sn-Y7AP8

    • Kwpolska 2 days ago

      That `make format` command was not defined by the Make developers, but by the team using Make in their project. They picked their favorite formatter and defined a shortcut. In this case, the uv developers are forcing the command on everyone, and they're using it to cross-promote their own formatting tool.

      • Hendrikto 2 days ago

        They are not forcing anything on anyone. You can decide to never run `uv format` and ruff won’t even be installed.

        You can use uv without ruff. You can use ruff without uv. You can invoke ruff yourself if that’s what you want. Or use any other formatter.

        I don’t think I understand what your complaint is.

      • asa400 2 days ago

        Other people having an opinion and creating their own software project to implement it is not “forcing” anyone to do anything.

        The inverse would be no one is allowed to create any projects that you don’t personally agree with.

      • wiseowise a day ago

        Nobody is forcing you to use anything. Feel free to ignore it and use whatever flavor you like.

zelphirkalt 2 days ago

If I want to call ruff, I can do so myself. Why should I want to call it through uv?

  • woodruffw 2 days ago

    If you want to call ruff directly, this doesn't change anything. It's a purely optional feature.

    However, to answer the question generally: people want this for the same reason that most people call `cargo fmt` instead of running rustfmt[1] directly: it's a better developer experience, particularly if you don't already think of code formatting as an XY-type problem ("I want to format my code, and now I have to discover a formatter" versus "I want to format my code, and my tool already has that").

    [1]: https://github.com/rust-lang/rustfmt

  • wiseowise a day ago

    Some of us prefer well packaged tool that does everything instead of stitching together bazillions of dependencies.

    • zelphirkalt a day ago

      Or maybe some prefer random versions of dependencies being downloaded and running over our code?