Hi, Ruff just got a new release (`0.0.273` and `0...
# general
h
Hi, Ruff just got a new release (
0.0.273
and
0.0.274
) that supports writing the report to a file. I've gone through the process of making a new resolve etc. for setting a specific version for a tool and added
args.add = ["--output-file=reports/report.txt"]
under
[ruff]
in
pants.toml
. When I now run
pants lint ::
, I get :
Copy code
10:05:51.51 [ERROR] Completed: Lint with ruff - ruff failed (exit code 2).
error: No such file or directory (os error 2)
However, if I remove the
reports
part of the path (
args.add = ["--output-file=reports/report.txt"]
->
args.add = ["--output-file=report.txt"]
), I get:
Copy code
10:06:58.11 [INFO] Completed: Lint with ruff - ruff succeeded.
10:06:58.14 [INFO] Completed: Fix with ruff - ruff --fix made no changes.
I suspect that Pants doesn't create the
reports
folder in the sandbox and that
ruff
expects it to exist ant to only create the report file itself. Using
--keep-sandboxes=always
and
ls -l
I see that indeed there is no
reports
folder. Can I configure Pants to create the folder or to take the report file from the parents' path?
🧵
b
Does the ruff plugin support report files?
f
Yes plugins can modify the input root for a
Process
to include an empty directory
search for
CreateDigest.*Directory
for examples
and then use
MergeDigests
to combine that empty directory
Digest
with the orignial
Digest
for the input root
h
Thanks! Working on a PR, will update.
Well, it took me some time, but here is a draft PR: https://github.com/pantsbuild/pants/pull/19441