bitter-ability-32190
08/29/2022, 6:12 PMfmt
and lint
. Collecting thoughts...
1. Support for targetless-formatters
a. This is tricky because unlike lint
, we can't run a formatter on a file in parallel with another formatter on that same file.
2. Simplification of formatters (and soon to be fixers) in lint
a. This is important because not only are we getting it wrong, but the complexity makes future modifications scarier
The solution:
• Make the fmt
and lint
types share a base interface (lint
-based types) so `lint`'s implementation can be relatively fmt
-agnostic
• "unify" both target and targetless tools by turning this into a 2-step process:
a. Given a set of specs, ask the tool to filter/batch the inputs it cares about. Tools can attach metadata to batches (like partition info)
b. Then issue requests using the batch (the Snapshot)
I hate that we're changing the shape of `fmt`/`lint` plugins in most releases, BUT I do think we are converging on something generic enough to simultaneously cover most bases and still keep it simple.
NOTE: There is no User-facing change here. Only internal and external plugin changes.witty-crayon-22786
08/29/2022, 9:51 PM• Make thefwiw: they both extendandfmt
types share a base interface (lint
-based types) so `lint`’s implementation can be relativelylint
-agnosticfmt
StyleRequest
currentlywitty-crayon-22786
08/29/2022, 9:52 PM• “unify” both target and targetless tools by turning this into a 2-step process:this is already a two-step process afaict… it’s just that the “matching” is via FieldSet rather than, say, a filename pattern
witty-crayon-22786
08/29/2022, 9:52 PMbitter-ability-32190
08/29/2022, 9:54 PMwitty-crayon-22786
08/29/2022, 9:55 PMbitter-ability-32190
08/29/2022, 9:59 PMwitty-crayon-22786
08/29/2022, 10:22 PMlint
batches all targets with a Field value of a
), rather than via imperative codewitty-crayon-22786
08/29/2022, 10:23 PMAsyncField
, perhaps via the @union
-method-@rule_helper
thing), then it would be even more useful for `lint`/`fmt` to partition based on field valuesbitter-ability-32190
08/29/2022, 10:28 PMwitty-crayon-22786
08/29/2022, 10:32 PMwitty-crayon-22786
08/29/2022, 10:38 PM@union
-method-`@rule_helper`s like that, having two callsites for the @union
is essentially equivalent.witty-crayon-22786
08/29/2022, 10:40 PMawait Get(Thing1, LintTargetsRequest(..))
await Get(Thing2, LintTargetsRequest(..))
bitter-ability-32190
08/30/2022, 11:00 AMbitter-ability-32190
08/30/2022, 11:00 AMbitter-ability-32190
08/30/2022, 4:10 PMbitter-ability-32190
09/01/2022, 1:37 AM