Top-level CLI app that composes the Galaxy tool refactoring tiers (format + upgrade).
Project description
galaxy-tool-refactor-cli
The app tier of the Galaxy tool refactoring framework — the user-facing
galaxy-tool-refactor CLI, a thin front-end over the tier-3.6 rule-registry
facade (galaxy-tool-refactor-registry).
| Tier | Layer | Package |
|---|---|---|
| 0.5 | rule metadata | galaxy-tool-refactor-rules |
| 1 | parsing & validation | galaxy-tool-source |
| 2 | structure | galaxy-tool-codemod |
| 3 | formatting | galaxy-tool-fmt |
| 3.5 | advisory checks | galaxy-tool-lint |
| 3.6 | rule registry / rulesets | galaxy-tool-refactor-registry |
| 4 | app / CLI | galaxy-tool-refactor-cli (this package) |
Rule orchestration lives in the registry facade; this package depends on it
(plus fmt's cli_support engine and tier-1 parsing) and exposes ten commands
(format, upgrade, check, find-references, rename-param, rulesets, rules,
normalize-macros):
# Safe, idempotent: apply a ruleset's fixable rules + cosmetic formatting.
# Default ruleset = structural canonicalisation + cosmetic; never profile=.
galaxy-tool-refactor format tool.xml
galaxy-tool-refactor format --ruleset cosmetic tool.xml # whitespace only
galaxy-tool-refactor format --ignore GTR002 tool.xml # all but param-reorder
galaxy-tool-refactor format tools/ # also formats <macros> files
# Opt-in, semantic: repair typos, then upgrade profile= to the latest reachable
# version (applying each step's structural migration), then format. Reports the
# steps applied and warns if a tool stalls. No --ruleset; --select/--ignore tune it.
galaxy-tool-refactor upgrade tool.xml
# Report-only linter: one `file:line CODE message` per finding, mutating
# nothing. The default ruleset reports the fixable GTR rules; `--ruleset strict` adds
# the advisory checks (marked `(advisory)`). Exits non-zero on any fixable
# finding; advisory findings are informational unless --strict.
galaxy-tool-refactor check tool.xml
galaxy-tool-refactor check --ruleset strict tool.xml
# Introspection.
galaxy-tool-refactor rulesets
galaxy-tool-refactor rules
# Opt-in, repo-scoped: lowercase literal format/ftype in <macros>-root files (the
# macro-library fix the per-tool `upgrade` can't reach). Rewrites files other than
# the one named, so it is a separate command — never part of format/upgrade.
galaxy-tool-refactor normalize-macros macros/ # --check to preview
format/upgrade/check share rule selection — --ruleset NAME
(repeatable / comma-separated — the union of the named sets),
--select CODE…, --ignore CODE… (ruff-style precedence: --ignore ▸
--select ▸ --ruleset; --select replaces the rulesets' set; upgrade takes no
--ruleset). format/upgrade also honour --check (detect drift, exit
non-zero, don't write — distinct from the check command), --diff, and
--quiet; check honours --quiet and --strict. The typical modernization
flow is upgrade then format.
Why a separate tier
Profile upgrade is semantic, fallible, and reports outcomes; canonicalisation +
formatting is safe and idempotent. Keeping them in separate, explicit commands
(rather than auto-upgrading inside "format my tool") lets users opt into
modernization deliberately. Rule orchestration sits below the CLI in the
registry facade — both because output is written via fmt's serializer (so the
orchestrator must sit above fmt) and so the MCP server reuses the same
core. See docs/decisions.md §D1 (the app tier), §D2 (check), §D3 (advisory
findings), §D4 (the registry facade + rule selection).
Install / test
uv sync # from the workspace root
uv run --package galaxy-tool-refactor-cli pytest galaxy-tool-refactor-cli/tests/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file galaxy_tool_refactor_cli-0.2.0.tar.gz.
File metadata
- Download URL: galaxy_tool_refactor_cli-0.2.0.tar.gz
- Upload date:
- Size: 32.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db1fdd007e24d2ff175d22ec900be39f7244ef51a4b6b000597cb0934810882e
|
|
| MD5 |
6c1657cdb1255f78a4f8d011d18b5099
|
|
| BLAKE2b-256 |
d03a1a78e0ebbc2d7fced0ca5ffc086422ea1646b7123974b22eeb9e76ba8168
|
Provenance
The following attestation bundles were made for galaxy_tool_refactor_cli-0.2.0.tar.gz:
Publisher:
release.yml on richard-burhans/galaxy-tool-refactor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
galaxy_tool_refactor_cli-0.2.0.tar.gz -
Subject digest:
db1fdd007e24d2ff175d22ec900be39f7244ef51a4b6b000597cb0934810882e - Sigstore transparency entry: 1792717067
- Sigstore integration time:
-
Permalink:
richard-burhans/galaxy-tool-refactor@524c6b6ee8dba405f5d3b1d192d120d996140a65 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/richard-burhans
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@524c6b6ee8dba405f5d3b1d192d120d996140a65 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file galaxy_tool_refactor_cli-0.2.0-py3-none-any.whl.
File metadata
- Download URL: galaxy_tool_refactor_cli-0.2.0-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a7dd272e7243fe5614a6331f281962fa11f052c38f20966e93a72ccf192da48
|
|
| MD5 |
9ba6c01f91b6734f8a0dc9c2e72075e7
|
|
| BLAKE2b-256 |
b16d11e6ceb1035bddb1c2a16b4acc1cfe2b544e585b251d95099f03088285f3
|
Provenance
The following attestation bundles were made for galaxy_tool_refactor_cli-0.2.0-py3-none-any.whl:
Publisher:
release.yml on richard-burhans/galaxy-tool-refactor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
galaxy_tool_refactor_cli-0.2.0-py3-none-any.whl -
Subject digest:
8a7dd272e7243fe5614a6331f281962fa11f052c38f20966e93a72ccf192da48 - Sigstore transparency entry: 1792717137
- Sigstore integration time:
-
Permalink:
richard-burhans/galaxy-tool-refactor@524c6b6ee8dba405f5d3b1d192d120d996140a65 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/richard-burhans
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@524c6b6ee8dba405f5d3b1d192d120d996140a65 -
Trigger Event:
workflow_dispatch
-
Statement type: