Skip to content

Commit 12f85d7

Browse files
author
Jose Luis Moreno
committed
fix: apply code formatting fixes for linting compliance
- Fix trailing whitespace in core source files - Apply ruff formatting to search.py, epics.py, and models - Address code style violations for PR compliance
1 parent 384bd17 commit 12f85d7

File tree

6 files changed

+83
-103
lines changed

6 files changed

+83
-103
lines changed

src/mcp_atlassian/jira/epics.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -780,10 +780,9 @@ def _find_sample_epic(self) -> list[dict]:
780780
try:
781781
# Search for issues with type=Epic
782782
jql = "issuetype = Epic ORDER BY updated DESC"
783-
response = self.jira.post("rest/api/3/search/jql", json={
784-
"jql": jql,
785-
"maxResults": 1
786-
})
783+
response = self.jira.post(
784+
"rest/api/3/search/jql", json={"jql": jql, "maxResults": 1}
785+
)
787786
if not isinstance(response, dict):
788787
msg = f"Unexpected return value type from `jira.jql`: {type(response)}"
789788
logger.error(msg)
@@ -814,10 +813,9 @@ def _find_issues_linked_to_epic(self, epic_key: str) -> list[dict]:
814813
f"issueFunction in issuesScopedToEpic('{epic_key}')",
815814
]:
816815
try:
817-
response = self.jira.post("rest/api/3/search/jql", json={
818-
"jql": query,
819-
"maxResults": 5
820-
})
816+
response = self.jira.post(
817+
"rest/api/3/search/jql", json={"jql": query, "maxResults": 5}
818+
)
821819
if not isinstance(response, dict):
822820
msg = f"Unexpected return value type from `jira.jql`: {type(response)}"
823821
logger.error(msg)

src/mcp_atlassian/jira/search.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def search_issues(
9696
payload = {
9797
"jql": jql,
9898
"fields": fields_param.split(",") if fields_param else [],
99-
"maxResults": min(limit, 100)
99+
"maxResults": min(limit, 100),
100100
}
101101
if expand:
102102
payload["expand"] = expand.split(",")
@@ -120,12 +120,14 @@ def search_issues(
120120

121121
# Check for more pages - new API uses isLast instead of nextPageToken
122122
is_last = response.get("isLast", True)
123-
next_page_token = response.get("nextPageToken") # May not be present
124-
123+
next_page_token = response.get(
124+
"nextPageToken"
125+
) # May not be present
126+
125127
# Break if this is the last page or we've reached the limit
126128
if is_last or len(all_issues) >= limit:
127129
break
128-
130+
129131
# For pagination, we may need to use different approach
130132
# If nextPageToken is not available, we might need to use startAt
131133
if not next_page_token:
@@ -142,7 +144,7 @@ def search_issues(
142144
"issues": all_issues,
143145
"total": actual_total,
144146
"maxResults": limit,
145-
"startAt": 0
147+
"startAt": 0,
146148
}
147149

148150
search_result = JiraSearchResult.from_api_response(
@@ -159,9 +161,9 @@ def search_issues(
159161
fields=fields_param,
160162
start=start,
161163
limit=min(limit, 50),
162-
expand=expand
164+
expand=expand,
163165
)
164-
166+
165167
if not isinstance(response, dict):
166168
msg = f"Unexpected return value type from jql: {type(response)}"
167169
logger.error(msg)

src/mcp_atlassian/models/jira/issue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def from_api_response(cls, data: dict[str, Any], **kwargs: Any) -> "JiraIssue":
268268
key = str(data.get("key", JIRA_DEFAULT_KEY))
269269
summary = str(fields.get("summary", EMPTY_STRING))
270270
description = fields.get("description")
271-
271+
272272
# Handle ADF (Atlassian Document Format) description
273273
if isinstance(description, dict):
274274
# Extract plain text from ADF format if possible

src/mcp_atlassian/models/jira/search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def from_api_response(
6969
raw_total = data.get("total")
7070
raw_start_at = data.get("startAt")
7171
raw_max_results = data.get("maxResults")
72-
72+
7373
# New API may not include these fields, especially when empty
7474
# For new API, we need to infer values from available data
7575
if raw_total is None and "isLast" in data:

tests/unit/jira/test_epics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from mcp_atlassian.jira import JiraFetcher
88
from mcp_atlassian.jira.epics import EpicsMixin
9-
from mcp_atlassian.models.jira import JiraIssue, JiraSearchResult
9+
from mcp_atlassian.models.jira import JiraIssue
1010

1111

1212
class TestEpicsMixin:

0 commit comments

Comments
 (0)