зеркало из https://github.com/microsoft/CCF.git
Ask `ruff` to autofix Python lint errors, where possible (#5903)
Co-authored-by: Amaury Chamayou <amchamay@microsoft.com>
This commit is contained in:
Родитель
6a2cb50358
Коммит
11c2737df3
|
@ -21,6 +21,8 @@ function group(){
|
|||
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
|
||||
if [[ ${CI} ]]; then
|
||||
echo "::group::$1"
|
||||
else
|
||||
echo "-=[ $1 ]=-"
|
||||
fi
|
||||
}
|
||||
function endgroup() {
|
||||
|
@ -119,7 +121,11 @@ pip install -U -r python/requirements.txt 1>/dev/null
|
|||
endgroup
|
||||
|
||||
group "Python lint"
|
||||
ruff check python/ tests/
|
||||
if [ $FIX -ne 0 ]; then
|
||||
ruff check --fix python/ tests/
|
||||
else
|
||||
ruff check python/ tests/
|
||||
fi
|
||||
endgroup
|
||||
|
||||
group "Python types"
|
||||
|
|
Загрузка…
Ссылка в новой задаче