11target-version = " py310"
2- line-length = 110
2+ line-length = 120
33exclude = [
44 " .git," ,
55 " __pycache__" ,
@@ -19,27 +19,50 @@ extend-ignore = [
1919 " E712" ,
2020 " E721" ,
2121 # pycodestyle (E, W)
22- " E501" , # LineTooLong # TODO! fix
22+ " E501" , # ignore line length will use a formatter instead
23+ # pyupgrade (UP)
24+ " UP038" , # Use | in isinstance - not compatible with models and is slower
2325 # pytest (PT)
2426 " PT001" , # Always use pytest.fixture()
2527 " PT004" , # Fixtures which don't return anything should have leading _
26- " PT007" , # Parametrize should be lists of tuples # TODO! fix
27- " PT011" , # Too broad exception assert # TODO! fix
2828 " PT023" , # Always use () on pytest decorators
29+ # flake8-pie (PIE)
30+ " PIE808" , # Disallow passing 0 as the first argument to range
31+ # flake8-use-pathlib (PTH)
32+ " PTH123" , # open() should be replaced by Path.open()
33+ # Ruff (RUF)
34+ " RUF003" , # Ignore ambiguous quote marks, doesn't allow ' in comments
35+ " RUF012" , # Mutable class attributes should be annotated with `typing.ClassVar`
36+ " RUF013" , # PEP 484 prohibits implicit `Optional`
37+ " RUF015" , # Prefer `next(iter(...))` over single element slice
2938]
3039
3140[lint .per-file-ignores ]
32- # Part of configuration, not a package.
33- "setup.py" = [" INP001" ]
34- "conftest.py" = [" INP001" ]
41+ "setup.py" = [
42+ " INP001" , # File is part of an implicit namespace package.
43+ ]
44+ "conftest.py" = [
45+ " INP001" , # File is part of an implicit namespace package.
46+ ]
3547"docs/conf.py" = [
36- " E402" # Module imports not at top of file
48+ " E402" # Module imports not at top of file
3749]
3850"docs/*.py" = [
39- " INP001" , # Implicit-namespace-package. The examples are not a package.
51+ " INP001" , # File is part of an implicit namespace package.
52+ ]
53+ "examples/**.py" = [
54+ " T201" , # allow use of print in examples
55+ " INP001" , # File is part of an implicit namespace package.
56+ ]
57+ "__init__.py" = [
58+ " E402" , # Module level import not at top of cell
59+ " F401" , # Unused import
60+ " F403" , # from {name} import * used; unable to detect undefined names
61+ " F405" , # {name} may be undefined, or defined from star imports
62+ ]
63+ "test_*.py" = [
64+ " E402" , # Module level import not at top of cell
4065]
41- "__init__.py" = [" E402" , " F401" , " F403" ]
42- "test_*.py" = [" B011" , " D" , " E402" , " PGH001" , " S101" ]
4366
4467[lint .pydocstyle ]
4568convention = " numpy"
0 commit comments