From 8091d146a0794918578be0e03832c88e4693f744 Mon Sep 17 00:00:00 2001 From: themylogin Date: Mon, 14 Mar 2022 20:22:39 +0400 Subject: [PATCH] Employ `flake8-import-order` to ensure correct import orders according to PEP8 --- .github/workflows/lint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c9f7cd7a17b5..d000dc1eafed 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,11 +20,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 + pip install flake8 flake8-import-order - name: Get current errors run: | tmpafter=$(mktemp) - find src -name \*.py -exec flake8 --ignore=E402,E501,W504 {} + | egrep -v "alembic/versions/|usr/local/share/pysnmp/mibs/" > $tmpafter + find src -name \*.py -exec flake8 --application-import-names middlewared --ignore=E402,E501,W504 {} + | egrep -v "alembic/versions/|usr/local/share/pysnmp/mibs/" > $tmpafter num_errors_after=`cat $tmpafter | wc -l` echo "CURRENT_ERROR_FILE=${tmpafter}" >> $GITHUB_ENV echo "CURRENT_ERRORS=${num_errors_after}" >> $GITHUB_ENV @@ -35,7 +35,7 @@ jobs: - name: Get errors from base branch run: | tmpbefore=$(mktemp) - find src -name \*.py -exec flake8 --ignore=E402,E501,W504 {} + | egrep -v "alembic/versions/|usr/local/share/pysnmp/mibs/" > $tmpbefore + find src -name \*.py -exec flake8 --application-import-names middlewared --ignore=E402,E501,W504 {} + | egrep -v "alembic/versions/|usr/local/share/pysnmp/mibs/" > $tmpbefore num_errors_before=`cat $tmpbefore | wc -l` echo "OLD_ERROR_FILE=${tmpbefore}" >> $GITHUB_ENV echo "OLD_ERRORS=${num_errors_before}" >> $GITHUB_ENV