shed uses calendar versioning, with a year.month.patch scheme.
- Improve performance in large repositories, by skipping directories that start with
.during an internal check.
- Disable
PIE790fix due to ruff issue #10538 - Python 3.8 has reached end-of-life,
so
shedtargets and runs on Python 3.9 or later.
- Replace usage of Autoflake, PyUpgrade and isort with ruff.
- Require
black >= 24.1.0, with their updated code style
- Python 3.7 has reached end-of-life,
so
shedtargets and runs on Python 3.8 or later. - Clarify error when missing target file looks like an unexpanded glob pattern.
- Require latest versions of
blackandlibcstfor bugfixes and perf improvements
shed --refactornow merges nested with-statements for Python 3.9+- Skip LibCST passes when it (correctly) objects to invalid code accepted by Black
- Fixed some crash and incorrect-output bugs in
shed --refactor
- Fixed cases where
shedtook two passes to handle unordered and removable imports - Fixed cases where
--refactorwas making unintended semantic changes
- Switch to calendar versioning to match underlying tools
- Fixed cases where
--refactorcould delete comments in parens --refactorreplaces some calls tolist(),tuple()anddict()builtins with literals
- Require Black >= 23.1.0 for latest code style
- Reformat
.pyifiles too
- Fixed
--refactorto avoid incorrect changes to e.g.x = y or len(z) --refactoralso removes redundant calls tobool()in boolean contexts.
--refactornow splitsassert a and b [and c and ...]into a separate assertion for each clause, so that it's always clear which (if any) failed.--refactorremoves redundant calls tolen()in boolean contexts.
- Preserve trailing commas in literals in
--refactormode --refactormode now flattensOptional[Union[...]]toUnion[..., None]- Don't convert
==toisin subscripts, to save e.g.df[df.flag == True]
- Updated for compatibility with new
pyupgrade==3.0.0
- Fix a crash when used with Python 3.10 pattern matching
- Fix a bug where the minimum-version argument was sometimes ignored
- Clarified some error messages for easier debugging
- Require latest version of Black to detect that
f"{x=}"requires Python 3.8+ (and remove previous workaround) - Fixed detection of Hypothesis codemods in
--refactormode
- Handle non-locale-encoded files, such as UTF-8 on Windows (#42)
- Preserve comments on the last element of
Literaltypes with--refactor
- When finding files in a git repo, search from root not current directory
- Keep
else: passblocks if they contain any comments - Leave
Optional[Literal[...]]alone too - Merge
isinstance(x, y) or isinstance(x, z)toisinstance(x, (y, z))
- Dropped
teyitbecausepyupgradenow handles deprecated unittest methods - Don't merge
NoneintoLiteraltypes; it's easier to read| None - Avoid crashing on some rare and questionable code patterns
- With
--refactor, removeelse: passblocks - With
--refactor, "unwrap" lambdas - e.g.lambda x: sorted(x)->sorted
- Several new custom refactoring passes (#37, #38, #39, #40)
- Supports (and requires) new version of
pyupgrade
- Performance optimizations, reducing startup latency via deferred imports
- Fixed an internal error on
# isort: skip_file(#32)
- Fixed a crash with
--refactoron files containingf"{...=}"(#31)
- Fixed
__init__.py-based detection heuristic for first-party module names - Avoid guessing that stdlib modules are first-party due to e.g. a
code/directory
- Require a stable version of Black, which now has a formatting stability policy
- Suppress
stderrmessages from Git when used outside a repository
- Updated minimum dependency versions - bugfixes and improved support for Python 3.9+
- Avoid importing Hypothesis if it's not going to be used (#26)
- Python 3.6 is end-of-life, so format code as 3.7+
- Codemods to fix most warnings from
flake8-comprehensions, in--refactormode - Moves all
libCSTfixers to--refactormode for speed
- Fix an internal error on files with lambdas containing positional-only arguments which were not detected as requiring Python 3.8
- Fix an internal error on files with 'fluent interface' call chains (introduced in 0.5.2)
- Fix latent bugs around min-version handling with Black and LibCST
- Fix a rare crash with
--refactorwhere com2ann could fail to parse input
- Continue in a single process if
os.fork()fails withBlockingIOError
- Stop removing "unused" imports in code blocks; often they're used in later blocks
- Use custom LibCST refactoring passes instead of
pybetter; because these are faster they're also enabled outside of--refactormode - Replace
raise NotImplementedwithraise NotImplementedError - Replace
assert False [, msg]withraise AssertionError [(msg)], for all falsey literals, to avoid surprising behaviour withPYTHONOPTIMIZE(useif __debug__if you need such behaviour) - Remove
assert True, or other truthy literals, which can never fail
- Warn on invalid syntax, and try to format docstrings anyway (#23)
- Skip files or code-blocks with invalid syntax (#23)
- Add new
--py-37-plus(etc) arguments to select the minimum Python version - disable
autoflake's remove-unused-variables; allow linters to warn about probable bugs
- require latest versions of all dependencies; variously fixing some upstream bugs, avoiding installation problems, and adding some refactoring features.
- Fix the other
FileNotFoundErroron Windows, ifgitis not installed.
- Fix a
FileNotFoundErroron Windows, ifgitis not installed.
- require
black >= 21.6b0 - support, and require,
pyupgrade >= 2.21
- leave empty files empty, instead of adding a blank line (which triggered
flake8W391)
- require
black >= 21.5b0to avoid version-detection bug
- avoid new duplicate work when running
shed(withoutpython -m)
- support running via
python -m shed - stop merging nested
with-statements (ugly when multiline on Python <= 3.9)
- support, and require,
pyupgrade>= 2.8.0
- sort
testsimports as aknown_local_folderwithisort - increase minimum dependency versions
- integrates
hypothesis codemodin--refactormode (optional dependency) - improved reporting for internal errors
- work around known errors in pybetter and libcst
- supports Python-3.9-only files
- improved idempotence in
--refactormode with Teyit
- requires newer dependencies -
black20.8b1 or later,autoflake1.4 or later
- add
com2annto--refactoron Python 3.8+
- use multiple processes if formatting many files (ncpus times faster!)
- drop
docformatterdue to poor performance - reorganise remaining passes for speed and split out
--refactorpasses
- use
pybettercodemods - use
teyitto replace deprecatedunittestmethods with the new aliases (if running on Python 3.9+) - use
docformatterto format docstrings - new logic inspired by
blacken-docsto format code in docstrings, via the newshed.docshedfunction
- detect first-party imports in single-file mode as well as all-repo mode
- run
pyupgrade --py36-pluslogic too - print each file skipped due to permissions or encoding issues
- combine "as" imports with
isorton a single line
- automatic and isolated
isortconfiguration. I am now happy to recommend that you tryshed!
- better handling of permissions issues or deleted files
- compatible with pyupgrade==2.4
- compatible with pyupgrade==2.2
- usable CLI
- better isort autoconfig
- project kickoff