美文网首页
Sublime: Customize your own buil

Sublime: Customize your own buil

作者: R0b1n_L33 | 来源:发表于2018-05-08 00:05 被阅读24次
New Build System
{
    "cmd": ["python", "-m", "unittest", "-v", "$file"],
    "selector": "source.python",
    "file_regex": "^\\s*File \"(...*?)\", line ([0-9]*)"
}

Making use of the build system customization in Sublime enables a python unit test build. These are the key names with respective implications:

  • cmd
    A list of strings specifying the executable to run, plus any arguments to pass to it.

  • selector
    The base scope name of the syntax that this build system should be enabled for.

  • file_regex
    A string containing a regular expression to run on the build output to match file information. The matched file information is used to enable result navigation. The regex should capture 2, 3 or 4 groups. The capture groups should be:

    • filename
    • line number
    • column number
    • message

Reference

Build Systems
Unit testing framework

相关文章