question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Linting reports incorrect file locations for lint errors / warnings

See original GitHub issue

Environment data

VSCode

Version: 1.37.1
Commit: f06011ac164ae4dc8e753a3fe7f9549844d15e35
Date: 2019-08-15T16:16:34.800Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Darwin x64 18.7.0
  • Extension version: 2019.8.30787
  • Python version: 2.7
  • Type of virtual environment used: virtualenv
  • Relevant/affected Python packages and their versions: flake8 v3.7.7
  • Jedi or Language Server: Microsoft Language Server
  • Using a multi-root workspace (I have had a ton of problems with multiroot workspaces so it may be relevant)

Expected behaviour

I expect the Problems tab to point to correct locations. I expect red underlines to appear where the linting errors are reported.

Actual behaviour

Red underlines appear in any open file when any lint errors are reported. Correct locations of linting failures are not shown. The below screenshot shows the line import random underlined as red for the incorrect error. Every lint error is highlighted in every open file making it impossible to determine the actual location of the errors.

Screen Shot 2019-08-19 at 8 43 32 AM

Logs

(truncated to remove proprietary code)

##########Linting Output - flake8##########
7,1,F,F401:'hamcrest.is_in' imported but unused
1,1,F,F401:'datetime.datetime' imported but unused
4,1,F,F401:'arrow' imported but unused
1162,1,E,E305:expected 2 blank lines after class or function definition, found 1
1165,37,F,F821:undefined name 'AuthenticatedTestCase'

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

Duplicate logs removed, paths changed

console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:18:29: Cached data exists getEnvironmentVariables, /Users/rvinzent/repo
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:18:33: Cached data exists getEnvironmentVariables, /Users/rvinzent/repo
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:19:10: Cached data exists getEnvironmentVariables, /Users/rvinzent/repo
console.ts:137 [Extension Host] 2019-08-19T15:19:15.464Z - debug: [ImportOrganizer] OrganizeOnSave is deactivated through config
exists getEnvironmentVariables, /Users/rvinzent/repo
ms-python.gallerycdn…dio.Code.Manifest:1 Failed to load resource: the server responded with a status of 404 ()
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:25:59: Cached data exists getEnvironmentVariables, extension-output-#9
ms-python.gallery.vs…dio.Code.Manifest:1 Failed to load resource: the server responded with a status of 503 ()
log.ts:173   ERR Unexpected end of JSON input: SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object.<anonymous> (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1626:627)
    at Generator.next (<anonymous>)
    at r (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:35:293)
console.ts:137 [Extension Host] 2019-08-19T15:30:18.990Z - debug: [ImportOrganizer] OrganizeOnSave is deactivated through config
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:30:19: Cached data exists getEnvironmentVariables, /Users/rvinzent/repo/workspace/path/to/file.py
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:41:37: Cached data exists getEnvironmentVariables, /Users/rvinzent/repo/.vscode/repo.code-workspace
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:41:42: Cached data exists getEnvironmentVariables, /Users/rvinzent/repo
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:41:53: Cached data exists getEnvironmentVariables, /Users/rvinzent/repo
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:43:01: Cached data exists getEnvironmentVariables, /Users/rvinzent/repo
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:50:03: Cached data exists getEnvironmentVariables, extension-output-#2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
rvinzentcommented, Aug 27, 2019

@karrtikr the jedi server doesn’t work well for me. I would rather use the Microsoft Language Server with the linting disabled. Is this possible? I’ll also try to find the time to produce a minimal repo highlighting the issue with flake8.

0reactions
karrtikrcommented, Aug 27, 2019

You can always disable linting (from command palette) and use Microsoft language server.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linting Python in Visual Studio Code
The linter has not been installed in the current Python environment. Open a command prompt, navigate to the location where your selecter interpreter...
Read more >
lint Source Code Checker - Oracle Help Center
The lint program issues every error and warning message produced by the C compiler. It also issues warnings about potential bugs and portability...
Read more >
Show all warnings and errors in visual studio code
UPDATE 2019. ES-Lint has introduced a new task in VS Code. You have to enable it in the workspace setings. "eslint.lintTask.enable": true.
Read more >
Command Line Interface - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
False Positives - golangci-lint
Most of the linters has a configuration, sometimes false-positives can be related to a bad configuration of a linter. So it's recommended to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found