CodeSorter is a LibCST codemod that automatically sorts and organizes Python code.
Repo praw-dev/CodeSorter, read from GitHub 20 min ago. praw-dev has not joined Take My Repo.
Fixed
APP = App() only references App syntactically, butApp.__init__, which may read a module-level function definedNameError at import. The runtime references reachable through a calledOrderedDict call. OrderedDict(b=2, a=1) iterates in argument order and is a distinct value from OrderedDict(a=1, b=2), so reordering its keyword arguments changed the resulting object. Calls toOrderedDict (bare or dotted, such as collections.OrderedDict) are now leftFixed
CACHE_MISS = _Sentinel.CACHE_MISS beside class _Sentinel(Enum): CACHE_MISS = auto()) previously forged a false class -> constant edge thatconstant -> class edge, hoisting the constantNameError at import. A name bound in aAdded
Changed
Changed
ruff directly so the formatter is always installed alongsidecodesorter. The CLI shells out to ruff format, which previously only workedruff happened to be on PATH from another source; it is now a runtimecodesorter is self-contained in a clean environment and in theFixed
sys.path.insert(0, str(REPO_ROOT)) is now a barrier, and sorting happens onlyNameError).Fixed
ten = cachedproperty(ten, ...)def ten now stays after the method it wraps instead of being hoistedNameError and changed which binding wins). Property