chore: rename max-batch-size to violates-rule-1#679
Conversation
|
isn't there a max arglist size on Linux? if the paths to the files are long and there are 1024 of such paths, you might go over the limit no? |
|
@MagicRB, maybe, but that's an internal affair to treefmt itself, not something folks should be using this max-batch-size feature for. |
|
Agreed, just pointing out that treefmt then needs to account for the max arglist size and dynamically adjust its internal max-batch-size |
|
@MagicRB, I think treefmt is already doing something "good enough": it never creates batches larger than 1024. Do you see a problem with that? |
on my system, |
|
I'm not opposed to treefmt doing something more clever. I'd be inclined to wait to do it until somebody actually runs into an issue, though. It doesn't change my opinions about this PR, though! |
|
ARG_MAX is hard to calculate.
|
|
I feel like As for the max args, as @zimbatm pointed out, it's not easy to calculate. I decided on |
Obtuse is kind of the goal here, or at least I want something that looks like a code smell (sort of like the |
|
Maybe referring to how rule 1 is violated would be better? Rule 1 is:
https://github.com/numtide/treefmt/blob/main/docs/site/reference/formatter-spec.md#L22 And more specifically, it means accepting multiple positional args as multiple files. So something like |
|
@brianmcgee, I was hoping to land this before the next release so it wouldn't be a breaking change. With 2.5.0 out, I'd suggest we either land this quickly, or abandon it. Thoughts? |
|
My bad I'll merge and recut. I messed up the nixpkgs PR anyway |
96bba8e to
a803a28
Compare
|
Making an executive decision and going with Matt's suggestion of |
`max-batch-size` feels a bit silly to me: it's something people are only ever going to set to 1 as a workaround for formatters that violate rule 1 of the formatter spec. I say let's call a spade a spade and make this a boolean with a name that makes you feel bad for using it.
Signed-off-by: Brian McGee <brian@bmcgee.ie>
I feel this is clearer than `violates-rule-1`. Signed-off-by: Brian McGee <brian@bmcgee.ie>
85b66bb to
56cfe32
Compare
|
Thanks! |
max-batch-sizefeels a bit silly to me: it's something people are only ever going to set to 1 as a workaround for formatters that violate rule 1 of the formatter spec.I say let's call a spade a spade and make this a boolean with a name that makes you feel bad for using it.