@@ -27,16 +27,19 @@ line-length = 130
2727target-version = " py39"
2828
2929[tool .ruff .lint ]
30- # TODO: Use extend-select instead to get base E and F rules that don't conflict with the formatter
31- select = [
30+ extend-select = [
3231 " FA" , # flake8-future-annotations
3332 " I" , # isort
3433 " PYI" , # flake8-pyi
34+ " W" , # pycodestyle Warning
3535]
3636ignore = [
3737 # ##
3838 # Rules we don't want or don't agree with
3939 # ##
40+ # Used for direct, non-subclass type comparison, for example: `type(val) is str`
41+ # see https://github.com/astral-sh/ruff/issues/6465
42+ " E721" , # Do not compare types, use `isinstance()`
4043 # Typeshed doesn't want complex or non-literal defaults, or long strings, for maintenance and testing reasons.
4144 # This doesn't affect us, let's have more complete stubs.
4245 " PYI011" ,
@@ -46,6 +49,11 @@ ignore = [
4649 # TODO: Handle in its own PR
4750 " PYI021" , # https://github.com/microsoft/python-type-stubs/pull/343
4851
52+ # TODO: Fixing these would change which symbols are even visible for Pylance.
53+ # Which may negatively affect users, especially if the symbol wasn't meant to be re-exported.
54+ # Manually evaluate each violation.
55+ " F401" ,
56+
4957 # TODO: Investigate and fix or configure
5058 " PYI001" ,
5159 " PYI002" ,
@@ -56,6 +64,17 @@ ignore = [
5664 " PYI051" , # Request for autofix: https://github.com/astral-sh/ruff/issues/14185
5765 " PYI052" ,
5866]
67+ [tool .ruff .lint .per-file-ignores ]
68+ "*.pyi" = [
69+ # ##
70+ # Rules that are out of the control of stub authors:
71+ # ##
72+ " E743" , # Ambiguous function name; stubs must follow implementation
73+ " F403" , # `from . import *` used; unable to detect undefined names
74+ # Stubs can sometimes re-export entire modules.
75+ # Issues with using a star-imported name will be caught by type-checkers.
76+ " F405" , # may be undefined, or defined from star imports
77+ ]
5978
6079[tool .ruff .lint .isort ]
6180combine-as-imports = true
0 commit comments