samredai commented on a change in pull request #3423:
URL: https://github.com/apache/iceberg/pull/3423#discussion_r740639678



##########
File path: python/tox.ini
##########
@@ -34,79 +33,39 @@ commands =
     coverage report -m --fail-under=90
     coverage html -d test-reports/{envname}/coverage-html
     coverage xml -o test-reports/{envname}/coverage.xml
-[testenv:format]
-description = reformat all source code
-basepython = python3
-deps =
-    black
-    isort
-    flake8
-skip_install = true
-commands =
-    isort --project iceberg --profile black setup.py src tests
-    black setup.py src tests
-    flake8 setup.py src tests
 
 [testenv:linters]
-basepython = python3
-skip_install = true
-deps =
-    .
-    {[testenv:isort]deps}
-    {[testenv:black]deps}
-    {[testenv:flake8]deps}
-    {[testenv:bandit]deps}
-    {[testenv:mypy]deps}
-commands =
-    {[testenv:isort]deps}
-    {[testenv:black]deps}
-    {[testenv:flake8]commands}
-    {[testenv:bandit]commands}
-    {[testenv:mypy]commands}
-
-[testenv:isort]
-basepython = python3
-skip_install = true
+usedevelop = true
 deps =
-    isort
+    {[testenv:format-check]deps}
+    {[testenv:type-check]deps}
 commands =
-    isort --recursive --project iceberg --profile black --check-only setup.py 
src tests
+    {[testenv:format-check]commands}
+    {[testenv:type-check]commands}
 
-[testenv:black]
-basepython = python3
-skip_install = true
+[testenv:format-check]
 deps =
     black
+    isort
+    autoflake
 commands =
-    black --check --diff src setup.py tests
+    autoflake -r --check --ignore-init-module-imports 
--remove-all-unused-imports setup.py src tests
+    isort --profile black --check-only setup.py src tests
+    black --check setup.py src tests
 
-[testenv:flake8]
-basepython = python3
-skip_install = true
+[testenv:format]
 deps =
-    flake8>=3.8.4
-    flake8-import-order>=0.9
-    flake8-bugbear
+    {[testenv:format-check]deps}
 commands =
-    flake8 src setup.py tests
+    autoflake -r --in-place --ignore-init-module-imports 
--remove-all-unused-imports setup.py src tests
+    isort --profile black setup.py src tests
+    black setup.py src tests
 
-[testenv:mypy]
-basepython = python3
-skip_install = true
+[testenv:type-check]
 deps =
     mypy
-    types-pytz
-    types-python-dateutil
-commands =
-    mypy --ignore-missing-imports src/
-
-[testenv:bandit]
-basepython = python3
-skip_install = true
-deps =
-    bandit
 commands =
-    bandit --ini tox.ini -r src
+    mypy src

Review comment:
       nit: Should we add `--no-implicit-optional` here? This will require the 
explicit `x: Optional[int] = None` and will fail on `x: int = None`. The latter 
always reads odd to me, "must be an int, but by default it's None". The 
Optional type hint feels clearer.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to