From 2e4620e7152597d4e657ab51bd04706f34609965 Mon Sep 17 00:00:00 2001 From: Yuming Zhu Date: Oct 21 2024 12:12:32 +0000 Subject: add isort for automatically import sorting --- diff --git a/tox.ini b/tox.ini index 5b56a3a..24c87b2 100644 --- a/tox.ini +++ b/tox.ini @@ -79,6 +79,34 @@ commands_pre = commands = {[testenv:py2]commands} +[testenv:isort] +deps = + isort +skip_install=true +usedevelop=true +whitelist_externals = isort +allowlist_externals = isort +commands = isort --check --diff {posargs:.} + +[testenv:isort-format] +deps = + isort +skip_install=true +usedevelop=true +whitelist_externals = isort +allowlist_externals = isort +commands = isort {posargs:.} + +[isort] +; skip_glob = tests +not_skip = __init__.py +default_section = THIRDPARTY +known_first_party = koji,koji_cli,kojihub,kojiweb,__main__ +sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER +no_lines_before = LOCALFOLDER +multi_line_output = 3 +line_length = 99 + [testenv:bandit] # These two lines just speed things up by avoiding unnecessary setup skip_install=true