Skip to content

docs: fix job-types guide; doctests pass with default features - #51

Merged
CodingAnarchy merged 1 commit into
masterfrom
docs/guides-more
Oct 8, 2026
Merged

CodingAnarchy merged 1 commit into
masterfrom
docs/guides-more

Conversation

@CodingAnarchy

Copy link
Copy Markdown
Owner

Part of #48.

  • docs/job-types.md is now compile-checked, and its 8 failing examples are fixed. Real API errors in the guide:
  • New Job::with_scheduled_at: the README and guides already used it, but it didn't exist.
  • README TestQueue example never compiled. It was wrapped in #[cfg(feature = "test")], but doctests don't see the crate's features, so the body was compiled out. The wrapper is gone, and the README and guide includes now sit in one #[cfg(all(doctest, feature = …))] module.
  • cargo test --doc with default features was broken. The includes from docs: compile-check the README and seven guides, and fix their examples #49 and 23 API examples (lib.rs, migrations, archive, worker) needed postgres. Those examples' fences now use cfg_attr(feature = "postgres", doc = "```rust,no_run") / cfg_attr(not(…), doc = "```rust,ignore"). New CI step: doctests with default features.

Doctests: 357 pass with --all-features, 183 pass (24 ignored) with default features.

🤖 Generated with Claude Code

- Compile-check docs/job-types.md and fix its examples: fragments get a
  hidden prelude; Job::with_delay is a constructor; Job::with_cron takes a
  CronSchedule (with_cron_schedule is a constructor); handlers are typed
  JobHandler and return HammerworkError::Processing; retry comments match
  the max_attempts/with_max_retries semantics from #29.
- Add Job::with_scheduled_at, which the README and guides already used.
- The README TestQueue example was wrapped in cfg(feature = "test"),
  which doctests don't see, so it never compiled; drop the wrapper and
  gate the README/guide includes (one cfg'd module) on the features
  their examples use.
- cargo test --doc with default features failed: the guide includes
  (#49) and 23 API examples needed the postgres feature. Gate those
  examples' fences with cfg_attr(feature = "postgres") and add a CI step
  running doctests with default features.

Part of #48.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CodingAnarchy
CodingAnarchy merged commit 79166cb into master Oct 8, 2026
17 checks passed
@CodingAnarchy
CodingAnarchy deleted the docs/guides-more branch October 8, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant