Skip to content

YAPF seems to only run sometimes #1325

Closed
@joshburkart

Description

@joshburkart

Environment data

  • VS Code version: 1.21.1 (1.21.1)
  • Extension version (available under the Extensions sidebar): 2018.3.1 (29 Mar 2018)
  • OS and version: MacOS High Sierra
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda3
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: yapf==0.21.0

Actual behavior

I have the extension configured to run yapf on save. This works fine most of the time. However, seemingly when a file gets really large and complicated, even though the extension reports that yapf ran and completed (in the status bar), the file doesn't get formatted. If I try running it a few more times (e.g. add some extra unnecessary trailing spaces somewhere), it eventually does format the code. Running yapf on the command line consistently produces the same output, meaning I believe this is a bug with either VSCode or this extension. :)

Could it be a timeout issue? yapf takes too long so the extension gives up?

Expected behavior

yapf runs every time (and reports an error somehow if it failed).

Steps to reproduce:

?

Logs

  1. Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

    1. No yapf-associated logs are produced...
  2. Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

    1. Nothing.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions