SublimeLinter: Lint errors are being display in the console, but no code highlighting is occurring

PROBLEM: Lint errors are not being highlighted in the source code

DESCRIPTION: When linting a bad python file, I see the lint error occurring both on the command line and in the console, but no highlighting is occurring in the file.

EXPECTED BEHAVIOR: When there are lint errors, I would expect to see outlines or highlights within the code where the lint error is occurring.

CONTEXT: ST v3.0, Build 3143 OS: 10.12.6 Python: 3.6 I’ve installed flake8 via pip inside of a conda environment. I’ve installed both SublimeLinter and SublimeLinter-flake8 plugin via Package Control

Package Control settings:

{
	"bootstrapped": true,
	"in_process_packages":
	[
	],
	"install_prereleases":
	[
		"SublimeLinter",
		"SublimeLinter-flake8"
	],
	"installed_packages":
	[
		"AdvancedNewFile",
		"Copy Relative Path",
		"GitGutter",
		"GitSavvy",
		"Package Control",
		"Pretty JSON",
		"Python PEP8 Autoformat",
		"SideBarEnhancements",
		"SublimeLinter",
		"SublimeLinter-flake8"
	]
}

SublimeLinter setting:

// SublimeLinter Settings - User
{
	"debug": true,
	"lint_mode": "load_save",
	"linters": {
		"flake8": {
			"executable": "~/miniconda3/bin/flake8",
			"show-code": false
		},
	},
}

Console output:

SublimeLinter: flake8: wanted executable is '/Users/wwilliams/miniconda3/bin/flake8' 
SublimeLinter: flake8: taxes.py ['/Users/wwilliams/miniconda3/bin/flake8', '-'] 
SublimeLinter: flake8 output:
stdin:4: [F401] 'datetime' imported but unused 

Command-line output:

> ~/miniconda3/bin/flake8 taxes.py                                                                                                                                                                               
taxes.py:4: [F401] 'datetime' imported but unused

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 25 (18 by maintainers)

Most upvoted comments

Thanks @kaste @braver !

Usually, you should get a warning if it can’t match a line, but I think there is a bug here

https://github.com/SublimeLinter/SublimeLinter/blob/965fba0445a5b7c68b886e5fd229e93c15ae697e/lint/linter.py#L936-L941

The return value of finditer is an iterator and always truthy.