Skip to content

Commit 29af106

Browse files
Fix GitHub Actions formatting configuration
1 parent baa15df commit 29af106

File tree

4 files changed

+10
-18
lines changed

4 files changed

+10
-18
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ jobs:
3030
run: |
3131
# stop the build if there are Python syntax errors or undefined names
3232
flake8 src/ --count --select=E9,F63,F7,F82 --show-source --statistics
33-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
34-
flake8 src/ --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
33+
# exit-zero treats all errors as warnings. Use 120 char line length to match black/isort config
34+
flake8 src/ --count --exit-zero --max-complexity=10 --max-line-length=120 --extend-ignore=E203,W503 --statistics
3535
3636
- name: Check formatting with black
3737
run: |
38-
black --check --diff src/ tests/
38+
black --check --diff --line-length=120 src/ tests/
3939
4040
- name: Check import sorting with isort
4141
run: |
42-
isort --check-only --diff src/ tests/
42+
isort --check-only --diff --profile=black --line-length=120 src/ tests/
4343
4444
- name: Type check with mypy
4545
run: |

src/devo_global_comms_python/exceptions.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Dict, Optional, Union
1+
from typing import Any, Dict, Optional
22

33
import requests
44

@@ -59,9 +59,7 @@ def __init__(
5959
self.request_details = {
6060
"method": response.request.method,
6161
"url": response.request.url,
62-
"headers": dict(response.request.headers)
63-
if hasattr(response.request, "headers")
64-
else {},
62+
"headers": dict(response.request.headers) if hasattr(response.request, "headers") else {},
6563
}
6664
except (AttributeError, TypeError):
6765
# Handle cases where response is mocked or doesn't have expected attributes
@@ -274,9 +272,7 @@ def __init__(
274272
**kwargs,
275273
):
276274
if required and available:
277-
message = (
278-
f"Insufficient credits. Required: {required}, Available: {available}"
279-
)
275+
message = f"Insufficient credits. Required: {required}, Available: {available}"
280276
else:
281277
message = "Insufficient credits to complete this operation"
282278
super().__init__(message, status_code=402, **kwargs)

src/devo_global_comms_python/services.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
This module provides a namespace for accessing service-related functionality
55
such as contact management, contact groups, and other data management services.
66
"""
7+
78
from typing import TYPE_CHECKING
89

910
from .resources.contact_groups import ContactGroupsResource

tests/test_client.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
import requests
55

66
from devo_global_comms_python import DevoClient
7-
from devo_global_comms_python.exceptions import (
8-
DevoAPIException,
9-
DevoAuthenticationException,
10-
)
7+
from devo_global_comms_python.exceptions import DevoAPIException, DevoAuthenticationException
118

129

1310
class TestDevoClient:
@@ -27,9 +24,7 @@ def test_client_initialization_with_custom_params(self, api_key):
2724
timeout = 60.0
2825
max_retries = 5
2926

30-
client = DevoClient(
31-
api_key=api_key, base_url=base_url, timeout=timeout, max_retries=max_retries
32-
)
27+
client = DevoClient(api_key=api_key, base_url=base_url, timeout=timeout, max_retries=max_retries)
3328

3429
assert client.base_url == base_url
3530
assert client.timeout == timeout

0 commit comments

Comments
 (0)