pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.33k stars 636 forks source link

Allow `extra_env_vars` for `pylint` #14217

Open thejcannon opened 2 years ago

thejcannon commented 2 years ago

Is your feature request related to a problem? Please describe. pylint in all it's infinite wisdom and glory is producing the following when linting.

error: XDG_RUNTIME_DIR not set in the environment.

Describe the solution you'd like Similar to https://www.pantsbuild.org/docs/python-test-goal#setting-environment-variables but for pylint

Describe alternatives you've considered Ignore the "errors" because pylint still returns exit code 0

Additional context N/A

thejcannon commented 2 years ago

FWIW I think it's likely some import maybe producing this, but grepping an env with all my deps in it, I can't find the problem child.

It might be in a compiled binary.

stuhood commented 2 years ago

In general with these "extra env vars" args, we are trending toward keeping them more tightly scoped. In this case, I think that we'd probably want to add the option directly for pylint.

Eric-Arellano commented 2 years ago

Agreed. It's valuable to keep things tightly scoped for the sake of better hermeticity, which improves cache hits + reduces the risk of Works On My Machine errors.

thejcannon commented 2 years ago

Changed the title :wink: