-
Notifications
You must be signed in to change notification settings - Fork 9
Command Line
Roque Pinel edited this page Feb 4, 2021
·
7 revisions
You can run the SmartTodo command line by executing this in your shell
$ bundle exec smart_todo --help
Usage: smart_todo [options] file_or_path1 file_or_path2 ...
--slack_token TOKEN
--fallback_channel CHANNEL
--dispatcher DISPATCHER
The command line requires two arguments:
- The
slack_token
is used to perform API request to Slack to send the message reminder about your TODO. - The
fallback_channel
is used in case a TODO assignee is no longer part of your organisation. In that case, the Slack message will be sent to that channel.
ℹ️ If the slack_token
is not passed, it will be read from the SMART_TODO_SLACK_TOKEN
environment variable.
By default, SmartTodo will parse all .rb
files recursively in the current directory. You can however control which files/directories you want SmartTodo to work on.
- Run SmartTodo recursively in all directories
ENABLE_SMART_TODO=1 bundle exec smart_todo --fallback_channel '#general' --slack_token 'abc'
- Run SmartTodo on a single directory
ENABLE_SMART_TODO=1 bundle exec smart_todo my_lib/ --fallback_channel '#general' --slack_token 'abc'
- Run SmartTodo without passing the
--slack_token
option
SMART_TODO_SLACK_TOKEN=abc ENABLE_SMART_TODO=1 bundle exec smart_todo --fallback_channel '#general'
- Run SmartTodo on multiple files/directories
ENABLE_SMART_TODO=1 bundle exec smart_todo Gemfile app/ file.rb --fallback_channel '#general' --slack_token 'abc'
SmartTodo is meant to be run on your CI alongside your tests. To know how set it up, please read the Setup CI page