-
Notifications
You must be signed in to change notification settings - Fork 9
Events
ℹ️ Events are what causes your TODO to expire and be reminded about it.
Here is the list of built-in events SmartTodo provides:
date
will expire your TODO on a specific date and time. This event expects one String
argument and needs to be a correctly formatted date (parseable by Time.parse
).
# TODO(on: date('2019-08-07'), to: '...')
# TODO(on: date('2019/08/02'), to: '...')
# TODO(on: date('2019-08-02 16:54:00'), to: '...')
# TODO(on: date('2019-08-02 16:54:00 +0000'), to: '...')
pull_request_close
will expire your TODO when a GitHub Pull Request is closed. This event expects three arguments. In order: The organization name, the repository name, and the PR number.
repo
scope.
The token needs to be exposed in the SMART_TODO_GITHUB_TOKEN
environment variable.
# TODO(on: pull_request_close('rails', 'rails', 5431), to: '...')
# TODO(on: pull_request_close('rails', 'sprockets', 2233), to: '...')
issue_close
will expire your TODO when a GitHub issue is closed. This event expects the exact same arguments as the pull_request_close
above.
pull_request_close
event above.
# TODO(on: issue_close('rails', 'rails', 33521), to: '...')
# TODO(on: issue_close('rails', 'sprockets', 45678), to: '...')
gem_release
will expire your TODO when a gem is released on RubyGems.org with a specific version. This event expects the name of the gem and the version(s) specifiers. The version specifier syntax are the exact same as what you are used to from the Gemfile.
# Expire your TODO when Rails 6.0 is released
# TODO(on: gem_release('rails', '6.0'), to: '...')
# Expire your TODO when Rails gets a new release in the 5.x.x series
# TODO(on: gem_release('rails', '> 5.2', '< 6'), to: '...')
# See the explanation of `~>` https://guides.rubygems.org/patterns/#pessimistic-version-constraint
# TODO(on: gem_release('rails', '~> 6.1'), to: '...')
gem_bump
will expire your TODO when a gem inside your Gemfile.lock snapshot gets updated to a specific version. This event expects the name of the gem and the version(s) specifiers. The version specifier syntax are the exact same as what you are used to from the Gemfile.
# Expire your TODO when Rails 6.0 is released
# TODO(on: gem_bump('rails', '6.0'), to: '...')
# Expire your TODO when Rails gets a new release in the 5.x.x series
# TODO(on: gem_bump('rails', '> 5.2', '< 6'), to: '...')
# See the explanation of `~>` https://guides.rubygems.org/patterns/#pessimistic-version-constraint
# TODO(on: gem_bump('rails', '~> 6.1'), to: '...')
ruby_version
will expire your TODO when the current Ruby version fulfill the requirements.
# Expire your TODO when Ruby 3.3 is used
# TODO(on: ruby_version(">= 3.3.0"), to: '...')
More built-in events will be added as this gem matures and support for writing your own events will be added soon.