Reconsider supporting #noqa now that Pyright does syntax-checking (Issue #144) #7607
Replies: 1 comment 1 reply
-
Pyright is a standards-compliant type checker, and Pyright also offers extensive configuration capabilities and fine-grained control over diagnostics. You can disable specific diagnostic rules on a per-project or per-file basis. As I've stated previously, pyright is not a linter. It doesn't enforce code style rules. If you want linter functionality, you should use tools like pylint or ruff, which work in conjunction with type checkers. We have no plans to support |
Beta Was this translation helpful? Give feedback.
-
We updated our VS Code/PyLance/Pyright installations recently, and we're now getting flooded with warnings from vendor libraries because pyright insists on checking unbound variables, missing members, etc on lines marked with "# noqa." This was originally brought up in issue #144 , but was dismissed and closed by @erictraut because "Pyright doesn't perform any linting (code style) checks, only type checks." That's apparently no longer the case, and now Pyright is checking syntax were it should not. "noqa" is a well known standard for linters, and using "# type: ignore" would be incorrect (since it has nothing to do with type). Either we re-open the original issue, or I propose creating a new issue that references the original. Any comments beforehand?
Beta Was this translation helpful? Give feedback.
All reactions