mirror of
https://github.com/cockpit-project/cockpit.git
synced 2026-11-03 21:49:50 -09:00
pyproject.toml: tweak pyright config
Unfortunately, `root=` doesn't mean what I thought it did. It does select the files to be considered for the given overrides, but it also adds the given directory to the search path. Having `root="test"` is a problem because it contains a `pytest` subdirectory, which is what pyright thinks you're talking about if you say `import pytest`. Ideally we'd be able to say that all code found in `test/` gets access to testlib, without adding `test/` itself. I also tried to say that `src/` doesn't get access to testlib but `.` does, but this resulted in `testlib` being accessible from files in `src/` as well. Let's just simplify this to be more like our mypy setup. Really: if you're importing testlib from the bridge, you're gonna find out about the problem with that pretty quickly anyway. Let's turn on strict while we're at it. We don't actually run pyright, but it gets more messages into the editor, which is nice.
This commit is contained in:
parent
653829e423
commit
2c11e25896
1 changed files with 2 additions and 4 deletions
|
|
@ -144,10 +144,8 @@ log_cli = true
|
|||
required_plugins = ["pytest-asyncio"]
|
||||
|
||||
[tool.pyright]
|
||||
executionEnvironments = [
|
||||
{ root = "test", extraPaths = ["test/common", "bots"] },
|
||||
{ root = "src" }
|
||||
]
|
||||
strict = ["**"]
|
||||
extraPaths = ["src", "test/common", "bots"]
|
||||
|
||||
[tool.vulture]
|
||||
paths = [
|
||||
|
|
|
|||
Loading…
Reference in a new issue