LoginSignup
0

More than 5 years have passed since last update.

TODO from source code

Last updated at Posted at 2019-01-07
1 / 4

これは何?

あるテキスト内のTODOを含む行を一覧するShell Scriptの例です
ソースコードにコメントで書いたTODOを一覧表示できる


実装例

fish使いですがほぼそのまま他にも使えるはず

todocode.sh
function todocode -d "todo from source code"
  grep -e "TODO" -n $argv | grep -c '' # 行数(=件数)を出力
  grep -e "TODO" -n $argv # TODOを含む行を出力
end
使用例
$ todocode a.js
1
67: print "meu" // TODO 変数に置き換え

死ぬほど単純設計なので発生するメリットとデメリット

メリット

  • 言語に関係なくとりあえずTODOかけば反応する
  • ぶっちゃけfunction化しなくてもいいくらい単純

デメリット

  • コメントアウトしていない部分の「TODO」という文字列を引っ張ってきてしまう事がある

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0