https://pantsbuild.org/ logo
h

happy-pizza-30507

11/21/2021, 12:53 PM
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

curved-television-6568

11/21/2021, 6:18 PM
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

happy-kitchen-89482

11/21/2021, 6:22 PM
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

happy-pizza-30507

11/21/2021, 10:03 PM
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

hundreds-father-404

11/22/2021, 1:20 AM
Yeah, you will want to write it to a folder included in the option
[GLOBAL].pants_ignore
, list the
dist/
folder
3 Views