From 2bbf393122bcf69ac7ad923340a2e2b628aa7ace Mon Sep 17 00:00:00 2001 From: Jeremy Paige Date: Fri, 2 Jul 2021 14:44:10 -0700 Subject: [PATCH 1/4] Symlinked paths are excluded from gitignore checks --- isort/settings.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/isort/settings.py b/isort/settings.py index 0d227a61a..7cec61048 100644 --- a/isort/settings.py +++ b/isort/settings.py @@ -548,7 +548,15 @@ def _check_folder_gitignore(self, folder: str) -> Optional[Path]: git_folder = Path(topfolder_result.rstrip()).resolve() - files = [str(p) for p in Path(git_folder).rglob("*")] + files: List[str] = [] + # don't check symlinks; either part of the repo and would be checked + # twice, or is external to the repo and git won't konw anything about it + for root, _dirs, git_files in os.walk(git_folder, followlinks=False): + for git_file in git_files: + git_path = os.path.join(root, git_file) + # followlinks only disables walking into linked dirs + if not os.path.islink(git_path): + files.append(git_path) git_options = ["-C", str(git_folder), "-c", "core.quotePath="] try: ignored = subprocess.check_output( # nosec # skipcq: PYL-W1510 From 25174dd55391135f51e74a83afbc07e29257d598 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Mon, 5 Jul 2021 17:18:40 +0500 Subject: [PATCH 2/4] missing space in description of force_grid_wrap --- docs/configuration/options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration/options.md b/docs/configuration/options.md index bbbdc911b..47f034433 100644 --- a/docs/configuration/options.md +++ b/docs/configuration/options.md @@ -622,7 +622,7 @@ Force all imports to be sorted as a single section ## Force Grid Wrap -Force number of from imports (defaults to 2 when passed as CLI flag without value)to be grid wrapped regardless of line length. If 0 is passed in (the global default) only line length is considered. +Force number of from imports (defaults to 2 when passed as CLI flag without value) to be grid wrapped regardless of line length. If 0 is passed in (the global default) only line length is considered. **Type:** Int **Default:** `0` From 2c16b7cb49e36c861a4f5fae0ec2ae12019e9142 Mon Sep 17 00:00:00 2001 From: Timothy Crosley Date: Tue, 6 Jul 2021 17:15:01 -0700 Subject: [PATCH 3/4] Fix typo in source command doc --- isort/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isort/main.py b/isort/main.py index ca0ce5e20..0c3950bc9 100644 --- a/isort/main.py +++ b/isort/main.py @@ -472,7 +472,7 @@ def _build_arg_parser() -> argparse.ArgumentParser: const=2, type=int, dest="force_grid_wrap", - help="Force number of from imports (defaults to 2 when passed as CLI flag without value)" + help="Force number of from imports (defaults to 2 when passed as CLI flag without value) " "to be grid wrapped regardless of line " "length. If 0 is passed in (the global default) only line length is considered.", ) From f44b5a55b0b8f09c0983bca8b425ecdd6aaf74a3 Mon Sep 17 00:00:00 2001 From: Timothy Crosley Date: Tue, 6 Jul 2021 17:20:33 -0700 Subject: [PATCH 4/4] Update changelog in preperation for release soon --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4863d54ce..4ba31082c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,10 @@ Changelog NOTE: isort follows the [semver](https://semver.org/) versioning standard. Find out more about isort's release policy [here](https://pycqa.github.io/isort/docs/major_releases/release_policy). -### 5.9.2 +### 5.9.2 TBD - Improved behavior of `isort --check --atomic` against Cython files. + - Fixed #1772: skip-gitignore will check files not in the git repository. + - Fixed #1762: in some cases when skip-gitignore is set, isort fails to skip any files. ### 5.9.1 June 21st 2021 [hotfix] - Fixed #1758: projects with many files and skip_ignore set can lead to a command-line overload.