Skip to content

style: make error messages idiomatic - #660

Merged
m4tx merged 4 commits into
cot-rs:masterfrom
oxura:fix/647-lowercase-errors
Oct 1, 2026
Merged

m4tx merged 4 commits 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 Outdated
@m4tx
m4tx force-pushed the fix/647-lowercase-errors branch from 28499b8 to 431490f Compare September 28, 2026 16:54

@m4tx m4tx left a comment

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.

I took the liberty of fixing the Redis message. Thanks for the contribution!

@m4tx
m4tx enabled auto-merge (squash) September 28, 2026 16:56

@m4tx m4tx left a comment

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.

Ah, in fact, after having another look (with the test failure), we should probably keep the messages in FormFieldValidationError. These gets displayed in user-facing messages on the webpages, so they should be proper English sentences instead.

@m4tx
m4tx disabled auto-merge September 28, 2026 19:22
@m4tx
m4tx force-pushed the fix/647-lowercase-errors branch from dcb056a to 8e21f6f Compare October 1, 2026 17:09
@m4tx
m4tx force-pushed the fix/647-lowercase-errors branch from 8e21f6f to 7852330 Compare October 1, 2026 18:17
@m4tx
m4tx enabled auto-merge (squash) October 1, 2026 18:17
@m4tx
m4tx merged commit d13712b into cot-rs:master Oct 1, 2026
22 of 23 checks passed
@cotbot cotbot Bot mentioned this pull request Oct 1, 2026
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