python - Flake8 linter 不突出 Sublime Text 中的错误
问题描述
我的 Windows 10 PC 上安装了 Sublime Text3 v3.2.1 Build 3207。我在 conda 环境中通过 pip 命令安装了 flake8。我还在 sublime text 上安装了 sublime flake8 linter 和 python flake8 包。
问题是,我可以使用 anaconda 提示符(例如 flake8 utils.py)在我的文件中看到相关的 linting 错误。但是,sublime linter 不会在 sublime 文本编辑器中突出显示同一文件中的这些错误。不过,我确实在文本编辑器的状态栏中看到了 flake8(erred) 。
我可能在这里缺少什么?
以下是两个 linter 的设置 - Flake8Lint 设置:
{
"debug": false,
"lint_on_save": true,
"lint_on_load": false,
"live_mode_lint_delay": 1000,
"set_ruler_guide": false,
"popup": true,
"highlight": true,
"highlight_type": "error",
"highlight_color_critical": "#981600",
"highlight_color_error": "#DA2000",
"highlight_color_warning": "#EDBA00",
"gutter_marks": "theme-simple",
"report_on_success": false,
"blink_gutter_marks_on_success": true,
"use_flake8_global_config": true,
"use_flake8_project_config": true,
"python_interpreter": "auto",
"builtins": [],
"pyflakes": true,
"pep8": true,
"pydocstyle": true,
"naming": true,
"debugger": true,
"import-order": false,
"import-order-style": "cryptography",
"complexity": -1,
"pep8_max_line_length": 79,
"select": [],
"ignore": [],
"ignore_files": []
}
Sublime Linter 设置:
{
"debug": false,
"delay": 0.1,
"gutter_theme": "Default",
"highlights.demote_while_editing": "none",
"highlights.demote_scope": "",
"highlights.time_to_idle": 1.5,
"highlights.start_hidden": false,
"kill_old_processes": false,
"lint_mode": "background",
"linters": {
"linter_name": {
"disable": false,
"args": [],
"executable": "<automatically set>",
"env": {},
"excludes": [],
"filter_errors": [],
"lint_mode": "manual",
"selector": "",
"styles": [
{
"codes": [""]
}
],
"working_dir": "",
"python": 3,
"disable_if_not_dependency": false
}
},
"no_column_highlights_line": false,
"paths": {
"linux": [],
"osx": [],
"windows": []
},
"show_hover_line_report": true,
"show_hover_region_report": true,
"show_marks_in_minimap": true,
"show_panel_on_save": "never",
"statusbar.counters_template": "({}|{})",
"statusbar.messages_template": "{message}",
"statusbar.show_active_linters": true,
"styles": [
{
"scope": "region.yellowish markup.warning.sublime_linter",
"types": ["warning"]
},
{
"priority": 1,
Cross/error.png" "icon": "点",
"mark_style": "outline",
"scope": "region.redish markup.error.sublime_linter"
}
],
"syntax_map": {
"html (django)": "html",
"html (rails)": "html",
"html 5": "html",
"javascript (babel)": "javascript",
"magicpython": "python",
"php": "html",
"python django": "python",
"pythonimproved": "python"
}
}
解决方案
推荐阅读
- javascript - Javascript 2 元素同时被点击打开和关闭一个 html 标签
- google-cloud-platform - Cloud Spanner 错误代码错误:9 FAILED_PRECONDITION
- sql-server - SQL server 中的表同步
- java - 如何让我的 POST 请求接受以下格式的 JSON 有效负载?我正在使用 Jackson 进行此操作
- nginx - NGINX 锁目录列表
- c# - 使用反射调用具有参数的方法
- apache - URL 重定向 - URL 被附加到一个新的而不是完全重定向它
- android - 为什么即使在 gradle 中添加了自定义映射后,Apollo-android 也没有生成自定义类型?
- git - 修改基本提交时更新所有(本地)受影响的分叉分支
- php - 如何将字符串转换为数字,以便在 select 语句中使用?