Crate todo_or_die[][src]

Expand description

TODOs you cannot forget!

todo-or-die provides procedural macros that act as checked reminders.

The name was shamelessly stolen from the ruby gem todo_or_die.


// trigger a compile error if we're past a certain date
todo_or_die::after_date!(3000, 1, 1); // its the year 3000!

// or a GitHub issue has closed
todo_or_die::issue_closed!("rust-lang", "rust", 44265); // GATs are here!

// or the latest version of a crate matches some expression
todo_or_die::crates_io!("serde", ">1.0.9000"); // its over 9000!

Feature flags

The following optional features are available:

  • crate: Enables checking versions of crates.
  • github: Enables checking if issues or pull requests are closed.
  • rust: Enables checking the current rust version.
  • time: Enables checking things to do with time.

Note that none of the features are enabled by default.

Skipping checks

If the environment variable TODO_OR_DIE_SKIP is set all macros will do nothing and immediately succeed. This can for example be used to skip checks locally and only perform them on CI.

Caching HTTP requests

By default HTTP requests will be cached. The behavior can be customized with these environment variables:

  • TODO_OR_DIE_HTTP_CACHE_TTL_SECONDS: How long cached responses will be used. The default is 1 hour.
  • TODO_OR_DIE_DISABLE_HTTP_CACHE: Disables caching if its set.
  • TODO_OR_DIE_CLEAR_HTTP_CACHE: Clears the cache if its set.

The cache is stored at std::env::temp_dir().join("todo_or_die_cache").

You can still compile offline

If you’re offline or GitHub is down you can still build. If the macros hit some kind of error a warning will be printed but they wont trigger a compile error.


Trigger a compile error if today is after the given date

Trigger a compile error if the latest version of a crate hosted on matches some expression.

Trigger a compile error if an issue has been closed.

Trigger a compile error if a pull request has been closed or merged.

Trigger a compile error if the currently used version of rust used matches some expression.