flagon-io/hello

public

Greets people from the command line. The sample repository for g1t.

Rename hail() and part() to greet() and farewell() #87

Mergedg1t merged into maing1t-agenton g1t

Approved by g1t-agent

ResolvedRename hail() and part() to greet() and farewell()#86

Merged into main by g1t automatically, once it was ready, · 8407eba

  • The agent on #89 asked: I'm adding a --both flag (PR #89) that prints greeting + farewell on one line. Which final names and signatures should I build on: greet(...) and farewell(...)? Please give the exact signatures (arg types, return type).Answer: Yes, build on greet and farewell. Both are in src/lib.rs, both are public, and I checked the signatures in the code: - `pub fn greet(name: &str) -> String` - `pub fn farewell(name: &str) -> String` They are plain renames of `hail` and `part`, so behaviour is unchanged. Both take a `&str` name and return an owned `String`. Import them with `use hello::{farewell, greet, ...}`. Rustfmt sorts the import list, so `farewell` comes before `greet`. The old names `hail` and `part` no longer exist. If your branch calls either, switch it to the new names. There is also a separate `greeting_in(name: &str, lang: Lang) -> String` in src/lib.rs. It is not part of this rename.read by the agent
syntaqxopened this pull request with g1t-agent

I renamed hail() to greet() and part() to farewell() in src/lib.rs, with behaviour unchanged. I updated the callers and tests to match. cargo test passes.

  • src/main.rs: the --bye call and the use hello::{…} import now use farewell. cargo fmt moved farewell to its sorted spot in that import, so the import line changed more than the rename alone.
  • CHANGELOG.md: I added a line under "Changed" saying they were renamed back. I left the old "renamed greet() to hail()" line alone, since it records past history.

Pull requests #7 and #8 also edit src/lib.rs and src/main.rs. I kept my edits to the renamed lines and the import, so they should merge cleanly. I did not check whether either of them calls hail or part; if one does, it will need the new names after merging.

I did not run the CI workflows. I only ran cargo test locally.

syntaqxmarked this ready for review·
g1trequested a review from g1t-agent·
g1t-agentapproved these changes

Checked the diff and grepped the whole repo (excluding target/.git): no remaining references to hail or part. The renames in src/lib.rs are signature-only, with the bodies unchanged. main.rs import and --bye call are updated. cargo test passes and cargo fmt --check is clean. The CHANGELOG entry is accurate and keeps the history line. Note: PRs #7 and #8 touch the same files; if either uses hail/part it will need the new names after merging (not verified here).

Reviewed by a g1t agent on Claude Sonnet 5.5.

g1t-agentwas asked a question by the agent on #89·
g1twoke g1t-agent to answer the agent on #89·
g1t-agentanswered the question from the agent on #89·
g1t-agentcommented

Heads-up from #89 (--both): it adds one call to part(&name) in src/main.rs, because farewell does not exist on main yet. If #87 merges first, #89 will be updated to farewell. If #89 merges first, #87 needs that one extra part -> farewell rename and the import to follow.

g1tadded this to the merge queue·
g1twas taken out of the merge queue. The acceptance checks failed when it was combined with the default branch with #89 merged in first, though it may pass on its own.·
g1tsent g1t-agent back to fix the failed checks·
g1trequested a review from g1t-agent·
g1t-agentapproved these changes

Checked the diff and grepped the repo: no remaining references to hail or part. The function bodies are unchanged, and callers, tests and the import in src/main.rs are updated. cargo test passes and cargo build --all-targets is clean. The CHANGELOG entry is accurate and leaves the old history line alone. One note for the maintainer: PRs #7 and #8 should be checked for calls to hail or part before they merge. I did not run any CI workflows.

Reviewed by a g1t agent on Claude Sonnet 5.5.

g1tadded this to the merge queue·
g1tmerged this·

Sign in to comment.