@@ -75,33 +75,28 @@ features = ["test"]
7575test = " mypy --install-types --non-interactive {args}"
7676
7777[tool .hatch .envs .lint ]
78- dependencies = [" black==23.3.0 " , " mdformat>0.7" , " ruff==0.1.1 " ]
78+ dependencies = [" mdformat>0.7" , " ruff==0.1.3 " ]
7979detached = true
8080[tool .hatch .envs .lint .scripts ]
8181style = [
8282 " ruff {args:.}" ,
83- " black --check --diff {args:.}" ,
83+ " ruff format {args:.}" ,
8484 " mdformat --check {args:docs *.md}"
8585]
8686fmt = [
87- " black {args:.}" ,
8887 " ruff --fix {args:.}" ,
88+ " ruff format {args:.}" ,
8989 " mdformat {args:docs *.md}"
9090]
9191
9292[tool .mypy ]
9393files = " traitlets"
9494python_version = " 3.8"
95- strict = false
96- check_untyped_defs = true
97- disallow_any_generics = false
98- disable_error_code = [" no-untyped-call" ]
95+ strict = true
9996enable_error_code = [" ignore-without-code" , " redundant-expr" , " truthy-bool" ]
100- no_implicit_reexport = false
10197pretty = true
10298show_error_context = true
10399show_error_codes = true
104- warn_return_any = false
105100warn_unreachable = true
106101exclude = [" examples/docs/configs" , " traitlets/tests/test_typing.py" ]
107102
@@ -162,27 +157,16 @@ exclude_lines = [
162157relative_files = true
163158source = [" traitlets" ]
164159
165- [tool .black ]
166- line-length = 100
167- skip-string-normalization = true
168- target-version = [" py37" ]
169-
170160[tool .ruff ]
171- target-version = " py37 "
161+ target-version = " py38 "
172162line-length = 100
163+
164+ [tool .ruff .lint ]
173165select = [
174- " A" , " ANN " , " B" , " C" , " E" , " F" , " FBT" , " I" , " N" , " Q" , " RUF" , " S" , " T" ,
166+ " A" , " B" , " C" , " E" , " F" , " FBT" , " I" , " N" , " Q" , " RUF" , " S" , " T" ,
175167 " UP" , " W" , " YTT" ,
176168]
177169ignore = [
178- # Dynamically typed expressions (typing.Any) are disallowed in `key`
179- " ANN401" ,
180- # Missing type annotation for `self` in method
181- " ANN101" ,
182- # Missing type annotation for `cls` in classmethod
183- " ANN102" ,
184- # ANN202 Missing return type annotation for private function
185- " ANN202" ,
186170 # Allow non-abstract empty methods in abstract base classes
187171 " B027" ,
188172 # Ignore McCabe complexity
@@ -231,7 +215,7 @@ unfixable = [
231215 " RUF100" ,
232216]
233217
234- [tool .ruff .per-file-ignores ]
218+ [tool .ruff .lint . per-file-ignores ]
235219# B011 Do not call assert False since python -O removes these calls
236220# F841 local variable 'foo' is assigned to but never used
237221# C408 Unnecessary `dict` call
@@ -242,15 +226,13 @@ unfixable = [
242226# F841 Local variable `t` is assigned to but never used
243227# B018 Found useless expression
244228# S301 `pickle` and modules that wrap..."
245- "tests/*" = [" ANN " , " B011" , " F841" , " C408" , " E402" , " T201" , " B007" , " N802" , " F841" ,
229+ "tests/*" = [" B011" , " F841" , " C408" , " E402" , " T201" , " B007" , " N802" , " F841" ,
246230 " B018" , " S301" ]
247231# B003 Assigning to os.environ doesn't clear the environment
248232"tests/config/*" = [" B003" , " B018" , " S301" ]
249233# F401 `_version.__version__` imported but unused
250234# F403 `from .traitlets import *` used; unable to detect undefined names
251235"traitlets/*__init__.py" = [" F401" , " F403" ]
252- "docs/*" = [" ANN" ]
253- "examples/*" = [" ANN" ]
254236
255237[tool .repo-review ]
256238ignore = [" PY007" , " PP308" , " GH102" , " PC140" , " MY101" ]
0 commit comments