Skip to content

Commit 567fbb7

Browse files
Merge pull request #21 from shervyna/flake8
add .flake file and fix flake8 errors
2 parents aedf537 + 86a4236 commit 567fbb7

31 files changed

+182
-123
lines changed

.flake8

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[flake8]
2+
# delete D100~D107 for docstring checks
3+
# W503 contradicts with pep8 and will soon be fixed by flake8
4+
ignore = W503, D100, D101, D102, D103, D104, D107
5+
max-line-length = 99
6+
exclude =
7+
__pycache__,
8+
azure/durable_functions/grpc/protobuf/

azure-pipelines.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ steps:
3232
displayName: 'Autogenerate gRPC Python files'
3333

3434
- script: |
35-
flake8 . --count --show-source --statistics --exit-zero
35+
cd azure
36+
flake8 . --count --show-source --statistics
3637
displayName: 'Run lint test with flake8'
3738

3839
- script: |

azure/durable_functions/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
__all__ = [
55
'Orchestrator',
66
'DurableOrchestrationClient'
7-
]
7+
]

azure/durable_functions/models/DurableOrchestrationClient.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def __init__(self, context: str):
2525
self._showHistoryQueryKey: str = "showHistory"
2626
self._showHistoryOutputQueryKey: str = "showHistoryOutput"
2727
self._showInputQueryKey: str = "showInput"
28-
self._orchestrationBindings: DurableOrchestrationBindings = DurableOrchestrationBindings(context)
28+
self._orchestrationBindings: DurableOrchestrationBindings = \
29+
DurableOrchestrationBindings(context)
2930

3031
def start_new(self,
3132
orchestration_function_name: str,
@@ -42,7 +43,8 @@ def get_json_input(client_input):
4243

4344
def get_start_new_url(self, instance_id, orchestration_function_name):
4445
request_url = self._orchestrationBindings.creation_urls['createNewInstancePostUri']
45-
request_url = request_url.replace(self._functionNamePlaceholder, orchestration_function_name)
46+
request_url = request_url.replace(self._functionNamePlaceholder,
47+
orchestration_function_name)
4648
request_url = request_url.replace(self._instanceIdPlaceholder,
4749
f'/{instance_id}' if instance_id is not None else '')
4850
return request_url

azure/durable_functions/models/OrchestratorState.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22
from typing import List, Any, Dict
3-
from .utils.json_utils import add_attrib, add_json_attrib
3+
from .utils.json_utils import add_attrib
4+
45

56
class OrchestratorState:
67
def __init__(self,

azure/durable_functions/models/RetryOptions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def __init__(self, first_retry_interval_in_milliseconds: int, max_number_of_atte
1515
def to_json(self) -> Dict[str, Any]:
1616
json_dict = {}
1717

18-
add_attrib(json_dict, self, 'first_retry_interval_in_milliseconds', 'firstRetryIntervalInMilliseconds')
18+
add_attrib(json_dict, self, 'first_retry_interval_in_milliseconds',
19+
'firstRetryIntervalInMilliseconds')
1920
add_attrib(json_dict, self, 'max_number_of_attempts', 'maxNumberOfAttempts')
2021
return json_dict

azure/durable_functions/models/actions/CallActivityAction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Any, Dict
22

33
from .ActionType import ActionType
4-
from ..utils.json_utils import add_attrib, add_json_attrib
4+
from ..utils.json_utils import add_attrib
55

66

77
class CallActivityAction:

azure/durable_functions/models/history/HistoryEvent.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from datetime import datetime
21
from .HistoryEventType import HistoryEventType
32

43

azure/durable_functions/models/history/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
__all__ = [
55
'HistoryEvent',
66
'HistoryEventType'
7-
]
7+
]

azure/durable_functions/models/utils/json_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ def add_attrib(json_dict: Dict[str, Any], object_, attribute_name: str, alt_name
88

99
def add_json_attrib(json_dict: Dict[str, Any], object_, attribute_name: str, alt_name: str = None):
1010
if hasattr(object_, attribute_name):
11-
json_dict[alt_name or attribute_name] = getattr(object_, attribute_name).to_json()
11+
json_dict[alt_name or attribute_name] = getattr(object_, attribute_name).to_json()

0 commit comments

Comments
 (0)