File tree Expand file tree Collapse file tree 5 files changed +26
-4
lines changed
Expand file tree Collapse file tree 5 files changed +26
-4
lines changed Original file line number Diff line number Diff line change 11# Changelog
22* ` shed ` uses [ calendar versioning] ( https://calver.org/ ) , with a year.month.patch scheme.*
33
4+ #### 2025.6.1 - 2025-06-05
5+ - Improve performance in large repositories, by skipping directories that start with ` . ` during an internal check.
6+
47#### 2024.10.1 - 2024-04-27
58- Disable ` PIE790 ` fix due to [ ruff issue #10538 ] ( https://github.com/astral-sh/ruff/issues/10538 )
69- [ Python 3.8 has reached end-of-life] ( https://devguide.python.org/versions/ ) ,
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ adding the following to your `.pre-commit-config.yaml`:
5959minimum_pre_commit_version : ' 2.9.0'
6060repos :
6161- repo : https://github.com/Zac-HD/shed
62- rev : 2024.10 .1
62+ rev : 2025.6 .1
6363 hooks :
6464 - id : shed
6565 # args: [--refactor, --py311-plus]
Original file line number Diff line number Diff line change 1919from black .mode import TargetVersion
2020from black .parsing import lib2to3_parse
2121
22- __version__ = "2024.10 .1"
22+ __version__ = "2025.6 .1"
2323__all__ = ["shed" , "docshed" ]
2424
2525# Conditionally imported in refactor mode to reduce startup latency in the common case
Original file line number Diff line number Diff line change @@ -47,7 +47,26 @@ def _guess_first_party_modules(cwd: Optional[str] = None) -> FrozenSet[str]:
4747 base = _get_git_repo_root (cwd )
4848 except (subprocess .SubprocessError , FileNotFoundError ):
4949 return frozenset ()
50- provides = {init .parent .name for init in Path (base ).glob ("**/src/*/__init__.py" )}
50+
51+ def _walk_path (path : Path ) -> set [str ]:
52+ provides = set ()
53+ try :
54+ for p in path .iterdir ():
55+ if p .name .startswith ("." ) or not p .is_dir ():
56+ continue
57+ if p .name == "src" :
58+ provides |= {init .parent .name for init in p .glob ("*/__init__.py" )}
59+ # in case of nested src/ directories, like
60+ # src/tools/src/helper/__init__.py
61+ provides |= _walk_path (p )
62+ else :
63+ provides |= _walk_path (p )
64+ except Exception : # pragma: no cover
65+ pass
66+
67+ return provides
68+
69+ provides = _walk_path (Path (base ))
5170 return frozenset (
5271 p
5372 for p in {Path (base ).name } | provides
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ def _detect_encoding(
7272
7373
7474def _inner_detect_encoding (
75- readline : Callable [[], bytes | bytearray ]
75+ readline : Callable [[], bytes | bytearray ],
7676) -> str : # pragma: no cover
7777 """Return file encoding."""
7878 try :
You can’t perform that action at this time.
0 commit comments