@@ -53,15 +53,22 @@ docs = [
5353 " sphinx-click" ,
5454]
5555test = [
56- " coverage" ,
57- " fastapi" ,
58- " pre-commit" ,
59- " pytest>=7.0" ,
60- " pytest-cov" ,
61- " pytest-mock" ,
62- " pytest-xdist[psutil]" ,
63- " uvicorn"
56+ " coverage" ,
57+ " fastapi" ,
58+ " pre-commit" ,
59+ " pytest>=7.0" ,
60+ " pytest-cov" ,
61+ " pytest-mock" ,
62+ " pytest-xdist[psutil]" ,
63+ " uvicorn"
6464]
65+ lint = [
66+ " black>=22.6.0" ,
67+ " mdformat>0.7" ,
68+ " mdformat-gfm>=0.3.5" ,
69+ " ruff>=0.0.156"
70+ ]
71+ typing = [" mypy>=0.990" ]
6572
6673[project .scripts ]
6774jupyter-releaser = " jupyter_releaser.cli:main"
@@ -88,6 +95,25 @@ dependencies = ["coverage", "pytest-cov"]
8895test = " python -m pytest -vv --cov jupyter_releaser --cov-branch --cov-report term-missing:skip-covered {args}"
8996nowarn = " test -W default {args}"
9097
98+ [tool .hatch .envs .typing ]
99+ features = [" typing" , " test" ]
100+ [tool .hatch .envs .typing .scripts ]
101+ test = " mypy --install-types --non-interactive {args:jupyter_releaser}"
102+
103+ [tool .hatch .envs .lint ]
104+ features = [" lint" ]
105+ [tool .hatch .envs .lint .scripts ]
106+ style = [
107+ " ruff {args:.}" ,
108+ " black --check --diff {args:.}" ,
109+ " mdformat --check {args:docs *.md}"
110+ ]
111+ fmt = [
112+ " black {args:.}" ,
113+ " ruff --fix {args:.}" ,
114+ " mdformat {args:docs *.md}"
115+ ]
116+
91117[tool .jupyter-releaser .hooks ]
92118after-populate-release = " bash ./.github/scripts/bump_tag.sh"
93119
@@ -148,23 +174,61 @@ module = [
148174]
149175ignore_missing_imports = true
150176
151- [tool .flake8 ]
152- ignore = " E501, W503, E402"
153- builtins = " c, get_config"
154- exclude = [
155- " .cache" ,
156- " .github" ,
157- " docs" ,
158- " setup.py" ,
177+ [tool .black ]
178+ line-length = 100
179+ skip-string-normalization = true
180+ target-version = [" py37" ]
181+
182+ [tool .ruff ]
183+ target-version = " py37"
184+ line-length = 100
185+ select = [
186+ " A" , " B" , " C" , " E" , " F" , " FBT" , " I" , " N" , " Q" , " RUF" , " S" , " T" ,
187+ " UP" , " W" , " YTT" ,
159188]
160- enable-extensions = " G"
161- extend-ignore = [
162- " G001" , " G002" , " G004" , " G200" , " G201" , " G202" ,
163- # black adds spaces around ':'
164- " E203" ,
189+ ignore = [
190+ # Allow non-abstract empty methods in abstract base classes
191+ " B027" ,
192+ # Ignore McCabe complexity
193+ " C901" ,
194+ # Allow boolean positional values in function calls, like `dict.get(... True)`
195+ " FBT003" ,
196+ # Use of `assert` detected
197+ " S101" ,
198+ # Line too long
199+ " E501" ,
200+ # Relative imports are banned
201+ " I252" ,
202+ # Boolean ... in function definition
203+ " FBT001" , " FBT002" ,
204+ # Module level import not at top of file
205+ " E402" ,
206+ # A001/A002/A003 .. is shadowing a python builtin
207+ " A001" , " A002" , " A003" ,
208+ # Possible hardcoded password
209+ " S105" , " S106" ,
210+ # Q000 Single quotes found but double quotes preferred
211+ " Q000" ,
212+ # N806 Variable `B` in function should be lowercase
213+ " N806" ,
214+ # T201 `print` found
215+ " T201" ,
216+ # N802 Function name `CreateWellKnownSid` should be lowercase
217+ " N802" , " N803"
165218]
166- per-file-ignores = [
167- # B011: Do not call assert False since python -O removes these calls
168- # F841 local variable 'foo' is assigned to but never used
169- " jupyter_releaser/tests/*: B011" , " F841" ,
219+ unfixable = [
220+ # Don't touch print statements
221+ " T201" ,
222+ # Don't touch noqa lines
223+ " RUF100" ,
170224]
225+
226+ [tool .ruff .per-file-ignores ]
227+ # B011 Do not call assert False since python -O removes these calls
228+ # F841 local variable 'foo' is assigned to but never used
229+ # C408 Unnecessary `dict` call
230+ # E402 Module level import not at top of file
231+ # T201 `print` found
232+ # B007 Loop control variable `i` not used within the loop body.
233+ # N802 Function name `assertIn` should be lowercase
234+ "jupyter_releaser/tests/*" = [" B011" , " F841" , " C408" , " E402" , " T201" , " B007" , " N802" ]
0 commit comments