diff --git a/cookiecutter.json b/cookiecutter.json index 208f8d1a8..1b559b2a7 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -9,6 +9,7 @@ "version": "0.1.0", "use_pytest": "n", "use_black": "n", + "use_isort": "n", "use_pypi_deployment_with_travis": "y", "add_pyup_badge": "n", "command_line_interface": ["Click", "Argparse", "No command-line interface"], diff --git a/{{cookiecutter.project_slug}}/Makefile b/{{cookiecutter.project_slug}}/Makefile index b2cf6cda7..60f75a277 100644 --- a/{{cookiecutter.project_slug}}/Makefile +++ b/{{cookiecutter.project_slug}}/Makefile @@ -1,5 +1,6 @@ .PHONY: clean clean-build clean-pyc clean-test coverage dist docs help install lint lint/flake8 {%- if cookiecutter.use_black == 'y' %} lint/black{% endif %} + {%- if cookiecutter.use_isort == 'y' %} lint/isort{% endif %} .DEFAULT_GOAL := help define BROWSER_PYSCRIPT @@ -56,7 +57,10 @@ lint/black: ## check style with black black --check {{ cookiecutter.project_slug }} tests {%- endif %} -lint: lint/flake8{%- if cookiecutter.use_black == 'y' %} lint/black{%- endif %} ## check style +lint/isort: ## clean up all of the imports (using isort) + isort src tests + +lint: lint/flake8{%- if cookiecutter.use_black == 'y' %} lint/black{%- endif %}{%- if cookiecutter.use_isort == 'y' %} lint/isort{%- endif %} ## check style test: ## run tests quickly with the default Python {%- if cookiecutter.use_pytest == 'y' %} diff --git a/{{cookiecutter.project_slug}}/requirements_dev.txt b/{{cookiecutter.project_slug}}/requirements_dev.txt index e02093f48..451836999 100644 --- a/{{cookiecutter.project_slug}}/requirements_dev.txt +++ b/{{cookiecutter.project_slug}}/requirements_dev.txt @@ -13,3 +13,5 @@ Click==7.1.2{% endif %} pytest==6.2.4{% endif %} {% if cookiecutter.use_black == 'y' -%} black==21.7b0{% endif %} +{% if cookiecutter.use_isort == 'y' -%} +isort{% endif %}