yapf: input filenames did not match any python files - VS code, formatting doesn't work
MH-ABE opened this issue · comments
MH-ABE commented
In vs code I cannot get the formatter do work, this is the trace log:
2023-12-04 08:47:45.212 [info] [Trace - 8:47:45 AM] Sending notification 'textDocument/didChange'.
2023-12-04 08:48:19.264 [info] [Trace - 8:48:19 AM] Sending request 'textDocument/formatting - (3)'.
2023-12-04 08:48:19.267 [info] [Trace - 8:48:19 AM] Received notification 'window/logMessage'.
2023-12-04 08:48:19.267 [info] c:\Users\*\AppData\Local\Continuum\anaconda3\envs\Alarmanalys\python.exe -m yapf based_on_style = google spaces_before_comment = 2 split_before_logical_operator = true SPLIT_BEFORE_ARITHMETIC_OPERATOR = true SPLIT_BEFORE_BITWISE_OPERATOR = true indent_width = 4 column_limit = 120 SPLIT_COMPLEX_COMPREHENSION = true
2023-12-04 08:48:19.268 [info] [Trace - 8:48:19 AM] Received notification 'window/logMessage'.
2023-12-04 08:48:19.268 [info] CWD Linter: m:\Operations\1. Projekt\2020\Ny Ram\Rammaskin Prod statistik
2023-12-04 08:48:19.277 [info] [Trace - 8:48:19 AM] Received notification 'window/logMessage'.
2023-12-04 08:48:19.278 [info] yapf: input filenames did not match any python files
2023-12-04 08:48:19.278 [info] [Trace - 8:48:19 AM] Received notification 'window/logMessage'.
2023-12-04 08:48:19.278 [info] file:///m%3A/Operations/1.%20Projekt/2020/Ny%20Ram/Rammaskin%20Prod%20statistik/AlarmanalysDashboard2.py :
2023-12-04 08:48:19.278 [info] [Trace - 8:48:19 AM] Received response 'textDocument/formatting - (3)' in 14ms.
YAPF: v2023.11.122090301
VS Code: 1.84.2
Win 10
It did work properly before the VS code change to python formatting setting, perhaps I configured it incorrectly?
Relevant configs:
"[python]": {
"editor.defaultFormatter": "eeyore.yapf",
"editor.formatOnType": false
},
"yapf.args": [
"based_on_style = google",
"spaces_before_comment = 2",
"split_before_logical_operator = true",
"SPLIT_BEFORE_ARITHMETIC_OPERATOR = true",
"SPLIT_BEFORE_BITWISE_OPERATOR = true",
"indent_width = 4",
"column_limit = 120",
"SPLIT_COMPLEX_COMPREHENSION = true"
],
"yapf.showDebugLog": true,
MH-ABE commented
I had to use this type of config instead:
"yapf.args": [
"--style",
"{based_on_style: google, spaces_before_comment: 2, split_before_logical_operator: true, SPLIT_BEFORE_ARITHMETIC_OPERATOR: true, SPLIT_BEFORE_BITWISE_OPERATOR: true, indent_width: 4, column_limit: 120, SPLIT_COMPLEX_COMPREHENSION: true}"
],
With this it works fine.