Skip to content

Commit 57f8e15

Browse files
authored
Add the flake8 to be the default code formatter (#401)
1 parent 18c4dc1 commit 57f8e15

24 files changed

+59
-45
lines changed

.azure-pipelines/linux-conda-CI.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ jobs:
7171
make lib
7272
displayName: 'Install dependencies'
7373
74+
- script: |
75+
python -m flake8 ./onnxmltools
76+
displayName: 'run flake8 check'
77+
7478
- script: |
7579
export PYTHONPATH=$PYTHONPATH:libsvm/python
7680
python -c "import svmutil"

.azure-pipelines/win32-conda-CI.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ jobs:
8787
python -m pip show pytest
8888
displayName: 'Install dependencies'
8989
90+
- script: |
91+
call activate py$(python.version)
92+
python -m flake8 ./onnxmltools
93+
displayName: 'run flake8 check'
94+
9095
- script: |
9196
call activate py$(python.version)
9297
set PYTHONPATH=libsvm\python;%PYTHONPATH%

.flake8

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[flake8]
2+
max-line-length = 120
3+
per-file-ignores =
4+
__init__.py:F401
5+
exclude =
6+
sparkml
7+
coreml
8+
libsvm
9+
xgboost
10+
utils

onnxmltools/convert/common/_apply_operation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# license information.
55
# --------------------------------------------------------------------------
66

7-
from onnxconverter_common.onnx_ops import *
7+
from onnxconverter_common.onnx_ops import * # noqa

onnxmltools/convert/common/_container.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ class LightGbmModelContainer(CommonSklearnModelContainer):
1717
class XGBoostModelContainer(CommonSklearnModelContainer):
1818
pass
1919

20+
2021
class H2OModelContainer(CommonSklearnModelContainer):
2122
pass
2223

24+
2325
class SparkmlModelContainer(RawModelContainer):
2426

2527
def __init__(self, sparkml_model):

onnxmltools/convert/common/_registration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# license information.
55
# --------------------------------------------------------------------------
66

7-
from onnxconverter_common.registration import *
7+
from onnxconverter_common.registration import * # noqa

onnxmltools/convert/common/_topology.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# license information.
55
# --------------------------------------------------------------------------
66

7-
from onnxconverter_common.topology import *
7+
from onnxconverter_common.topology import * # noqa

onnxmltools/convert/common/case_insensitive_dict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# license information.
55
# --------------------------------------------------------------------------
66

7-
from onnxconverter_common.case_insensitive_dict import *
7+
from onnxconverter_common.case_insensitive_dict import * # noqa

onnxmltools/convert/common/data_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# license information.
55
# --------------------------------------------------------------------------
66

7-
from onnxconverter_common.data_types import *
7+
from onnxconverter_common.data_types import * # noqa

onnxmltools/convert/common/interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# This file defines the interface of the converter internal object for callback,
77
# So the usage of the methods and properties list here will not be affected among the different versions.
88

9-
from onnxconverter_common.interface import *
9+
from onnxconverter_common.interface import * # noqa

0 commit comments

Comments
 (0)