Skip to content

Commit 7659afe

Browse files
committed
Lint with new Makefile target via autopop8 & autoflake
1 parent 084208d commit 7659afe

File tree

231 files changed

+6598
-9479
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+6598
-9479
lines changed

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,15 @@ lint_javascript: ## Check Javascript code style compliance
7676
.PHONY: lint
7777
lint: lint_javascript lint_python ## Check for code style violations (JavaScript, Python)
7878
@echo "$@: OK"
79+
80+
.PHONY: format_python
81+
format_python:
82+
@which autoflake > /dev/null || pip install autoflake
83+
@which autopep8 > /dev/null || pip install autopep8
84+
@autoflake api tools/python -i --recursive --remove-all-unused-imports \
85+
--ignore-init-module-imports --remove-unused-variables
86+
@autopep8 api/ tools/python/ -i --recursive -a -a -a --experimental \
87+
--select=E9,E2,E3,E5,F63,F7,F82,F4,F841,W291 \
88+
--exclude .git,__pycache__,docs/source/conf.py,old,build,dist,venv \
89+
--max-line-length=140
90+
@echo "$@: OK"

api/client/setup.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,13 @@
2626
# prerequisite: setuptools
2727
# http://pypi.python.org/pypi/setuptools
2828

29-
REQUIRES = ["certifi>=2017.4.17", "python-dateutil>=2.1", "six>=1.10", "urllib3>=1.23"]
30-
29+
REQUIRES = [
30+
"certifi>=2017.4.17",
31+
"python-dateutil>=2.1",
32+
"six>=1.10",
33+
"urllib3>=1.23"
34+
]
35+
3136

3237
setup(
3338
name=NAME,
@@ -42,5 +47,5 @@
4247
include_package_data=True,
4348
long_description="""\
4449
Machine Learning Exchange API Client
45-
""",
50+
"""
4651
)

api/client/swagger_client/__init__.py

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
# import ApiClient
3434
from swagger_client.api_client import ApiClient
3535
from swagger_client.configuration import Configuration
36-
3736
# import models into sdk package
3837
from swagger_client.models.any_value import AnyValue
3938
from swagger_client.models.api_access_token import ApiAccessToken
@@ -42,25 +41,15 @@
4241
from swagger_client.models.api_catalog_upload_item import ApiCatalogUploadItem
4342
from swagger_client.models.api_credential import ApiCredential
4443
from swagger_client.models.api_generate_code_response import ApiGenerateCodeResponse
45-
from swagger_client.models.api_generate_model_code_response import ( # noqa: F401
46-
ApiGenerateModelCodeResponse,
47-
)
44+
from swagger_client.models.api_generate_model_code_response import ApiGenerateModelCodeResponse
4845
from swagger_client.models.api_get_template_response import ApiGetTemplateResponse
4946
from swagger_client.models.api_inferenceservice import ApiInferenceservice
50-
from swagger_client.models.api_list_catalog_items_response import ( # noqa: F401
51-
ApiListCatalogItemsResponse,
52-
)
53-
from swagger_client.models.api_list_catalog_upload_errors import ( # noqa: F401
54-
ApiListCatalogUploadErrors,
55-
)
47+
from swagger_client.models.api_list_catalog_items_response import ApiListCatalogItemsResponse
48+
from swagger_client.models.api_list_catalog_upload_errors import ApiListCatalogUploadErrors
5649
from swagger_client.models.api_list_components_response import ApiListComponentsResponse
57-
from swagger_client.models.api_list_credentials_response import ( # noqa: F401
58-
ApiListCredentialsResponse,
59-
)
50+
from swagger_client.models.api_list_credentials_response import ApiListCredentialsResponse
6051
from swagger_client.models.api_list_datasets_response import ApiListDatasetsResponse
61-
from swagger_client.models.api_list_inferenceservices_response import ( # noqa: F401
62-
ApiListInferenceservicesResponse,
63-
)
52+
from swagger_client.models.api_list_inferenceservices_response import ApiListInferenceservicesResponse
6453
from swagger_client.models.api_list_models_response import ApiListModelsResponse
6554
from swagger_client.models.api_list_notebooks_response import ApiListNotebooksResponse
6655
from swagger_client.models.api_list_pipelines_response import ApiListPipelinesResponse
@@ -71,17 +60,15 @@
7160
from swagger_client.models.api_parameter import ApiParameter
7261
from swagger_client.models.api_pipeline import ApiPipeline
7362
from swagger_client.models.api_pipeline_custom import ApiPipelineCustom
74-
from swagger_client.models.api_pipeline_custom_run_payload import ( # noqa: F401
75-
ApiPipelineCustomRunPayload,
76-
)
63+
from swagger_client.models.api_pipeline_custom_run_payload import ApiPipelineCustomRunPayload
7764
from swagger_client.models.api_pipeline_dag import ApiPipelineDAG
7865
from swagger_client.models.api_pipeline_extension import ApiPipelineExtension
7966
from swagger_client.models.api_pipeline_inputs import ApiPipelineInputs
8067
from swagger_client.models.api_pipeline_task import ApiPipelineTask
8168
from swagger_client.models.api_pipeline_task_arguments import ApiPipelineTaskArguments
8269
from swagger_client.models.api_run_code_response import ApiRunCodeResponse
8370
from swagger_client.models.api_settings import ApiSettings
84-
from swagger_client.models.api_settings_section import ApiSettingsSection # noqa: F401
71+
from swagger_client.models.api_settings_section import ApiSettingsSection
8572
from swagger_client.models.api_status import ApiStatus
8673
from swagger_client.models.api_url import ApiUrl
8774
from swagger_client.models.dictionary import Dictionary

0 commit comments

Comments
 (0)