"llegal argument: line must be non-negative" when using flake8 and flake8-isort
See original GitHub issueEnvironment data
- VS Code version: 1.38.0
- Extension version: 2019.9.34911
- OS and version: Windows 10 Home
- Python version: Python 3.7 (Anaconda Variant)
- Type of virtual environment used: conda
- Relevant/affected Python packages and their versions: flake8: 3.7.8, flake8_isort: 2.3
- Jedi or Language Server?: Language Server
Expected behaviour
VSCode fully lints a file using flake8 and the flake8_isort plugin and highlight errors, warnings and information as appropriate.
Actual behaviour
When using flake8 as a linter in vscode, if flake8 finds a reported error, warning or info that has a location line number of 0, vscode throws the error “llegal argument: line must be non-negative” and does not complete linting.
This happens for example when using when using the flake8-isort extension, as I002 specifies there is no isort configuration found, and the Info location line number is 0.
This is also an issue if using the wemake-python-styleguide as there are several rules which report a line location of 0.
Steps to reproduce:
- Install flake8 and the flake8-isort plugin
- Set VSCode to use flake8 as the linter
- Run flake8 linting on any file through vscode, ensuring there is no isort config file in the same folder that can be detected
Logs
Output for Python
in the Output
panel
##########Linting Output - flake8########## 0,1,I,I002:no configuration found (.isort.cfg or [isort] in configs)
Output from Console
under the Developer Tools
panel:
notificationsAlerts.ts:38 Error: Illegal argument: line must be non-negative at Object.t.illegalArgument (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:13:195) at new g (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:350:768) at new g (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:350:44) at w.createDiagnostics (c:\Users\Arran.vscode\extensions\ms-python.python-2019.9.34911\out\client\extension.js:119:490471) at w.lintDocument (c:\Users\Arran.vscode\extensions\ms-python.python-2019.9.34911\out\client\extension.js:119:489854)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top GitHub Comments
I just wanted to acknowledge that we received this bug report, @ahobsonsayers .
Validated: