Live data from Hacker News

Ruff v0.16.0 – Significant new updates – 413 default rules up from 59

astral.sh

151–160 of 247 posts

Re: Ruff v0.16.0 – Significant new updates – 413 default rules up from 59

#151

Earlier quoted context omitted.

The point of the "grammar nazi" bots is to focus on the actual problems: if a bot is deciding about linting, you don't have to waste brain power to discuss it in PRs. It is what it is, everyone gets the same, shut up and work on what matters. I'm surprised you consider it a lot of energy spent, I tend not to spend any on this, it just runs automatically on my code and I drop out of pretty much every discussions about…

> The point of the "grammar nazi" bots is to focus on the actual problems: if a bot is deciding about linting, you don't have to waste brain power to discuss it in PRs. And yet, as per the example, the bot force worse linting decisions, and even pushes towards more bugs (e.g. future readers missing the comment intention since it now applies to all 3).

the claim we are arguing here is not that “linters never make mistakes” it is that “linters are generally beneficial and avoid mostly useless debates we previously spent an inordinate amount of time on” Most linters have an escape hatch for exactly this which is usually a one line disable comment

Re: Ruff v0.16.0 – Significant new updates – 413 default rules up from 59

#152
post #113

Earlier quoted context omitted.

You want to be a cog wheel, in a company of cog wheels. There's nothing wrong with that. But I want to be an artist, and preferably in a company of artists, having been in a company of cog wheels too many times. Not only it's more fun that way, but also tends to lead to better outcomes.

That's an uncharitable take and I urge you to reconsider. I also take great joy and pride in the art of writing beautiful code. I have no desire to be a cog in a machine. However, my ADHD brain is delighted to not have to make a million little distracting decisions in place of the code planning I should be doing. Formatters let me concentrate on writing the best data structures and APIs and algorithms instead of how…

The beauty of it is that all artists can be different. It's the cog wheels that need to be identical.

Re: Ruff v0.16.0 – Significant new updates – 413 default rules up from 59

#153
post #104

Earlier quoted context omitted.

But your choice of funny variable names is not a craft, and you’re not a craftsman if you think it matters. What matters is extensibility, maintainability and value delivered. I care how the food tastes, not that the chef has a really cool Japanese knife and is really fast at cutting onions.

I think you miss the point, but using your foodie reference: would you rather go to a couple of Michelin restaurants -- where each piece brings a reflection of the chef, the geographic area, and what quality ingredients were available on that day -- or would you rather only eat at McDonald's for an experience that is extremely consistent across days, seasons, and continents? Now imagine a chef who has a nice little r…

A chef in a michelin restaurant, unless he/she is the sole employee (very rare) is likely in charge of a team of line cooks and while they may get some time and place to experiment you better believe it will not be when preparing the chefs carefully curated menu and recipes for paying customers who have been on a reservation waitlist for months. Bob decided to cook the broccoli with a blowtorch and substituted some ingredients in table 9s dinner. There is a fire in the kitchen and the NYT food critic is going into anaphylactic shock but Bob at least feels like an artist so we will let it slide.

Re: Ruff v0.16.0 – Significant new updates – 413 default rules up from 59

#154
post #12

The amount of fascination that people have with these "grammar nazi" bots -- some of them implementing completely arbitrary "rules" and some of them disagreeing with others on what "good" Python code should look like -- doesn't stop to amaze me. Here's "bad" code: important_numbers = { 'x': 3, 'y': 42, # Answer to the Ultimate Question! 'z': 2 } Here's what "good" code should look like: important_numbers = {"x": 3, "…

Stylistically ugly code that is globally consistent (ideally across the entire ecosystem) >> locally beautiful code that is inconsistent with the rest of the codebase / up to authors taste. No one likes black formatting, but it’s at least consistent. “Your car can be any color you like as long as it’s black”

With regards to your example, adding a comma to the final element should preserve multi-line. You just don’t know the formatting rules yet apparently

Re: Ruff v0.16.0 – Significant new updates – 413 default rules up from 59

#155

Earlier quoted context omitted.

The point of the "grammar nazi" bots is to focus on the actual problems: if a bot is deciding about linting, you don't have to waste brain power to discuss it in PRs. It is what it is, everyone gets the same, shut up and work on what matters. I'm surprised you consider it a lot of energy spent, I tend not to spend any on this, it just runs automatically on my code and I drop out of pretty much every discussions about…

I've never had discussions about code formatting in PRs, this seems like a made up problem or something that predates my career.

> something that predates my career

That's because everybody uses linters nowadays, which was the original point.

Re: Ruff v0.16.0 – Significant new updates – 413 default rules up from 59

#156
post #144

Earlier quoted context omitted.

A person just as opinionated as the tool. People who have very strong opinions about formatting in any direction are suspect.

I do not have any opinion on formatting. My argument is that nobody should.

your argument is about formatting and clearly you feel strongly about it.

this is the difference between the atheist who strongly believes nobody should believe and the atheist who isn't interested and doesn't care

Re: Ruff v0.16.0 – Significant new updates – 413 default rules up from 59

#157
post #146
post #13

Earlier quoted context omitted.

Those tools actually save team energy. Without them any programmer has different opinion on formating, code quality, what is readable etc. You can discuss it endlesly or you can just use ruff.

I have never discussed code formatting and drive-by changes more than in projects with auto formatters.

Why though? I've yet to come across an auto formatter that formats things the way I personally like. But that's fine. I do whatever the hell I want until I'm ready to open a PR, then bang it through the auto formatter. And you know what? I can also go the other direction and run a home-brew auto formatter to reshape things the way I personally want on my local machine.

Re: Ruff v0.16.0 – Significant new updates – 413 default rules up from 59

#158
post #20

Earlier quoted context omitted.

In my previous place, discussions on coding style were forbidden in PRs. It worked just fine. Edit: one could also use single or double quotes in strings, and it didn't anger the grammar nazi bots as there were none.

Using a consistent string delimiter has value: if you search for ['foo'] you will find all instances of the string foo. With inconsistent delimiters, you better have a single canonical 'foo' in your project or you're going to run into problems.

When a string contains strange characters, how do you enforce the single consistent delimiter?

You probably haven't written diverse enough code.

Re: Ruff v0.16.0 – Significant new updates – 413 default rules up from 59

#159

ran 0.16 on a file with no config, it flags unsorted imports and `except Exception` by default now

You know how many bugs I've met working on large Python codebases over 20 years, caused by unsorted imports or `except Exception`? Yeah, you've guessed it: exactly 0 bugs. It's really annoying how many people think that if you enforce stupidly strict rules about formatting, more strict that those of Fortran in 70s, you'll automatically get good code. I've seen companies that enable 100% of ruff rules, use several oth…

I think it should depend on if it's `except Exception` (don't use) or `except Exception as e` (probably fine, as long as you log `e` or do something else with it).

Re: Ruff v0.16.0 – Significant new updates – 413 default rules up from 59

#160
post #12

The amount of fascination that people have with these "grammar nazi" bots -- some of them implementing completely arbitrary "rules" and some of them disagreeing with others on what "good" Python code should look like -- doesn't stop to amaze me. Here's "bad" code: important_numbers = { 'x': 3, 'y': 42, # Answer to the Ultimate Question! 'z': 2 } Here's what "good" code should look like: important_numbers = {"x": 3, "…

The point of the "grammar nazi" bots is to focus on the actual problems: if a bot is deciding about linting, you don't have to waste brain power to discuss it in PRs. It is what it is, everyone gets the same, shut up and work on what matters. I'm surprised you consider it a lot of energy spent, I tend not to spend any on this, it just runs automatically on my code and I drop out of pretty much every discussions about…

And yet, a new argument surfaces about whether or not the linking should take place. Some people just like to argue :)
Post reply on HN