bitter-ability-32190
09/19/2022, 7:20 PMlint
, We'll have the "nested" types be slightly different, but impedance-matched
◦ Namely FmtPartitions
is now a collection of partitions of filepath+metadata, building upon lint's Partitions
collection of partitions of <anything>
◦ Additionally FmtRequest.SubPartition
now also holds an optional snapshot (optional because lint
won't have the snapshot to provide)
▪︎ We can provide a @rule_helper
for getting the snapshot: self.snapshot if self.snapshot else await Get(...)
. Maybe we lift the underscore restriction? Or move it to flake8
so we can #noqa
it?
However the serial nature of fmt
is where things kinda get funky. Since Partitions
(and therefore SubPartitions
) can overlap in unique ways, my thought is to group SubPartitions
by any-file-overlap.
All is good so far, however when we go to serially execute the batch, the "prior" snapshot is for a potentially different set of files than the current request necessitates. So I'm imagining our snapshot populater needs to subset the "prior" snapshot on what files are valid for this subpartition (falling all the way to the very first invocation) and then merge with files we've never seen before.
It's all sound, but wanted to get your (or anyone's) thoughts 🙂