Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
- **Clarity over cleverness.** Be concise, but favour explicit over terse or
obscure idioms. Prefer code that's easy to follow.
- **Use functions and composition.** Avoid repetition by extracting reusable
logic. Prefer generators or comprehensions, and declarative code to imperative
repetition when readable.
logic. Prefer generators or comprehensions, and declarative code to
imperative repetition when readable.
- **Small, meaningful functions.** Functions must be small, clear in purpose,
single responsibility, and obey command/query segregation.
- **Clear commit messages.** Commit messages should be descriptive, explaining
Expand Down Expand Up @@ -95,8 +95,8 @@
## Rust Specific Guidance

This repository is written in Rust and uses Cargo for building and dependency
management. Contributors should follow these best practices when working on
the project:
management. Contributors should follow these best practices when working on the
project:

- Run `make fmt`, `make lint`, and `make test` before committing. These targets
wrap `cargo fmt`, `cargo clippy`, and `cargo test` with the appropriate flags.
Expand Down
10 changes: 5 additions & 5 deletions docs/behavioural-testing-in-rust-with-cucumber.md
Original file line number Diff line number Diff line change
Expand Up @@ -933,13 +933,13 @@ variant is far more valuable for debugging than a stack trace from a panic.[^20]
**Pitfall:** The test run fails with an "ambiguous step" error. This means a
single Gherkin step matches the patterns of two or more Rust functions.[^21]

**Solution:** <!-- markdownlint-disable MD029 -->
**Solution:**

5. **Be More Specific:** Make the Gherkin step text or the matching pattern more
precise to eliminate the ambiguity.
1. **Be More Specific:** Make the Gherkin step text or the matching pattern
more precise to eliminate the ambiguity.

6. **Anchor Regex:** When using regular expressions, always anchor them with `^`
at the start and `$` at the end (e.g., <!-- markdownlint-enable MD029 -->
2. **Anchor Regex:** When using regular expressions, always anchor them with
`^` at the start and `$` at the end (e.g.,
`regex = r"^the user is logged in$"`). This prevents a step like
`"the admin user is logged in"` from accidentally matching a less specific
pattern like `regex = r"user is logged in"`.[^18]
Expand Down
Loading