@@ -56,7 +56,7 @@ nowarn = "test -W default {args}"
5656[tool .hatch .envs .typing ]
5757features = [" test" ]
5858[tool .hatch .envs .typing .scripts ]
59- test = " mypy --install-types --non-interactive {args:. }"
59+ test = " mypy --install-types --non-interactive {args}"
6060
6161[tool .hatch .envs .lint ]
6262dependencies = [" black==23.3.0" , " mdformat>0.7" , " ruff==0.0.281" ]
@@ -74,6 +74,7 @@ fmt = [
7474]
7575
7676[tool .mypy ]
77+ files = " traitlets"
7778python_version = " 3.8"
7879check_untyped_defs = true
7980disallow_any_generics = true
@@ -97,7 +98,7 @@ exclude = ["examples/docs/configs", "traitlets/tests/test_typing.py"]
9798[tool .pytest .ini_options ]
9899addopts = " --durations=10 -ra --showlocals --doctest-modules --color yes --ignore examples/docs/configs"
99100testpaths = [
100- " traitlets " ,
101+ " tests " ,
101102 " examples" ,
102103]
103104filterwarnings = [
@@ -153,10 +154,18 @@ target-version = ["py37"]
153154target-version = " py37"
154155line-length = 100
155156select = [
156- " A" , " B" , " C" , " E" , " F" , " FBT" , " I" , " N" , " Q" , " RUF" , " S" , " T" ,
157+ " A" , " ANN " , " B" , " C" , " E" , " F" , " FBT" , " I" , " N" , " Q" , " RUF" , " S" , " T" ,
157158 " UP" , " W" , " YTT" ,
158159]
159160ignore = [
161+ # Dynamically typed expressions (typing.Any) are disallowed in `key`
162+ " ANN401" ,
163+ # Missing type annotation for `self` in method
164+ " ANN101" ,
165+ # Missing type annotation for `cls` in classmethod
166+ " ANN102" ,
167+ # ANN202 Missing return type annotation for private function
168+ " ANN202" ,
160169 # Allow non-abstract empty methods in abstract base classes
161170 " B027" ,
162171 # Ignore McCabe complexity
@@ -211,11 +220,13 @@ unfixable = [
211220# N802 Function name `assertIn` should be lowercase
212221# F841 Local variable `t` is assigned to but never used
213222# B018 Found useless expression
214- # S301 `pickle` and modules that wrap...
215- "traitlets/ tests/*" = [" B011" , " F841" , " C408" , " E402" , " T201" , " B007" , " N802" , " F841" ,
223+ # S301 `pickle` and modules that wrap..."
224+ "tests/*" = [" ANN " , " B011" , " F841" , " C408" , " E402" , " T201" , " B007" , " N802" , " F841" ,
216225 " B018" , " S301" ]
217226# B003 Assigning to os.environ doesn't clear the environment
218- "traitlets /config/tests /*" = [" B003" , " B018" , " S301" ]
227+ "tests /config/*" = [" B003" , " B018" , " S301" ]
219228# F401 `_version.__version__` imported but unused
220229# F403 `from .traitlets import *` used; unable to detect undefined names
221230"traitlets/*__init__.py" = [" F401" , " F403" ]
231+ "docs/*" = [" ANN" ]
232+ "examples/*" = [" ANN" ]
0 commit comments