codesorter 0.2.1__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codesorter-0.2.1 → codesorter-0.2.2}/CHANGES.rst +10 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/PKG-INFO +1 -1
- {codesorter-0.2.1 → codesorter-0.2.2}/codesorter/cli.py +18 -19
- {codesorter-0.2.1 → codesorter-0.2.2}/codesorter/const.py +1 -1
- {codesorter-0.2.1 → codesorter-0.2.2}/.github/dependabot.yml +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/.github/workflows/ci.yml +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/.github/workflows/pre-commit_autoupdate.yml +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/.github/workflows/prepare_release.yml +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/.github/workflows/pypi.yml +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/.github/workflows/scorecard.yml +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/.github/workflows/stale_action.yml +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/.github/workflows/tag_release.yml +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/.gitignore +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/.libcst.codemod.yaml +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/.pre-commit-config.yaml +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/.pre-commit-hooks.yaml +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/.python-version +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/.readthedocs.yaml +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/LICENSE.txt +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/README.rst +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/codesorter/__init__.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/codesorter/py.typed +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/codesorter/sort_code.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/docs/Makefile +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/docs/code_overview/sort_code.rst +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/docs/conf.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/docs/contributing/pre_commit.rst +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/docs/docutils.conf +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/docs/genindex.rst +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/docs/index.rst +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/docs/make.bat +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/docs/package_info/change_log.rst +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/examples/after_example.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/examples/before_example.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/pyproject.toml +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/__init__.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/conftest.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/alias_function_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/alias_function_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/augmented_assignment_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/augmented_assignment_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/basic_function_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/basic_function_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/class_global_dependency_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/class_global_dependency_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/class_inheritance_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/class_inheritance_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/class_method_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/class_method_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/classmethod_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/classmethod_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/comprehension_dependency_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/comprehension_dependency_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/comprehensive_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/comprehensive_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/constant_ordering_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/constant_ordering_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/custom_decorators_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/custom_decorators_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/keyword_arguments_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/keyword_arguments_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/lazy_annotation_cycle_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/lazy_annotation_cycle_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/mixed_decorators_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/mixed_decorators_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/order_sensitive_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/order_sensitive_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/property_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/property_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/pytest_fixtures_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/pytest_fixtures_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/staticmethod_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/staticmethod_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/underscore_ordering_input.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_files/underscore_ordering_output.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/tests/test_sort_code.py +0 -0
- {codesorter-0.2.1 → codesorter-0.2.2}/uv.lock +0 -0
|
@@ -4,6 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
codesorter follows `semantic versioning <https://semver.org/>`_.
|
|
6
6
|
|
|
7
|
+
********************
|
|
8
|
+
0.2.2 (2026/06/14)
|
|
9
|
+
********************
|
|
10
|
+
|
|
11
|
+
**Changed**
|
|
12
|
+
|
|
13
|
+
- Format reordered files with ``ruff`` by default instead of ``black``, so a downstream
|
|
14
|
+
project no longer needs a ``.libcst.codemod.yaml`` to use the ``codesorter`` CLI or
|
|
15
|
+
pre-commit hook. ``ruff`` must be importable on the ``PATH`` when sorting.
|
|
16
|
+
|
|
7
17
|
********************
|
|
8
18
|
0.2.1 (2026/06/14)
|
|
9
19
|
********************
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codesorter
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: A Python codemod that sorts and organizes code in your files.
|
|
5
5
|
Project-URL: Change Log, https://codesorter.readthedocs.io/en/latest/package_info/change_log.html
|
|
6
6
|
Project-URL: Documentation, https://codesorter.readthedocs.io/
|
|
@@ -8,9 +8,8 @@ from pathlib import Path
|
|
|
8
8
|
from typing import TYPE_CHECKING
|
|
9
9
|
|
|
10
10
|
import libcst as cst
|
|
11
|
-
import libcst.tool
|
|
12
11
|
import pathspec
|
|
13
|
-
from libcst.codemod import CodemodContext
|
|
12
|
+
from libcst.codemod import CodemodContext, parallel_exec_transform_with_prettyprint
|
|
14
13
|
|
|
15
14
|
from codesorter.const import DEFAULT_EXCLUDES
|
|
16
15
|
from codesorter.sort_code import SortCodeCommand
|
|
@@ -208,20 +207,20 @@ def main(*, argv: list[str] | None = None) -> None:
|
|
|
208
207
|
if args.check:
|
|
209
208
|
sys.exit(_check_files(files=files))
|
|
210
209
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
sys.exit(
|
|
210
|
+
# Format with ruff so downstream projects need no ``.libcst.codemod.yaml`` (the
|
|
211
|
+
# libcst codemod tool would otherwise default to black).
|
|
212
|
+
result = parallel_exec_transform_with_prettyprint(
|
|
213
|
+
SortCodeCommand,
|
|
214
|
+
files,
|
|
215
|
+
format_code=True,
|
|
216
|
+
formatter_args=["ruff", "format", "-"],
|
|
217
|
+
jobs=args.jobs,
|
|
218
|
+
repo_root=".",
|
|
219
|
+
show_successes=args.show_successes,
|
|
220
|
+
unified_diff=5 if args.unified_diff else None,
|
|
221
|
+
)
|
|
222
|
+
sys.stderr.write(f"Finished codemodding {result.successes + result.skips + result.failures} files!\n")
|
|
223
|
+
sys.stderr.write(f" - Transformed {result.successes} files successfully.\n")
|
|
224
|
+
sys.stderr.write(f" - Skipped {result.skips} files.\n")
|
|
225
|
+
sys.stderr.write(f" - Failed to codemod {result.failures} files.\n")
|
|
226
|
+
sys.exit(1 if result.failures > 0 else 0)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|