Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Satisfy linters

Krzysztof Wolskideb12c0433a5
diff --git a/.pylintrc b/.pylintrc
index 2163e1c893..7255c2cc8c 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -1,11 +1,13 @@
[MASTER]
load-plugins=pylint.extensions.bad_builtin, pylint.extensions.mccabe, pylint_celery, pylint_django
+django-settings-module=saleor.settings
[MESSAGES CONTROL]
disable=C0103, C0111, C0330, C0412, C1001, E1004, E1101, I0011, R0903, W0232, W0621
[DESIGN]
max-complexity=5
+max-line-length = 88
[SIMILARITIES]
ignore-imports=yes
diff --git a/saleor/graphql/account/enums.py b/saleor/graphql/account/enums.py
index 101a00b859..f5eaecb9a3 100644
--- a/saleor/graphql/account/enums.py
+++ b/saleor/graphql/account/enums.py
@@ -22,7 +22,7 @@ class StaffMemberStatus(graphene.Enum):
@property
def description(self):
if self == StaffMemberStatus.ACTIVE:
- return 'User account has been activated.'
+ return "User account has been activated."
elif self == StaffMemberStatus.DEACTIVATED:
- return 'User account has not been activated yet.'
+ return "User account has not been activated yet."
return None
diff --git a/saleor/graphql/app/enums.py b/saleor/graphql/app/enums.py
index 2be7869e5e..299b2fca76 100644
--- a/saleor/graphql/app/enums.py
+++ b/saleor/graphql/app/enums.py
@@ -3,17 +3,20 @@ from ..core.enums import to_enum
def description(enum):
- if enum == AppTypeEnum.LOCAL:
+ if enum is None:
+ return "Enum determining type of your App."
+ elif enum == AppTypeEnum.LOCAL:
return (
- "Local Saleor App. The app is fully manageable from dashboard. ",
- "You can change assigned permissions, add webhooks, or authentication token",
+ "Local Saleor App. The app is fully manageable from dashboard. "
+ "You can change assigned permissions, add webhooks, "
+ "or authentication token"
)
elif enum == AppTypeEnum.THIRDPARTY:
return (
- "Third party external App. Installation is fully automated. ",
- "Saleor uses a defined App manifest to gather all required information.",
+ "Third party external App. Installation is fully automated. "
+ "Saleor uses a defined App manifest to gather all required information."
)
- return "Enum determining type of your App."
+ return None
AppTypeEnum = to_enum(AppType, description=description)
diff --git a/saleor/graphql/webhook/enums.py b/saleor/graphql/webhook/enums.py
index 4575254e20..f3c730e1c9 100644
--- a/saleor/graphql/webhook/enums.py
+++ b/saleor/graphql/webhook/enums.py
@@ -5,12 +5,15 @@ from ..core.utils import str_to_enum
def description(enum):
- if enum == None:
+ if enum is None:
return "Enum determining type of webhook."
elif enum == WebhookEventTypeEnum.CHECKOUT_CREATED:
return "A new checkout is created."
elif enum == WebhookEventTypeEnum.CHECKOUT_UPDATED:
- return "A checkout is updated. Also triggers for all updates related to a checkout."
+ return (
+ "A checkout is updated. "
+ "Also triggers for all updates related to a checkout."
+ )
elif enum == WebhookEventTypeEnum.CUSTOMER_CREATED:
return "A new customer account is created."
elif enum == WebhookEventTypeEnum.CUSTOMER_UPDATED:
@@ -20,11 +23,19 @@ def description(enum):
elif enum == WebhookEventTypeEnum.ORDER_CREATED:
return "A new order is placed."
elif enum == WebhookEventTypeEnum.ORDER_CONFIRMED:
- return "An order is confirmed (status change unconfirmed -> unfulfilled) by staff user using OrderConfirm mutation. Also triggers when user finish checkout and shop setting `automatically_confirm_all_new_orders` is enabled."
+ return (
+ "An order is confirmed (status change unconfirmed -> unfulfilled) "
+ "by staff user using OrderConfirm mutation. "
+ "Also triggers when user finish checkout and shop setting "
+ "`automatically_confirm_all_new_orders` is enabled."
+ )
elif enum == WebhookEventTypeEnum.ORDER_FULLY_PAID:
return "Payment is made and an order is fully paid."
elif enum == WebhookEventTypeEnum.ORDER_UPDATED:
- return "An order is updated; triggered for all changes related to an order; covers all other order webhooks, except for ORDER_CREATED."
+ return (
+ "An order is updated; triggered for all changes related to an order; "
+ "covers all other order webhooks, except for ORDER_CREATED."
+ )
elif enum == WebhookEventTypeEnum.ORDER_CANCELLED:
return "An order is cancelled."
elif enum == WebhookEventTypeEnum.ORDER_FULFILLED:
@@ -57,7 +68,7 @@ def description(enum):
return "Invoice has been send."
elif enum == WebhookEventTypeEnum.ANY_EVENTS:
return "All the events."
- return
+ return None
WebhookEventTypeEnum = graphene.Enum(