python-lsp-ruff: `per-file-ignores` doesn't seem to be working
This works in both ruff
via CLI and with python-lsp-ruff
; none of the listed errors are visible in __init__.py
files:
Edit: No it doesn’t, please see comment below.
[tool.ruff]
ignore = [
"E501", # line length violations
"E722", # bare except
]
per-file-ignores = {
# Ignore import violations in all `__init__.py` files
"__init__.py" = ["E402", "F401", "F403"]
}
This works when invoking ruff
via CLI, but not in python-lsp-ruff
; the per-file-ignores are visible in the editor but not in the command line (the global ignore
d errors are still invisible in both):
[tool.ruff]
ignore = [
"E501", # line length violations
"E722", # bare except
]
# Ignore import violations in all `__init__.py` files
[tool.ruff.per-file-ignores]
"__init__.py" = ["E402", "F401", "F403"]
It seems like python-lsp-ruff
doesn’t parse sub-tables specified via headers somehow?
Thank you for this project!
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 18 (8 by maintainers)
Arch package for ruff was updated since my last comment, I can confirm it’s fixed now. Thanks again!
That was it. This package is evolving so fast that it’s hard to keep track to all the changes. Awesome work @charliermarsh!
Relevant configuration from
ruff-lsp
: https://github.com/charliermarsh/ruff-lsp/blob/a49c48e10a6d18301d7fed0d857fbac1441f1a89/ruff_lsp/server.py#L592Right, that was just from that one time above where I already realized the config was invalid (see the first message in this thread). I’ve since fixed it (see the second message) and that error hasn’t come up since (please note the date in that invalid toml error message).
Anyway, here’s the entire thing: