It seems as `isort` doesn’t support saving the out...
# general
f
It seems as
isort
doesn’t support saving the output error messages into a file (in the same way you can do
flake8 --output-file=reports/flake8.txt
). If I’d be calling
isort
on its own, I could just
tee
, but since it happens in the
./pants lint
call, I can’t do that. Have I overlooked anything in the options and it’s actually possible to produce a file report? Is it something we could extend in Pants itself to produce such a report?
1
h
i think similar to https://github.com/pantsbuild/pants/issues/14936 from @loud-laptop-17949
b
Out of curiosity, what's the use case?
f
I run the
./pants lint ::
in CI, then I’d like to post errors as a comment. That’s what I do with the formatting and linting issues found. I’ve taken this approach, because reading through the CI output is not a great DevX imho 🙂 hence the need for a file I could read and then post errors as comments
👍 1
h
FYI that is roughly what Toolchain's BuildSense does 🙂 cc @happy-kitchen-89482 if you or anyone has interest in trying that out!
1
f
thanks, Eric! I’ll post an issue on isort GH page, perhaps this could be done upstream! I was just wondering if there is actually such an option and I have failed to find it 🙂
b
FWIW I made a PR where if lint fails due to a formatter it instructs the user to run fmt
👍 1
Specifically for this case (better DevX)
I also plan on making a GitHub bot for our company which you can command to fmt your branch for you. Again, so devs don't care about the specifics of the reformatting, just that it is/isn't formatted
l
It seems there are many tools that don't support writing their output to files. It would be great to add pants support for `tee`ing that output to a file for processing.
FYI that is roughly what Toolchain's BuildSense does
@hundreds-father-404 we use buildsense and I haven't seen this feature?
h
we use buildsense and I haven't seen this feature?
In that you can look at the outputs in the web UI in a sanitized way, that it will filter out each tool etc. That is, you don't have to look at the long CI log if you don't want Doesn't add comments for you, tho (yet at least)
It would be great to add pants support for teeing that output to a file for processing.
I think it makes sense. As with most Pants features, the hard part is figuring out the design, like what to name the option. Implementation should be pretty trivial from there
l
yeah, something like
tee_stdout
and
tee_stdin
make sense to me, but only if you know what
tee
does
h
redirect_stdout
?
write_stdout
?
save_stdout
? (and do we have dedicated stdout vs stderr options, or we do both? or each tool decides?)
l
maybe save, I don't think redirect bc I think it should also go to stdout
👍 1
i think you need both settings
I think for some lint tools you will get results on stdout and diagnostics on stderr
👍 1