Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flake8 fails to load extend-ignore from .flake8 config #18528

Closed
ssbarnea opened this issue Feb 16, 2022 · 3 comments
Closed

flake8 fails to load extend-ignore from .flake8 config #18528

ssbarnea opened this issue Feb 16, 2022 · 3 comments
Assignees
Labels
area-linting bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@ssbarnea
Copy link

ssbarnea commented Feb 16, 2022

Issue Type: Bug

Behaviour

Expected vs. Actual

Flake8 run by vscode must behave the same way as flake8 run from the command line.

Steps to reproduce:

  1. Create a .flake8 config file
extend-ignore =
  E501,

Note that extend-ignore adds more ignores to its own default ignore list without overriding it. See https://flake8.pycqa.org/en/latest/user/violations.html#extending-the-default-ignore-list

The ignore option works as expected but not the extend-ignore one.

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.0
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Pyenv
  • Value of the python.languageServer setting: Pylance
User Settings


defaultLS: {"defaultLSType":"Pylance"}

downloadLanguageServer: true

envFile: "<placeholder>"

venvPath: "<placeholder>"

venvFolders: "<placeholder>"

condaPath: "<placeholder>"

pipenvPath: "<placeholder>"

poetryPath: "<placeholder>"

languageServer: "Pylance"

linting
• enabled: true
• cwd: "<placeholder>"
• Flake8Args: "<placeholder>"
• flake8Enabled: true
• flake8Path: "<placeholder>"
• lintOnSave: true
• banditArgs: "<placeholder>"
• banditEnabled: false
• banditPath: "<placeholder>"
• mypyArgs: "<placeholder>"
• mypyEnabled: true
• mypyPath: "<placeholder>"
• pycodestyleArgs: "<placeholder>"
• pycodestyleEnabled: false
• pycodestylePath: "<placeholder>"
• prospectorArgs: "<placeholder>"
• prospectorEnabled: false
• prospectorPath: "<placeholder>"
• pydocstyleArgs: "<placeholder>"
• pydocstyleEnabled: false
• pydocstylePath: "<placeholder>"
• pylamaArgs: "<placeholder>"
• pylamaEnabled: false
• pylamaPath: "<placeholder>"
• pylintArgs: "<placeholder>"
• pylintPath: "<placeholder>"

sortImports
• args: "<placeholder>"
• path: "<placeholder>"

formatting
• autopep8Args: "<placeholder>"
• autopep8Path: "<placeholder>"
• provider: "black"
• blackArgs: "<placeholder>"
• blackPath: "<placeholder>"
• yapfArgs: "<placeholder>"
• yapfPath: "<placeholder>"

testing
• cwd: "<placeholder>"
• debugPort: 3000
• nosetestArgs: "<placeholder>"
• nosetestsEnabled: undefined
• nosetestPath: "<placeholder>"
• promptToConfigure: true
• pytestArgs: "<placeholder>"
• pytestEnabled: true
• pytestPath: "<placeholder>"
• unittestArgs: "<placeholder>"
• unittestEnabled: false
• autoTestDiscoverOnSaveEnabled: true

terminal
• activateEnvironment: false
• executeInFileDir: "<placeholder>"
• launchArgs: "<placeholder>"

experiments
• enabled: true
• optInto: []
• optOutFrom: []

insidersChannel: "off"

tensorBoard
• logDirectory: "<placeholder>"

Extension version: 2022.0.1814523869
VS Code version: Code 1.64.2 (f80445acd5a3dadef24aa209168452a3d97cc326, 2022-02-09T22:00:58.347Z)
OS version: Darwin x64 21.3.0
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 x 4200)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 40.00GB (0.59GB free)
Process Argv . --crash-reporter-id 03ebe87f-b162-449a-862d-238cdfac955f
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392cf:30425750
pythontb:30283811
pythonvspyt551cf:30345471
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dst:30438360
pythonvs932:30410667
wslgetstartedc:30433508
vsclayoutctrc:30437038
vsrem710cf:30416617
dsvsc009:30436279
pythonvspyt640:30436486
vsbas813:30436447
vscscmwlcmt:30436993
helixcf:30438276

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 16, 2022
@ssbarnea
Copy link
Author

I think I found the culprit as below but I am still not sure if that is a bug or expected behavior. Maybe it would be a good idea to update the documentation of such option and say that will override file configuration and not extend it.

@karthiknadig
Copy link
Member

@ssbarnea We don't really control the overriding the config behavior. If you have added the flake8Args, we just pass it along to the linter. It is entirely up to the linter to handle that. You should be able to see that in the Output > Python logs.

We are planning on moving flake8 and other linters into their own extension, we have a prototype for that see here PyCQA/flake8#1467 (comment) If you want to try it out and see if that works better.

@karthiknadig karthiknadig self-assigned this Feb 16, 2022
@karthiknadig karthiknadig added area-linting bug Issue identified by VS Code Team member as probable bug triage info-needed Issue requires more information from poster and removed triage-needed Needs assignment to the proper sub-team labels Feb 16, 2022
@karthiknadig
Copy link
Member

Closing this, since the override behavior is not really controlled by the python extension.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-linting bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants