#Stuck on `dagger call fix`
1 messages · Page 1 of 1 (latest)
Actually it applies to the output of dagger call lint as well, but in a more subtle way
The issue is that when aggregating reports from multiple linting tools (which I am now doing - golangci + ruff as a start. could quickly add my earlier markdown implementation + Justin's separate shell script linter)...
I have a combined report from all those tools (good) but they aren't all looking at the same source directory - so filenames don't all mean the same thing in the same report (bad)
as a consequence of that, I can't just pipe that report into a combined dagger fix. For that, I need to somehow guarantee that all the linting tools are called against the same root directory. Which is... complicated.
ah yea that sounds tricky. is there no way to sort of go over the result at the orinal caller site and re-add the parent directories so they're all relative to the same dir? (just spitballing, can imagine why that's not so easy) - or maybe pass the original context path down so it adds it to the reports it generates?
I think that boils down to the same thing - merging of reports can't be decoupled from the calling of the tools
could you call the tools with a "skeleton" directory structure that only has the passed directories, but set up at the same hierarchy? (i.e. empty surroundings)
They need to be coupled into a combined "call tools from a common context directory, then merge their reports" process
Yes possibly. That's kind of what @crimson thunder already does when linting python across 2 locations (sdk/python/ and docs/). He runs the tool in a "skeleton" which contains only those two directories (filtered too)
So I guess we're talking about generalizing that
I could also move the "skeleton" logic in the reporting instead of the tool invocation
so the tools get called in their "sandbox" directory (no skeleton). Returns a report with filenames rooted in that sandbox.
Then when merging the report, you can pass an optional "mountpoint". All filenames in the report are "mounted" in that mountpoint. The result is the same when looking at the report (I think)
This feels slightly better, because it keeps the merging of reports decoupled from the invocation of the tool.
Also, less opportunities to break cache?