cli: reject --jobs 0 in translate command #297

Open
github-bot wants to merge 1 commit from github-bot/gh-297 into main AGit
Owner

@⁠Caasares on GitHub · 2026-11-24 23:21 UTC · original
Caasares:fix/translate-jobs-zero → main · +150 −24 · 2 files · 1 commits · open

Fixes #249

Summary

  • Parse victory translate --jobs as Option<std::num::NonZeroUsize> in apps/victory/src/main.rs and apps/victory/src/translate.rs, so --jobs 0 is rejected at CLI argument parsing before scanning any files and translate::run enforces a non-zero worker count at the API boundary.
  • Extract run_paths / print_summary in apps/victory/src/translate.rs so translation execution can be verified directly against synthetic DXBC fixtures without game files.
  • Add unit tests covering:
    • victory translate --jobs 0 returning a clap ValueValidation error and --jobs 1 parsing cleanly (apps/victory/src/main.rs).
    • translate::run / run_paths with --jobs 1 processing a synthetic DXBC container (apps/victory/src/translate.rs).

Verification

All checks run inside wt-vf-249 after the final edit (zero game files used; synthetic DXBC fixture built in test memory):

  • cargo clippy --workspace --all-targets --locked -- -D warnings: passed (0 warnings)
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed (0 warnings)
  • cargo test --workspace --locked: passed across all workspace test suites (499 passed, 0 failed, 7 pre-existing ignored across victory-formats, victory-gpu, and victory-shader; includes victory 4 passed and xtask asset-policy checks 4 passed)
  • cargo fmt --all -- --check: reports pre-existing formatting differences in untouched code across the workspace; all lines added/modified in this PR conform to rustfmt.toml.

Note: AI-assisted fix; contains no game files or assets.

**@⁠Caasares** on GitHub · 2026-11-24 23:21 UTC · [original](https://github.com/fxceless/victory-fork/pull/297) `Caasares:fix/translate-jobs-zero` → `main` · +150 −24 · 2 files · 1 commits · open Fixes #249 ## Summary - Parse `victory translate --jobs` as `Option<std::num::NonZeroUsize>` in `apps/victory/src/main.rs` and `apps/victory/src/translate.rs`, so `--jobs 0` is rejected at CLI argument parsing before scanning any files and `translate::run` enforces a non-zero worker count at the API boundary. - Extract `run_paths` / `print_summary` in `apps/victory/src/translate.rs` so translation execution can be verified directly against synthetic DXBC fixtures without game files. - Add unit tests covering: - `victory translate --jobs 0` returning a `clap` `ValueValidation` error and `--jobs 1` parsing cleanly (`apps/victory/src/main.rs`). - `translate::run` / `run_paths` with `--jobs 1` processing a synthetic DXBC container (`apps/victory/src/translate.rs`). ## Verification All checks run inside `wt-vf-249` after the final edit (zero game files used; synthetic DXBC fixture built in test memory): - `cargo clippy --workspace --all-targets --locked -- -D warnings`: passed (0 warnings) - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: passed (0 warnings) - `cargo test --workspace --locked`: passed across all workspace test suites (499 passed, 0 failed, 7 pre-existing ignored across `victory-formats`, `victory-gpu`, and `victory-shader`; includes `victory` 4 passed and `xtask` asset-policy checks 4 passed) - `cargo fmt --all -- --check`: reports pre-existing formatting differences in untouched code across the workspace; all lines added/modified in this PR conform to `rustfmt.toml`. *Note: AI-assisted fix; contains no game files or assets.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:40:12 +00:00
Author
Owner

@⁠kaayzouee on GitHub · 2026-11-25 01:05 UTC · original

Duplicate of #290?

**@⁠kaayzouee** on GitHub · 2026-11-25 01:05 UTC · [original](https://github.com/fxceless/victory-fork/pull/297#issuecomment-7149198847) Duplicate of #290?
This pull request has changes conflicting with the target branch.
  • apps/victory/src/main.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/297/head:github-bot/gh-297'
git switch 'github-bot/gh-297'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-297'
git switch 'github-bot/gh-297'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-297'
git switch 'github-bot/gh-297'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-297'
git switch 'main'
git merge --squash 'github-bot/gh-297'
git switch 'main'
git merge --ff-only 'github-bot/gh-297'
git switch 'main'
git merge 'github-bot/gh-297'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.