Skip to content

style: make error messages idiomatic - #660

Open
oxura wants to merge 1 commit into
cot-rs:masterfrom
oxura:fix/647-lowercase-errors
Open

oxura wants to merge 1 commit into
cot-rs:masterfrom
oxura:fix/647-lowercase-errors

Conversation

@oxura

@oxura oxura commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Cot already follows Rust’s lowercase, punctuation-free error style in most places, but a few framework, CLI, form-validation, and JSON errors still used sentence casing or terminal periods.

This normalizes the remaining framework-owned thiserror and anyhow messages, including multi-sentence CLI errors (where the sentence boundary remains), updates public examples to model the convention, and documents the rule in CONTRIBUTING.md. Built-in form and 404 display tests now pin the externally visible wording.

Verification:

  • cargo +1.94.0 fmt --all -- --check
  • Cot library suite with all features: 557 passed, 36 ignored
  • Cot CLI library suite: 52 passed
  • Cot Core suite with all features: 175 passed
  • changed-package Clippy across all targets/features with warnings denied (unknown-lints allowed because Clippy 1.94 predates the upstream unused_async_trait_impl lint)

The workspace integration run reached the existing CLI snapshot harness; five timestamp/color normalization snapshots differ in this local environment, while all non-snapshot suites and the changed packages pass.

Closes #647.

@github-actions github-actions Bot added A-docs Area: Documentation C-cli Crate: cot-cli (issues and Pull Requests related to Cot CLI) C-lib Crate: cot (main library crate) C-core labels Sep 2, 2026
Comment thread cot/src/test.rs
#[error(transparent)]
Io(#[from] std::io::Error),
#[error("Redis error: {0}")]
#[error("redis error: {0}")]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redis is a project name, so we should keep it as is.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-docs Area: Documentation C-cli Crate: cot-cli (issues and Pull Requests related to Cot CLI) C-core C-lib Crate: cot (main library crate)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error messages should start with lowercase letters

2 participants