flagon-io/hello

public

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

Add CONTRIBUTING.md explaining how to build, test and propose a change #33

Mergedg1tbot merged into mainrequested by syntaqx

Approved by g1t

  1. Note

    Running on Claude Sonnet 5.5.

  2. Prompt

    You are a coding agent working in the git repository checked out in the current directory.

    Issue #29: Add CONTRIBUTING.md explaining how to build, test and propose a change

    Create CONTRIBUTING.md at the repo root for outside contributors. The crate is hello (Rust 2021 edition, see Cargo.toml), with logic in src/lib.rs (parse_args), entry point src/main.rs, and integration tests in tests/cli.rs.

    Cover:

    • Build: cargo build, and running with cargo run -- --shout Ada.
    • Test: cargo test (the README's Develop section uses it).
    • Propose a change: fork, branch, make a focused change with tests, make sure cargo test passes, update README usage when flags change, add an entry under Unreleased in CHANGELOG.md, open a pull request describing what and why.

    Only state commands that actually work; verify them by running them. Do not modify other files. Keep formatting consistent with README.md (ATX headings, fenced sh code blocks).

    These commands must pass when you are done. Run them if the tools are installed:

    • cargo build
    • cargo test
    • test -f CONTRIBUTING.md

    Make the change and keep it focused on the issue. Commit your work with a clear message. Do not push; that is done for you. Finish with a short summary of what you changed and why. It becomes the description of your pull request, so write it for a reviewer: plain sentences, no headings, no emoji, no checklists, and nothing about whether anything was committed or pushed. Say what you did not verify.

  3. Bashcat README.md; head -20 CHANGELOG.md; cargo build 2>&1 | tail -2; cargo run -q -- --shout Ada; cargo test 2>&1 | grep "test result"
    cat README.md; head -20 CHANGELOG.md; cargo build 2>&1 | tail -2; cargo run -q -- --shout Ada; cargo test 2>&1 | grep "test result"
  4. result→ # hello
    # hello
    
    Greets people from the command line.
    
    ## Usage
    
    | Argument | Description |
    | -------- | ----------- |
    | `NAME`   | Optional. The name to greet. Only the first argument is read. Defaults to the `USER` environment variable, then to `world`. |
    | `--shout` | Upper-cases the greeting. |
    | `--version` | Prints the crate version and exits. |
    | `--times N` | Prints the greeting `N` times. Defaults to 1. |
    
    ```sh
    $ cargo run -- Ada
    Hello, Ada!
    ```
    
    ```sh
    $ cargo run -- --shout Ada
    HELLO, ADA!
    ```
    
    ```sh
    $ cargo run -- --times 2 Ada
    Hello, Ada!
    Hello, Ada!
    ```
    
    ```sh
    $ cargo run -- --version
    0.1.0
    ```
    
    With no name it greets whoever is signed in.
    
    ## Develop
    
    This project uses the Rust 2021 edition.
    
    ```sh
    cargo test
    ```
    
    ## License
    
    This project is licensed under the MIT License.
    The full license text is available at https://opensource.org/license/mit.
    head: cannot open 'CHANGELOG.md' for reading: No such file or directory
       Compiling hello v0.1.0 (/work/repo)
        Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.55s
    HELLO, ADA!
    test result: ok. 21 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s
    test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
    test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
    test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
  5. Bashcat > CONTRIBUTING.md <<'EOF'
    cat > CONTRIBUTING.md <<'EOF'
    # Contributing
    
    Thanks for helping improve `hello`. This guide explains how to build the project, run its tests and propose a change.
    
    ## Build
    
    The crate is written in Rust (2021 edition). The logic lives in `src/lib.rs` (`parse_args`), the entry point is `src/main.rs`, and integration tests are in `tests/cli.rs`.
    
    ```sh
    cargo build
    ```
    
    To try your changes, run the binary through Cargo:
    
    ```sh
    cargo run -- --shout Ada
    ```
    
    ## Test
    
    ```sh
    cargo test
    ```
    
    ## Propose a change
    
    1. Fork the repository and clone your fork.
    2. Create a branch for your change.
    3. Make a focused change that does one thing, and add or update tests for it.
    4. Run `cargo test` and make sure it passes.
    5. If you add or change a flag, update the usage section in `README.md`.
    6. Add an entry under Unreleased in `CHANGELOG.md`.
    7. Open a pull request that describes what you changed and why.
    EOF
    git add CONTRIBUTING.md && git commit -qm "Add CONTRIBUTING.md explaining how to build, test and propose a change" && echo ok
  6. result→ ok
    ok
  7. g1t

    I added CONTRIBUTING.md at the repo root. It has three sections, Build, Test and Propose a change, in the same style as the README (ATX headings, sh code blocks). No other files changed.

    I ran cargo build, cargo run -- --shout Ada (prints HELLO, ADA!) and cargo test (all tests pass), and the file exists.

    The issue asks contributors to add an entry under Unreleased in CHANGELOG.md, and the guide says so. But the repo has no CHANGELOG.md, and the issue said not to touch other files, so I didn't create one. Until someone adds it, that step in the guide points at a file that isn't there. Either add a changelog in a follow-up or drop the step.

    I did not check the fork, branch and pull request steps against any hosting setup.

  8. Note

    This run cost $0.0393 over 3 turns.

  9. Note

    Pushed b2dad502d5cf.

  10. Note

    main has moved to cfd1ab9eebd1. Merging it into this pull request.

    b2dad50

  11. Note

    Pushed 62ce1c8e53df. This pull request now contains main.

    b2dad50