-
Notifications
You must be signed in to change notification settings - Fork 9
Events
ℹ️Events are what makes your TODO to expire and be reminded about it.
Here is the list of built-in events SmartTodo provide:
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 (parsable 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 organisation name, the repository name, 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 RubyGem 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_release('rails', '6.0'), to: '...')
# Expire your TODO when Rails get 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: '...')
More built-in event will be added as this gem mature and support for writing your own events will be added soon