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

Project setting related to actions on save is not respected when two projects are open #438

Open
mrezzamoradi opened this issue May 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mrezzamoradi
Copy link

Describe the bug
Each project's setting should be respected even if both projects are opened in the same window.

I have two projects which one of them is formatted with ruff and want to continue to do so (project A), and the other one is not formatted by ruff and I don't want it to get formatted by ruff (project B). I have enabled the setting for project A to "Run ruff when the python file is saved" but disabled it for project B. When I open project B alone, it works as expected. However if I open project A alongside it in the same window, then the files in project B gets formatted by ruff on save.

To Reproduce
Steps to reproduce the behavior:

  1. Prepare two projects (A and B), A formatted with ruff and B that is not formatted with ruff.
  2. Enable the setting to "Run ruff when the python file is saved" for A and disable it for B.
  3. Open both projects in Pycharm.
  4. Try to edit a file on project B and save the file. The file gets formatted by ruff.

Expected behavior
The edited file of project B shouldn't get formatted by ruff on save.

Screenshots
Project A:
image
image

Project B:
image
image

Environments (please complete the following information):

  • IDE: PyCharm 2024.1.1 (Professional Edition) Build #PY-241.15989.155, built on April 29, 2024
  • OS: MacOS Sonoma 14.4.1 (23E224)
  • Ruff Version ruff 0.2.1 (on project A. The python environment for project B has not ruff installed on it)
  • Plugin version 0.0.33

Additional context
I'm using pyenv to manage python environment, but those projects are using different pyenv environments.

@koxudaxi koxudaxi added the bug Something isn't working label May 30, 2024
@rh-sp
Copy link

rh-sp commented Jul 2, 2024

Related (if not the same): the setting "Exclude files outside of the project" only applies to the "main" project, i.e., if activated, files in the second project will be excluded, regardless of that project's settings.

(Disabling the setting isn't an option for me, because then it will also reformat files in the git staging area, which I don't want)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants