Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Run flake8 tests to find Python syntax errors and undefined names #1217

Merged
merged 7 commits into from
Jul 10, 2019

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Jun 26, 2019

No description provided.

@@ -13,6 +13,10 @@ jobs:
- script: |
source install.sh
displayName: 'Install nni toolkit via source code'
- script: |
python3 -m pip install flake8
flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you may need to add "--user"

@scarlett2018 scarlett2018 added this to the July 2019 Release milestone Jun 28, 2019
@chicm-ms
Copy link
Contributor

chicm-ms commented Jul 2, 2019

@cclauss Thanks for contributing this PR.
There are some annotation related errors can not be fixed right now, those annotated py files are executed after the annotation is processed. Could you please add following files as ignored files?

./tools/nni_annotation/*:F821
./examples/trials/mnist-nas/mnist.py:F821

The rest errors can be fixed soon, we will merge this PR after the errors are fixed.

@chicm-ms
Copy link
Contributor

chicm-ms commented Jul 2, 2019

@cclauss The ignore config ./tools/nni_annotation/*:F821 seems not working, following are the files I would like to ignore:

./tools/nni_annotation/testcase/mutable_layer_usercode/simple.py:F821
./tools/nni_annotation/testcase/usercode/dir/simple.py:F821
./tools/nni_annotation/testcase/annotated/dir/simple.py:F821
./tools/nni_annotation/testcase/annotated/handwrite.py:F821
./examples/trials/mnist-nas/mnist.py:F821

@@ -13,6 +13,11 @@ jobs:
- script: |
source install.sh
displayName: 'Install nni toolkit via source code'
- script: |
python3 -m pip install flake8 --user
IGNORE=./tools/nni_annotation/testcase:F821,./examples/trials/mnist-nas/mnist.py:F821
Copy link
Contributor

@chicm-ms chicm-ms Jul 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just checked locally, should change to --per-file-ignores

--per-file-ignores ./tools/nni_annotation/*:F821,./examples/trials/mnist-nas/mnist.py:F821

@chicm-ms
Copy link
Contributor

chicm-ms commented Jul 2, 2019

@cclauss Thanks, the ignore config is working now.

@suiguoxin suiguoxin mentioned this pull request Jul 8, 2019
44 tasks
@xuehui1991 xuehui1991 merged commit 917ce97 into microsoft:master Jul 10, 2019
@cclauss cclauss deleted the patch-1 branch July 10, 2019 12:34
@suiguoxin suiguoxin mentioned this pull request Aug 6, 2019
66 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants