Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support setting a working directory for pylint #96

Open
lrittel opened this issue May 29, 2023 · 1 comment
Open

Support setting a working directory for pylint #96

lrittel opened this issue May 29, 2023 · 1 comment

Comments

@lrittel
Copy link

lrittel commented May 29, 2023

Firstly: thank you for creating the plugin!

Is your feature request related to a problem? Please describe.

I have run into a few problems with configuring pylint:

  • pylint started by the plugin did not respect the .pylintrc file or the pyproject.toml configuration
  • ignore patterns not matching the intended targets

Running pylint from the root directory like pylint src/, I didn't encounter those issues.

Also, support for discovering a pyproject.toml in a parent directory is a feature that won't be available until pylint 3.0.0.

Always running pylint from a specific directory would also help with reproducing configuration issues on the command line and keeping the setup similar across different tools.

Describe the solution you'd like

One of two things (or a combination of both) in the settings:

  • a checkbox "Run pylint from the project root" (defaulting to unchecked)
    • a hint that setting recurse = true in the configuration may be required could be helpful
  • a directory selection "pylint working directory"
    • a hint that setting recurse = true in the configuration may be required could be helpful
    • when the selection is empty, the plugin behaves like it does at the moment

Describe alternatives you've considered

I've tried to configure pylint 3.0.0a6 in a way that it uses my pyproject.toml from the project root, but I run into a problem with ignore paths not matching anymore.

I also considered creating a wrapper script, this would complicate my setup a lot.

@lrittel
Copy link
Author

lrittel commented May 29, 2023

If I read

cmd.setWorkDirectory(project.getBasePath());
correctly, pylint should already be executed from the project directory?

That doesn't match the observed behavior for me. I'm confused now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant