查找用自定义类别标记的源代码行
taggregator的Python项目详细描述
塔格鳄鱼
查找在config.json
文件中定义的使用自定义类别标记的源代码行
例如,要标记包含错误的代码段,请按如下所示编写注释:
do_stuff()# @BUG(HIGH) buggy_code() throws an unhandled exception!buggy_code()do_more_stuff()
然后,您可以在项目根目录中运行tagg
,它将文件名、行号和描述输出到控制台,如下所示。
taggregator/taggregator/taggregator.py :57 # @BUG(HIGH) Throws OSError on some files if in use
taggregator/taggregator/taggregator.py :64 # @SPEED(MEDIUM) Regex search of processed line
taggregator/taggregator/__main__.py :34 # @TODO(LOW) Allow user to specify path for config file
标记有标签的每一行将按优先级排序和着色。 默认情况下,安装的配置文件中有许多标记和优先级。
安装
$ pip3 install --upgrade taggregator
安装也将在^ {
运行
从项目根
$ tagg
从指定文件夹
$ tagg Assets/Scripts
仅返回标有“speed”和“refactor”的行
$ tagg -t "speed, refactor"
在当前目录中创建配置文件
$ tagg create .
工作流集成
在vim这样的工具中,将taggregator绑定到键组合可能会很有用。例如,将其放入~/.vimrc:
nnoremap <leader>t :!clear;tagg<CR>
假设您的vim leader是','那么您可以在编辑时通过键入't'随时访问taggregator todo列表