Skip to content

refactor: move misplaced functions to the modules that own them - #1888

Merged
o2sh merged 1 commit into
mainfrom
refactor/file-placement
Oct 14, 2026
Merged

o2sh merged 1 commit into
mainfrom
refactor/file-placement

Conversation

@o2sh

@o2sh o2sh commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Follow-up to the 3.0.0 restructure: a few functions and constants still lived outside the module that owns them, against the rules in ARCHITECTURE.md. Pure moves, no behavior change.

Moved From To Why
get_repo_url + URL formatting (and tests) data/fields/url.rs data/git/remote.rs Shared input of the Project and URL fields; shared repository queries live in data::git
get_git_username, get_git_version data/git/mod.rs data/title.rs (private) Only used by the title; git --version isn't a repository query
get_manifest data/mod.rs data/manifest.rs Next to get_manifests; data/mod.rs keeps Info, InfoOptions, build_info
COLOR_PALETTE render/style.rs render/colors.rs Colors live in colors.rs; style.rs keeps Line/Span/Style and the ANSI writer
--true-color auto resolution (COLORTERM) cli.rs options.rs cli is only the clap definition; turning Cli into RenderOptions is options' job

Testing

  • cargo fmt, cargo clippy --all-targets: clean
  • cargo test --no-fail-fast: all pass except test_reftable_repo_is_rejected, which also fails on main locally (its fixture needs git ≥ 2.45; local git is 2.43)
  • Terminal and -o json output unchanged

🤖 Generated with Claude Code

- get_repo_url and URL formatting: data/fields/url.rs -> data/git/remote.rs
  (shared input of the Project and URL fields)
- get_git_username, get_git_version: data/git/mod.rs -> data/title.rs
  (only used by the title)
- get_manifest: data/mod.rs -> data/manifest.rs
- COLOR_PALETTE: render/style.rs -> render/colors.rs
- --true-color auto resolution: cli.rs -> options.rs

No behavior change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@o2sh
o2sh merged commit 306e305 into main Oct 14, 2026
4 checks passed
@o2sh
o2sh deleted the refactor/file-placement branch October 14, 2026 09:55

This branch was successfully deployed

1 active deployment
Preview — 3ddd3451 Deployed Oct 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant