From d148e7915c03d33e2e3cdb49957cd19c119cd4b1 Mon Sep 17 00:00:00 2001 From: JSIV Date: Thu, 13 Apr 2023 15:04:28 -0500 Subject: [PATCH] Set isort profile argument to "black" There are some corner-cases where isort and black revert each other's changes and you can't resolve your code such that they're both happy. There's a related issue in the iSort repo (#1518) (https://github.com/PyCQA/isort/issues/1518). Appears the solution is to use the "black" profile, which can be set in setup.cfg or .pre-commit-config.yaml. This change adds the profile arg to the .pre-commit-config.yaml file --- {{cookiecutter.project_slug}}/.pre-commit-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 073df732e6..de7fd323d1 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -24,7 +24,8 @@ repos: rev: 5.12.0 hooks: - id: isort - + args: ["--profile", "black"] + - repo: https://github.com/PyCQA/flake8 rev: 6.0.0 hooks: