Hi, I wonder where the pylint output file is store...
# general
h
Hi, I wonder where the pylint output file is stored when running
pants lint
. I notice that pants 2.9.0.dev2 uses pylint 2.11.0+, which supports
--output
option for generating report file. I have that specified as
[pylint].args = "--output=./pylint.report.txt"
in pants.toml. I observe that the output isn't printed on the console but, after the run, I can't find the generated report anywhere under the project root. Maybe I forgot to check somewhere else?
c
Py lint is invoked in a sandbox, that’s why you don’t see the file in your project. Try with
output=%(buildroot)s/report.txt
h
Normally we capture linter reports from the sandbox and copy them under
dist/
, but it looks like we don't do that for pylint
So will have to add that feature
@happy-pizza-30507 could you file an issue at https://github.com/pantsbuild/pants/issues ? Thanks!
But yeah, @curved-television-6568 hack should work in the meantime, looks like you can give
--output
an absolute path, so you can send that report anywhere...
h
Thanks for explaining. Issue updated: https://github.com/pantsbuild/pants/issues/13686 Moreover, it seems pants keeps cancelling & rescheduling the linting process with
--output=%(buildroot)s/report.txt
. I'm getting the below output when running on osx. Not knowing the exact internals, I guess that the files in
buildroot
are being monitored by pants and writing pylint report file right there invalidates the linting process in some way, causing a new job to be rescheduled (and to be invalidated again). Specifying the report under "dist" directory seems to be a better choice.
Copy code
❯ ./pants lint ::
22:32:51.67 [INFO] Initializing scheduler...
22:32:51.81 [INFO] Scheduler initialized.
22:32:53.62 [INFO] Filesystem changed during run: retrying `Lint` in 500ms...
22:32:54.55 [INFO] Filesystem changed during run: retrying `Lint` in 500ms...
...
Interrupted by user.
1
h
Yeah, you will want to write it to a folder included in the option
[GLOBAL].pants_ignore
, list the
dist/
folder