-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Ignoring per-file-ignores configuration #359
Comments
Same thing. @koxudaxi maybe it happen, because Ruff team moved "per-file-ignores" config from root into "lint" subsection: [tool.ruff.lint.per-file-ignores]
"tests/**" = ["INP001", "S101"] |
I'm sorry for my late reply.
Do you set your |
Yes, the config file is specified, but, due to the problem described in #358 I had to edit <option name="ruffConfigPath" value="ruff.toml" /> Could there be a problem due to such usage? Still reproduced on this simple project: Pycharm: And I tested this case on Ruff [lint]
select = ["S101"]
[lint.per-file-ignores]
"tests/*" = ["S101"] |
@FieryDruid |
sorry, it is not completed :( I meant that error is still being reproduced after release |
@FieryDruid |
ruff.xml contains: <?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RuffConfigService">
<option name="globalRuffExecutablePath" value="\\wsl.localhost\Ubuntu-22.04\home\fierydruid\.local\bin\ruff" />
<option name="ruffConfigPath" value="\\wsl.localhost\Ubuntu-22.04\home\fierydruid\work\schedule\pythonProject\ruff.toml" />
</component>
</project> I test some cases on: Use test project from my previous comment:
1 caseSelect all rules and check without ignores
2 caseSelect all rules and check with ignore
3 caseSelect only |
Hi, This is happening for me as well. However, unlike the other bug reporters, I am running on macOS, and I don't have a I've had different issues with PyCharm before because this (newer) Python project is not in the root of my Pycharm workspace. Perhaps this could be a reason this isn't working for me? Here is my <?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RuffConfigService">
<option name="globalRuffExecutablePath" value="$USER_HOME$/.pyenv/shims/ruff" />
<option name="globalRuffLspExecutablePath" value="$USER_HOME$/.pyenv/shims/ruff" />
<option name="projectRuffExecutablePath" value="$USER_HOME$/Library/Caches/pypoetry/virtualenvs/server-N8UJI-q9-py3.12/bin/ruff" />
<option name="ruffConfigPath" value="$PROJECT_DIR$/server/pyproject.toml" />
<option name="runRuffOnSave" value="true" />
<option name="useRuffFormat" value="true" />
</component>
</project> |
I did some source code spelunking and I suspect that this might be an error with ruff/working directories when it gets the I have two projects, one which is known good (does not show annotations for lint codes are excluded in the The bad project:
The good project:
Both had the exact same config in [tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["ANN201", "D100", "D102", "D103", "S101", "SLF001"] I built and ran the plugin from scratch and enabled debug logging for the In the good project, I noticed that the command being run was: And in the bad project the command was: I believe the working directory of the command is the issue, because when I cd into |
Describe the bug
After updating to version 0.0.29, the plugin began to highlight rules that are ignored for specific files using the
per-file-ignores
section inruff.toml
. If ruff is run from the console with the same config, it does not find any errors.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Since ruff itself ignores the rule, the plugin should also not highlight it
Screenshots
Test code with error:

project structure with new folder

project_tests
:per-file-ignores
section:ruff check
resuilt from command line:Environments (please complete the following information):
PyCharm Professional 2023.3.2
Windows 10 + WSL (Ubuntu 22.04)
0.1.9
0.0.29
Additional context
It is likely that this may be related to the path to the config file in Windows + WSL: #358
but i fix this error by editing
ruff.xml
in.idea/
. Everything worked fine on the previous version without any changes.The text was updated successfully, but these errors were encountered: