mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-20 19:12:24 +00:00
Update ReformatSourcePython.bat to use YAPF to format python code, and add onnxruntime\test directory to be formatted. Add onnxruntime\.style.yapf for configuration. The style is based on google, except max column width 120. Format python scripts using ReformatSourcePython.bat.
21 lines
854 B
Batchfile
21 lines
854 B
Batchfile
:: Copyright (c) Microsoft Corporation. All rights reserved.
|
|
:: Licensed under the MIT License.
|
|
|
|
:: Before running this, please make sure python.exe is in path, and yapf is installed like the following
|
|
:: pip install --upgrade yapf
|
|
|
|
:: If you use Visual Studio Code, you can configure like the following:
|
|
:: "python.formatting.provider": "yapf"
|
|
:: "python.formatting.yapfArgs": ["--style", "{based_on_style: google, column_limit: 120}"]
|
|
:: See https://code.visualstudio.com/docs/python/editing for more info
|
|
|
|
:: The style configuration file is .style.yapf in current directory.
|
|
|
|
:: You can setup git pre-commit hook following https://github.com/google/yapf/tree/master/plugins.
|
|
|
|
:: For more info about YAPF, see https://github.com/google/yapf
|
|
|
|
yapf -ir ./python
|
|
yapf -ir ./test
|
|
|
|
if errorlevel 1 echo please install python, then pip install yapf
|