Sublimetext3 升华文本3中cppcheck linter的配置

Sublimetext3 升华文本3中cppcheck linter的配置,sublimetext3,ubuntu-16.04,cppcheck,sublimelinter,Sublimetext3,Ubuntu 16.04,Cppcheck,Sublimelinter,我在我的机器中安装了cppcheck,在sublimitext3中安装了cppcheck插件,但我仍然无法使cppcheck正常工作。我想我在path变量中犯了一些错误。我读了答案,但不明白。请帮助我配置它。谢谢 这是我的机器(Ubuntu 16.04)输出到相关命令的结果: which cppcheck /usr/bin/cppcheck 我的~/.profile文件: # if running bash if [ -n "$BASH_VERSION" ]; then # inclu

我在我的机器中安装了
cppcheck
,在
sublimitext3
中安装了
cppcheck
插件,但我仍然无法使
cppcheck
正常工作。我想我在path变量中犯了一些错误。我读了答案,但不明白。请帮助我配置它。谢谢

这是我的机器(Ubuntu 16.04)输出到相关命令的结果:

which cppcheck
/usr/bin/cppcheck
我的
~/.profile
文件:

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin directories
PATH="$HOME/bin:$HOME/.local/bin:$PATH:/usr/bin"
这是我的sublimiter.sublimite-settings文件:

{
    "user": {
        "debug": false,
        "delay": 0.25,
        "error_color": "D02000",
        "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
        "gutter_theme_excludes": [],
        "lint_mode": "manual",
        "linters": {
            "cppcheck": {
                "@disable": false,
                "args": [],
                "enable": "style",
                "excludes": [],
                "std": ["c++11"]
            }
        },
        "mark_style": "outline",
        "no_column_highlights_line": false,
        "passive_warnings": false,
        "paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "python_paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "rc_search_limit": 3,
        "shell_timeout": 10,
        "show_errors_on_save": false,
        "show_marks_in_minimap": true,
        "syntax_map": {
            "html (django)": "html",
            "html (rails)": "html",
            "html 5": "html",
            "javascript (babel)": "javascript",
            "magicpython": "python",
            "php": "html",
            "python django": "python",
            "pythonimproved": "python"
        },
        "warning_color": "DDB700",
        "wrap_find": true
    }
}
还请注意,每当我尝试在上面添加/usr/bin/时,即
“路径”:{“linux”:[/usr/bin/]}
Sublime会显示错误。请帮帮我


这可能只是您的问题,但您要添加到sublimiteLiner.sublimite-settings文件的路径应该用引号括起来

不正确:

"paths" : {"linux" : [/usr/bin/]}
更正:

"paths" : {"linux" : ["/usr/bin/"]}

注意:中的“添加路径”部分指出,如果路径在正确的空间(~/.profile for Ubuntu)中初始化,则不需要在设置文件中重新添加目录。如果您打开SublizeLink的调试并重新启动SublizeText,您应该可以在控制台中看到路径输出。我真傻?它工作得很好。我没有看控制台。此外,我认为我在过梁中设置了这样一种方式,它不允许错误在屏幕上可见。当我将标记样式更改为实心下划线时,我一保存文件,代码中的错误就开始出现。我在这里感觉很天真。很抱歉给您带来麻烦,谢谢您的回答。@SunilKumar很高兴在这里解决了这个问题。请考虑把这个标记为正确答案。